raco test: refine override-"info.rkt" behavior of specifying a file
In consultation with Jay, unify the ignore-file's-extension and
ignore-"info.rkt"-disabling treatment of `raco test` arguments.
The change is that the latter applies only when an argument is a
file, and not when it's a directory.
original commit: 1715a50c80
This commit is contained in:
parent
9e0e4327f1
commit
eba91e16bd
|
@ -533,11 +533,12 @@
|
||||||
[(and (file-exists? p)
|
[(and (file-exists? p)
|
||||||
(or (not check-suffix?)
|
(or (not check-suffix?)
|
||||||
(regexp-match rx:default-suffixes p)
|
(regexp-match rx:default-suffixes p)
|
||||||
(get-cmdline p #f))
|
(get-cmdline p #f #:check-info? #t))
|
||||||
(or explicit-arguments?
|
(or (not check-suffix?)
|
||||||
(begin (check-info p)
|
(not (omit-path? p #:check-info? #t))))
|
||||||
(not (omit-path? p)))))
|
(unless check-suffix?
|
||||||
;; The above `omit-path?` loads "info.rkt" files
|
;; make sure "info.rkt" information is loaded:
|
||||||
|
(check-info p))
|
||||||
(define norm-p (normalize-info-path p))
|
(define norm-p (normalize-info-path p))
|
||||||
(define args (get-cmdline norm-p))
|
(define args (get-cmdline norm-p))
|
||||||
(define timeout (get-timeout norm-p))
|
(define timeout (get-timeout norm-p))
|
||||||
|
@ -657,7 +658,6 @@
|
||||||
(require (submod "." paths))
|
(require (submod "." paths))
|
||||||
|
|
||||||
(define collections? #f)
|
(define collections? #f)
|
||||||
(define explicit-arguments? #f)
|
|
||||||
(define packages? #f)
|
(define packages? #f)
|
||||||
(define libraries? #f)
|
(define libraries? #f)
|
||||||
(define check-top-suffix? #f)
|
(define check-top-suffix? #f)
|
||||||
|
@ -806,21 +806,30 @@
|
||||||
(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)
|
(define (omit-path? p #:check-info? [check-info? #f])
|
||||||
|
(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))))))
|
||||||
|
|
||||||
(define (get-cmdline p [default null])
|
(define (get-cmdline p [default null] #:check-info? [check-info? #f])
|
||||||
(hash-ref command-line-arguments p default))
|
(when check-info? (check-info p))
|
||||||
|
(hash-ref command-line-arguments
|
||||||
|
(if check-info? (normalize-info-path p) p)
|
||||||
|
default))
|
||||||
|
|
||||||
(define (get-timeout p) (hash-ref timeouts p +inf.0))
|
(define (get-timeout p)
|
||||||
|
;; assumes `(check-info p)` has been called and `p` is normalized
|
||||||
|
(hash-ref timeouts p +inf.0))
|
||||||
|
|
||||||
(define (get-lock-name p) (hash-ref lock-names p #f))
|
(define (get-lock-name p)
|
||||||
|
;; assumes `(check-info p)` has been called and `p` is normalized
|
||||||
|
(hash-ref lock-names p #f))
|
||||||
|
|
||||||
(define (get-responsible p)
|
(define (get-responsible p)
|
||||||
|
;; assumes `(check-info p)` has been called and `p` is normalized
|
||||||
(or (let loop ([p p])
|
(or (let loop ([p p])
|
||||||
(or (hash-ref responsibles p #f)
|
(or (hash-ref responsibles p #f)
|
||||||
(let-values ([(base name dir?) (split-path p)])
|
(let-values ([(base name dir?) (split-path p)])
|
||||||
|
@ -840,7 +849,9 @@
|
||||||
(and (ok-responsible? v)
|
(and (ok-responsible? v)
|
||||||
v))))))))
|
v))))))))
|
||||||
|
|
||||||
(define (get-random p) (hash-ref randoms p #f))
|
(define (get-random p)
|
||||||
|
;; assumes `(check-info p)` has been called and `p` is normalized
|
||||||
|
(hash-ref randoms p #f))
|
||||||
|
|
||||||
(define (ok-responsible? v)
|
(define (ok-responsible? v)
|
||||||
(or (string? v)
|
(or (string? v)
|
||||||
|
@ -950,9 +961,7 @@
|
||||||
"Print a summary table"
|
"Print a summary table"
|
||||||
(set! table? #t)]
|
(set! table? #t)]
|
||||||
#:args file-or-directory
|
#:args file-or-directory
|
||||||
(begin (set! explicit-arguments?
|
(begin (unless (= 1 (length file-or-directory))
|
||||||
(not (or collections? libraries? packages? check-top-suffix?)))
|
|
||||||
(unless (= 1 (length file-or-directory))
|
|
||||||
(set! single-file? #f))
|
(set! single-file? #f))
|
||||||
(define sum
|
(define sum
|
||||||
;; The #:sema argument everywhre makes tests start
|
;; The #:sema argument everywhre makes tests start
|
||||||
|
|
Loading…
Reference in New Issue
Block a user