From 02bc10ef98a59ca79121bf3f37294a4ca7e6ca0f Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Mon, 13 May 2013 11:17:36 -0400 Subject: [PATCH] Limit memory in all sandboxes used by the TR random tester. original commit: a857256c778e920301f4765f2cac6e79cf16b240 --- collects/tests/typed-racket/tr-random-testing.rkt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/collects/tests/typed-racket/tr-random-testing.rkt b/collects/tests/typed-racket/tr-random-testing.rkt index 5d2c5295..2f7a1e7d 100644 --- a/collects/tests/typed-racket/tr-random-testing.rkt +++ b/collects/tests/typed-racket/tr-random-testing.rkt @@ -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