Add test-include-paths and allow test-omit-paths to use regexps
This commit is contained in:
parent
b3887f37d3
commit
efbd424ec0
|
@ -558,7 +558,8 @@
|
||||||
#:sema continue-sema)))]
|
#:sema continue-sema)))]
|
||||||
[(and (or (not check-suffix?)
|
[(and (or (not check-suffix?)
|
||||||
(regexp-match rx:default-suffixes p)
|
(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?)
|
(or (not check-suffix?)
|
||||||
(not (omit-path? p #:check-info? #t))))
|
(not (omit-path? p #:check-info? #t))))
|
||||||
(unless check-suffix?
|
(unless check-suffix?
|
||||||
|
@ -740,6 +741,7 @@
|
||||||
;; Reading "info.rkt" files
|
;; Reading "info.rkt" files
|
||||||
|
|
||||||
(define omit-paths (make-hash))
|
(define omit-paths (make-hash))
|
||||||
|
(define include-paths (make-hash))
|
||||||
(define command-line-arguments (make-hash))
|
(define command-line-arguments (make-hash))
|
||||||
(define timeouts (make-hash))
|
(define timeouts (make-hash))
|
||||||
(define lock-names (make-hash))
|
(define lock-names (make-hash))
|
||||||
|
@ -773,14 +775,22 @@
|
||||||
(hash-set! table dir #t)]
|
(hash-set! table dir #t)]
|
||||||
[(list? v)
|
[(list? v)
|
||||||
(for ([i (in-list v)])
|
(for ([i (in-list v)])
|
||||||
(unless (path-string? i) (bad what v))
|
(cond
|
||||||
|
[(path-string? i)
|
||||||
(define p (normalize-info-path (path->complete-path i dir)))
|
(define p (normalize-info-path (path->complete-path i dir)))
|
||||||
(define dp (if (directory-exists? p)
|
(define dp (if (directory-exists? p)
|
||||||
(path->directory-path p)
|
(path->directory-path p)
|
||||||
p))
|
p))
|
||||||
(hash-set! table dp #t))]
|
(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)]))
|
[else (bad what v)]))
|
||||||
(get-members omit-paths 'test-omit-paths #t)
|
(get-members omit-paths 'test-omit-paths #t)
|
||||||
|
(get-members include-paths 'test-include-paths #t)
|
||||||
(get-members randoms 'test-randoms #t)
|
(get-members randoms 'test-randoms #t)
|
||||||
|
|
||||||
(define (get-keyed table what check? #:ok-all? [ok-all? #f])
|
(define (get-keyed table what check? #:ok-all? [ok-all? #f])
|
||||||
|
@ -845,13 +855,18 @@
|
||||||
(define (normalize-info-path p)
|
(define (normalize-info-path p)
|
||||||
(simplify-path (path->complete-path p) #f))
|
(simplify-path (path->complete-path p) #f))
|
||||||
|
|
||||||
(define (omit-path? p #:check-info? [check-info? #f])
|
(define (make-omit-path? omit-paths)
|
||||||
|
(define (omit-path? p #:check-info? [check-info? #f])
|
||||||
(when check-info? (check-info p))
|
(when check-info? (check-info p))
|
||||||
(let ([p (normalize-info-path p)])
|
(let ([p (normalize-info-path p)])
|
||||||
(or (hash-ref omit-paths p #f)
|
(or (hash-ref omit-paths p #f)
|
||||||
(let-values ([(base name dir?) (split-path p)])
|
(let-values ([(base name dir?) (split-path p)])
|
||||||
(and (path? base)
|
(and (path? base)
|
||||||
(omit-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])
|
(define (get-cmdline p [default null] #:check-info? [check-info? #f])
|
||||||
(when check-info? (check-info p))
|
(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