From 13b06ee19a8856334e8b80f383ec2057a9c09618 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Mon, 6 Aug 2012 12:48:41 -0400 Subject: [PATCH] Control number of attempts for TR random testing from the command line. original commit: 7494fccc4c8af1ced3771b58515e661b2aca7f6c --- collects/tests/typed-racket/tr-random-testing.rkt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/collects/tests/typed-racket/tr-random-testing.rkt b/collects/tests/typed-racket/tr-random-testing.rkt index fd79fd73..f8059145 100644 --- a/collects/tests/typed-racket/tr-random-testing.rkt +++ b/collects/tests/typed-racket/tr-random-testing.rkt @@ -4,7 +4,7 @@ (require redex racket/flonum racket/unsafe/ops - racket/sandbox + racket/sandbox racket/cmdline "random-real.rkt") (require (except-in typed-racket/utils/utils infer) @@ -144,11 +144,16 @@ #f) ; go on and check preservation (right-type? sexp))) +(define n-attempts 1000) +(command-line + #:once-each + [("-n") n "Number of attempts" (set! n-attempts (string->number n))]) + (call-with-limits #f 1000 (lambda () (redex-check tr-arith F (check-all-reals (term F)) - #:attempts 1000 + #:attempts n-attempts #:prepare exp->real-exp))) ;(printf "bad tests (usually typechecking failed): ~v~n" num-exceptions)