diff --git a/collects/meta/props b/collects/meta/props index e43d8c37f0..f555cd0af0 100755 --- a/collects/meta/props +++ b/collects/meta/props @@ -1200,7 +1200,7 @@ path/s is either such a string or a list of them. "collects/redex/examples/combinators.rkt" drdr:command-line (mzc *) "collects/redex/examples/compatible-closure.rkt" drdr:command-line (mzc *) "collects/redex/examples/delim-cont/randomized-tests-test.rkt" drdr:timeout 240 drdr:random #t -"collects/redex/examples/delim-cont/randomized-tests.rkt" drdr:random #t +"collects/redex/examples/delim-cont/randomized-tests.rkt" drdr:command-line (racket "-tm" * "--" "--rules" "3000") drdr:timeout 180 drdr:random #t "collects/redex/examples/delim-cont/test.rkt" drdr:command-line (mzc *) "collects/redex/examples/letrec.rkt" drdr:command-line (mzc *) "collects/redex/examples/omega.rkt" drdr:command-line (mzc *) diff --git a/collects/redex/examples/delim-cont/randomized-tests.rkt b/collects/redex/examples/delim-cont/randomized-tests.rkt index 1e7235a02b..e750e0e02b 100644 --- a/collects/redex/examples/delim-cont/randomized-tests.rkt +++ b/collects/redex/examples/delim-cont/randomized-tests.rkt @@ -8,17 +8,35 @@ (provide (all-defined-out)) -(define (main [seed-arg #f]) - (define seed - (if seed-arg - (string->number seed-arg) - (add1 (random (sub1 (expt 2 31)))))) +(define (main . args) + (define from-grammar-tests #f) + (define from-rules-tests #f) + (define seed (add1 (random (sub1 (expt 2 31))))) + + (command-line + #:argv args + #:once-each + ["--grammar" + n + "Perform n tests generated from the grammar for programs" + (set! from-grammar-tests (string->number n))] + ["--rules" + n + "Perform n tests generated from the reduction relation" + (set! from-rules-tests (string->number n))] + ["--seed" + n + "Generate tests using the PRG seed n" + (set! seed (string->number n))]) + (printf "Test seed: ~s\n" seed) (parameterize ([current-pseudo-random-generator test-prg]) (random-seed seed)) (parameterize ([redex-pseudo-random-generator test-prg]) - (time (test #:attempts 3000)) - (time (test #:source :-> #:attempts 3000)))) + (when from-grammar-tests + (time (test #:attempts from-grammar-tests))) + (when from-rules-tests + (time (test #:source :-> #:attempts from-rules-tests))))) (define-syntax-rule (test . kw-args) (redex-check grammar p (same-behavior? (term p))