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

This commit is contained in:
Vincent St-Amour 2013-05-13 11:17:36 -04:00
parent 5de08f06b4
commit a857256c77

View File

@ -207,11 +207,15 @@
[else [else
E])) E]))
(define max-mem 1000)
(define num-exceptions 0) (define num-exceptions 0)
(define (mk-eval lang) (define (mk-eval lang)
(call-with-trusted-sandbox-configuration (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 racket-eval (mk-eval 'racket))
(define tr-eval (mk-eval 'typed/racket)) (define tr-eval (mk-eval 'typed/racket))
@ -262,7 +266,7 @@
(flush-output) ; DrDr doesn't print the above if the testing segfaults. (flush-output) ; DrDr doesn't print the above if the testing segfaults.
(call-with-limits (call-with-limits
#f 1000 #f max-mem
(lambda () (lambda ()
(redex-check tr-arith E (check-all-reals (term E)) (redex-check tr-arith E (check-all-reals (term E))
#:attempts n-attempts #:attempts n-attempts