Cleanup of the test harness.

original commit: 1c9e8e05b061648ee7a54bf120c288eefddbfb15
This commit is contained in:
Vincent St-Amour 2010-08-27 12:26:23 -04:00
parent 989cd5ce81
commit 6df18f3f24

View File

@ -6,8 +6,7 @@
(define (evaluator file #:optimize [optimize? #f])
(call-with-trusted-sandbox-configuration
(lambda ()
(parameterize ([current-load-relative-directory
(build-path here "tests")]
(parameterize ([current-load-relative-directory tests-dir]
[sandbox-memory-limit #f] ; TR needs memory
[sandbox-output 'string]
[sandbox-namespace-specs
@ -28,7 +27,7 @@
out)))))
(define (generate-opt-log name)
(parameterize ([current-load-relative-directory (build-path here "tests")]
(parameterize ([current-load-relative-directory tests-dir]
[current-command-line-arguments '#("--log-optimizations")])
(with-output-to-string
(lambda ()
@ -56,7 +55,7 @@
(begin (printf "~a failed: result mismatch\n\n" name)
#f))))))
(define-runtime-path here ".")
(define-runtime-path tests-dir "./tests")
(let ((n-failures
(if (> (vector-length (current-command-line-arguments)) 0)
@ -64,7 +63,7 @@
(vector-ref (current-command-line-arguments) 0)))
0 1)
(for/fold ((n-failures 0))
((gen (in-directory (build-path here "tests"))))
((gen (in-directory tests-dir)))
(+ n-failures (if (test gen) 0 1))))))
(unless (= n-failures 0)
(error (format "~a tests failed." n-failures))))