From fd2f8bb33da89b9f391f8c16f158a24ae392faee Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Fri, 14 Mar 2014 22:15:19 -0700 Subject: [PATCH] Make TR test infrastructure support being run from different directories. original commit: cdb77cd4f030677b0dd400ca5febdf087a378a6a --- .../typed-racket-test/tests/typed-racket/main.rkt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/main.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/main.rkt index a369f420..fb5212c3 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/main.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/main.rkt @@ -117,19 +117,21 @@ (define-values (path p b) (split-path p*)) (define f (let ([dir (path->string path)]) - (cond [(equal? dir "fail/") + (cond [(regexp-match? #rx"fail/$" dir ) (lambda (p thnk) (define-values (pred info) (exn-pred p)) (parameterize ([error-display-handler void]) (with-check-info (['predicates info]) (check-exn pred thnk))))] - [(equal? dir "succeed/") + [(regexp-match? #rx"succeed/$" dir) (lambda (p thnk) (check-not-exn thnk))] - [(equal? dir "optimizer/tests/") + [(regexp-match? #rx"optimizer/tests/$" dir) (lambda (p* thnk) (test-opt p))] - [(equal? dir "optimizer/missed-optimizations/") - (lambda (p* thnk) (test-missed-optimization p))]))) + [(regexp-match? #rx"optimizer/missed-optimizations/$" dir) + (lambda (p* thnk) (test-missed-optimization p))] + [else + (error 'just-one "Unknown test kind for test: ~a" p*)]))) (test-suite (path->string p) (f