Make TR test infrastructure support being run from different directories.

This commit is contained in:
Eric Dobson 2014-03-14 22:15:19 -07:00
parent 04fc5498c8
commit cdb77cd4f0

View File

@ -117,19 +117,21 @@
(define-values (path p b) (split-path p*)) (define-values (path p b) (split-path p*))
(define f (define f
(let ([dir (path->string path)]) (let ([dir (path->string path)])
(cond [(equal? dir "fail/") (cond [(regexp-match? #rx"fail/$" dir )
(lambda (p thnk) (lambda (p thnk)
(define-values (pred info) (exn-pred p)) (define-values (pred info) (exn-pred p))
(parameterize ([error-display-handler void]) (parameterize ([error-display-handler void])
(with-check-info (with-check-info
(['predicates info]) (['predicates info])
(check-exn pred thnk))))] (check-exn pred thnk))))]
[(equal? dir "succeed/") [(regexp-match? #rx"succeed/$" dir)
(lambda (p thnk) (check-not-exn thnk))] (lambda (p thnk) (check-not-exn thnk))]
[(equal? dir "optimizer/tests/") [(regexp-match? #rx"optimizer/tests/$" dir)
(lambda (p* thnk) (test-opt p))] (lambda (p* thnk) (test-opt p))]
[(equal? dir "optimizer/missed-optimizations/") [(regexp-match? #rx"optimizer/missed-optimizations/$" dir)
(lambda (p* thnk) (test-missed-optimization p))]))) (lambda (p* thnk) (test-missed-optimization p))]
[else
(error 'just-one "Unknown test kind for test: ~a" p*)])))
(test-suite (test-suite
(path->string p) (path->string p)
(f (f