|
2 | 2 |
|
3 | 3 | (require rackunit rackunit/text-ui racket/file |
4 | 4 | racket/port rackunit/log |
| 5 | + racket/set |
| 6 | + racket/path |
5 | 7 | racket/string |
6 | 8 | compiler/compiler setup/setup racket/promise |
7 | 9 | racket/match syntax/modcode |
|
46 | 48 |
|
47 | 49 | (define-runtime-path src-dir ".") |
48 | 50 |
|
49 | | -(define (mk-tests dir test #:error [error? #f] #:exclude [excl ""] ) |
| 51 | +(define (mk-tests dir test #:error [error? #f] #:exclude [excl (set)] ) |
50 | 52 | (lambda () |
51 | 53 | (define path (build-path src-dir dir)) |
52 | 54 | (define prms |
53 | 55 | (for/list ([i (in-naturals)] |
54 | 56 | [p (directory-list path)] |
55 | 57 | #:when (scheme-file? p) |
56 | | - #:unless (and (not (equal? excl "")) (string-contains? (path->string p) excl)) |
| 58 | + #:unless (let* ([f (path->string (file-name-from-path p))]) |
| 59 | + (and (not (set-empty? excl)) (set-member? excl f))) |
57 | 60 | ;; skip backup files |
58 | 61 | #:when (not (regexp-match #rx".*~" (path->string p)))) |
59 | 62 | (define p* (build-path path p)) |
|
87 | 90 |
|
88 | 91 |
|
89 | 92 |
|
90 | | -(define (int-tests [excl ""]) |
| 93 | +(define (int-tests [excl (set)]) |
91 | 94 | (define succ-tests (mk-tests "succeed" |
92 | 95 | (lambda (p thnk) |
93 | 96 | (check-not-exn thnk)) |
|
99 | 102 | (with-check-info |
100 | 103 | (['predicates info]) |
101 | 104 | (check-exn pred thnk)))) |
102 | | - #:error #t)) |
| 105 | + #:error #t |
| 106 | + #:exclude excl)) |
103 | 107 |
|
104 | 108 | (test-suite "Integration tests" |
105 | 109 | (succ-tests) |
|
188 | 192 | (define missed-opt? (make-parameter #f)) |
189 | 193 | (define bench? (make-parameter #f)) |
190 | 194 | (define math? (make-parameter #f)) |
191 | | - (define excl (make-parameter "")) |
| 195 | + (define excl (make-parameter (list))) |
192 | 196 | (define single (make-parameter #f)) |
193 | 197 | (current-namespace (make-base-namespace)) |
194 | 198 | (command-line |
|
203 | 207 | ["--just" path "run only this test" (single (just-one path))] |
204 | 208 | ["--nightly" "for the nightly builds" (begin (nightly? #t) (unit? #t) (opt? #t) (missed-opt? #t) (places 1))] |
205 | 209 | ["--all" "run all tests" (begin (unit? #t) (int? #t) (opt? #t) (missed-opt? #t) (bench? #t) (math? #t))] |
206 | | - ["--excl" test "exclude tests" (excl test)] |
207 | 210 | ["-j" num "number of places to use" |
208 | 211 | (let ([n (string->number num)]) |
209 | 212 | (places (and (integer? n) (> n 1) n)))] |
210 | 213 | ["--gui" "run using the gui" |
211 | 214 | (if (gui-available?) |
212 | 215 | (exec go) |
213 | | - (error "GUI not available"))]) |
| 216 | + (error "GUI not available"))] |
| 217 | + #:multi |
| 218 | + ["--excl" test "exclude tests" (excl (set-add (excl) test))]) |
214 | 219 |
|
215 | 220 | (start-workers) |
216 | 221 |
|
|
0 commit comments