Try to improve the tests wrt timeouts and memory limits

original commit: 226f86d201794a880e0ec49ab6cb03ec937c962e
This commit is contained in:
Eli Barzilay 2011-06-28 18:29:59 -04:00
parent 0e1979d80b
commit b8556478f5

View File

@ -40,7 +40,8 @@
. stuff))
(parameterize ([current-directory this-dir]
[sandbox-output o]
[sandbox-error-output current-output-port])
[sandbox-error-output current-output-port]
[sandbox-eval-limits '(2 10)])
(define exn #f)
(define thd #f)
(define (run)
@ -54,8 +55,7 @@
(call-with-output-file (car m) #:exists 'truncate
(lambda (o) (display (cdr m) o))))
(set! thd (thread run))
(t (with-limits 2 #f
(if len-to-read (read-string len-to-read i) (port->string i)))
(t (if len-to-read (read-string len-to-read i) (port->string i))
=> expected)
(t (begin (kill-thread thd) (cond [exn => raise] [else #t])))
(for ([m more])