Add test-include-paths and allow test-omit-paths to use regexps
This commit is contained in:
parent
b3887f37d3
commit
efbd424ec0
|
@ -558,9 +558,10 @@
|
|||
#:sema continue-sema)))]
|
||||
[(and (or (not check-suffix?)
|
||||
(regexp-match rx:default-suffixes p)
|
||||
(get-cmdline p #f #:check-info? #t))
|
||||
(get-cmdline p #f #:check-info? #t)
|
||||
(include-path? p #:check-info? #t))
|
||||
(or (not check-suffix?)
|
||||
(not (omit-path? p #:check-info? #t))))
|
||||
(not (omit-path? p #:check-info? #t))))
|
||||
(unless check-suffix?
|
||||
;; make sure "info.rkt" information is loaded:
|
||||
(check-info p))
|
||||
|
@ -740,6 +741,7 @@
|
|||
;; Reading "info.rkt" files
|
||||
|
||||
(define omit-paths (make-hash))
|
||||
(define include-paths (make-hash))
|
||||
(define command-line-arguments (make-hash))
|
||||
(define timeouts (make-hash))
|
||||
(define lock-names (make-hash))
|
||||
|
@ -773,14 +775,22 @@
|
|||
(hash-set! table dir #t)]
|
||||
[(list? v)
|
||||
(for ([i (in-list v)])
|
||||
(unless (path-string? i) (bad what v))
|
||||
(define p (normalize-info-path (path->complete-path i dir)))
|
||||
(define dp (if (directory-exists? p)
|
||||
(path->directory-path p)
|
||||
p))
|
||||
(hash-set! table dp #t))]
|
||||
(cond
|
||||
[(path-string? i)
|
||||
(define p (normalize-info-path (path->complete-path i dir)))
|
||||
(define dp (if (directory-exists? p)
|
||||
(path->directory-path p)
|
||||
p))
|
||||
(hash-set! table dp #t)]
|
||||
[(regexp? i)
|
||||
(for ([f (in-directory dir)]
|
||||
#:when (regexp-match i (path->string f)))
|
||||
(hash-set! table f #t))]
|
||||
[else
|
||||
(bad what v)]))]
|
||||
[else (bad what v)]))
|
||||
(get-members omit-paths 'test-omit-paths #t)
|
||||
(get-members include-paths 'test-include-paths #t)
|
||||
(get-members randoms 'test-randoms #t)
|
||||
|
||||
(define (get-keyed table what check? #:ok-all? [ok-all? #f])
|
||||
|
@ -845,13 +855,18 @@
|
|||
(define (normalize-info-path p)
|
||||
(simplify-path (path->complete-path p) #f))
|
||||
|
||||
(define (omit-path? p #:check-info? [check-info? #f])
|
||||
(when check-info? (check-info p))
|
||||
(let ([p (normalize-info-path p)])
|
||||
(or (hash-ref omit-paths p #f)
|
||||
(let-values ([(base name dir?) (split-path p)])
|
||||
(and (path? base)
|
||||
(omit-path? base))))))
|
||||
(define (make-omit-path? omit-paths)
|
||||
(define (omit-path? p #:check-info? [check-info? #f])
|
||||
(when check-info? (check-info p))
|
||||
(let ([p (normalize-info-path p)])
|
||||
(or (hash-ref omit-paths p #f)
|
||||
(let-values ([(base name dir?) (split-path p)])
|
||||
(and (path? base)
|
||||
(omit-path? base))))))
|
||||
omit-path?)
|
||||
|
||||
(define omit-path? (make-omit-path? omit-paths))
|
||||
(define include-path? (make-omit-path? include-paths))
|
||||
|
||||
(define (get-cmdline p [default null] #:check-info? [check-info? #f])
|
||||
(when check-info? (check-info p))
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
#lang racket/base
|
||||
(error 'bad)
|
||||
(module+ test
|
||||
(error 'bad))
|
|
@ -0,0 +1,4 @@
|
|||
#lang racket/base
|
||||
(error 'bad)
|
||||
(module+ test
|
||||
(error 'bad))
|
|
@ -0,0 +1,5 @@
|
|||
#lang racket/base
|
||||
(define (f x) x)
|
||||
(module+ test
|
||||
(require rackunit)
|
||||
(check-equal? (f 1) 1))
|
|
@ -0,0 +1,5 @@
|
|||
#lang racket/base
|
||||
(define (f x) x)
|
||||
(module+ test
|
||||
(require rackunit)
|
||||
(check-equal? (f 1) 1))
|
3
compiler-test/tests/compiler/test/extensions/info.rkt
Normal file
3
compiler-test/tests/compiler/test/extensions/info.rkt
Normal file
|
@ -0,0 +1,3 @@
|
|||
#lang info
|
||||
(define test-omit-paths '(#rx".*omit.*"))
|
||||
(define test-include-paths '(#rx".*include.*"))
|
Loading…
Reference in New Issue
Block a user