Control number of attempts for TR random testing from the command line.

original commit: 7494fccc4c8af1ced3771b58515e661b2aca7f6c
This commit is contained in:
Vincent St-Amour 2012-08-06 12:48:41 -04:00
parent dab83ca0b0
commit 13b06ee19a

View File

@ -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)