Limit memory in all sandboxes used by the TR random tester.

original commit: a857256c778e920301f4765f2cac6e79cf16b240
This commit is contained in:
Vincent St-Amour 2013-05-13 11:17:36 -04:00
parent 88ddace934
commit 02bc10ef98

View File

@ -207,11 +207,15 @@
[else
E]))
(define max-mem 1000)
(define num-exceptions 0)
(define (mk-eval lang)
(call-with-trusted-sandbox-configuration
(λ () (make-evaluator lang #:requires '(racket/flonum racket/unsafe/ops)))))
(λ ()
(parameterize ([sandbox-memory-limit max-mem])
(make-evaluator lang #:requires '(racket/flonum racket/unsafe/ops))))))
(define racket-eval (mk-eval 'racket))
(define tr-eval (mk-eval 'typed/racket))
@ -262,7 +266,7 @@
(flush-output) ; DrDr doesn't print the above if the testing segfaults.
(call-with-limits
#f 1000
#f max-mem
(lambda ()
(redex-check tr-arith E (check-all-reals (term E))
#:attempts n-attempts