Print seed used for TR random testing.
To make it possible to reproduce test runs.
This commit is contained in:
parent
5db7715b27
commit
1f3e38d305
|
@ -216,6 +216,7 @@
|
||||||
(define tr-eval (mk-eval 'typed/racket))
|
(define tr-eval (mk-eval 'typed/racket))
|
||||||
|
|
||||||
(define (check-all-reals sexp)
|
(define (check-all-reals sexp)
|
||||||
|
(when verbose? (displayln sexp))
|
||||||
(or (with-handlers
|
(or (with-handlers
|
||||||
;; something went wrong, almost certainly typechecking failed
|
;; something went wrong, almost certainly typechecking failed
|
||||||
;; in which case we ignore the expression
|
;; in which case we ignore the expression
|
||||||
|
@ -248,9 +249,16 @@
|
||||||
(equal? racket-result tr-result))))))))
|
(equal? racket-result tr-result))))))))
|
||||||
|
|
||||||
(define n-attempts 1000)
|
(define n-attempts 1000)
|
||||||
|
(define seed (+ 1 (random (expt 2 30))))
|
||||||
|
(define verbose? #f)
|
||||||
(command-line
|
(command-line
|
||||||
#:once-each
|
#:once-each
|
||||||
[("-n") n "Number of attempts" (set! n-attempts (string->number n))])
|
[("-n") n "Number of attempts" (set! n-attempts (string->number n))]
|
||||||
|
[("-s") s "RNG seed" (set! seed (string->number s))]
|
||||||
|
[("-v") "Print test cases" (set! verbose? #t)])
|
||||||
|
|
||||||
|
(random-seed seed)
|
||||||
|
(printf "seed: ~s~n" seed)
|
||||||
|
|
||||||
(call-with-limits
|
(call-with-limits
|
||||||
#f 1000
|
#f 1000
|
||||||
|
@ -259,4 +267,4 @@
|
||||||
#:attempts n-attempts
|
#:attempts n-attempts
|
||||||
#:prepare exp->real-exp)))
|
#:prepare exp->real-exp)))
|
||||||
|
|
||||||
;(printf "bad tests (usually typechecking failed): ~v~n" num-exceptions)
|
(printf "bad tests (usually typechecking failed): ~v~n" num-exceptions)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user