raco test: run ".scrbl" files by default; check cmdline args for all files
To test a file that ends in".ss", ".scm", etc., add a
`test-command-line-arguments` entry to an "info.rkt" file.
original commit: e44b15c032
This commit is contained in:
parent
74702c1f94
commit
51e419cfc2
|
@ -17,6 +17,10 @@
|
|||
setup/collects
|
||||
setup/getinfo)
|
||||
|
||||
(define rx:default-suffixes #rx#"\\.(?:rkt|scrbl)$")
|
||||
;; For any other file suffix, a `test-command-line-arguments`
|
||||
;; entry is required in "info.rkt".
|
||||
|
||||
(define submodules '()) ; '() means "default"
|
||||
(define first-avail? #f)
|
||||
(define run-anyways? #t)
|
||||
|
@ -384,7 +388,8 @@
|
|||
m))
|
||||
(apply string-append
|
||||
(for/list ([a (in-list args)])
|
||||
(format " ~s" (format "~a" a))))))
|
||||
(format " ~s" (format "~a" a)))))
|
||||
(flush-output))
|
||||
id)))
|
||||
(begin0
|
||||
(dynamic-require* mod 0 args try-config?)
|
||||
|
@ -419,7 +424,8 @@
|
|||
#:sema continue-sema)))]
|
||||
[(and (file-exists? p)
|
||||
(or (not check-suffix?)
|
||||
(regexp-match #rx#"\\.rkt$" (path->bytes p)))
|
||||
(regexp-match rx:default-suffixes p)
|
||||
(get-cmdline p #f))
|
||||
(not (omit-path? p)))
|
||||
(define args (get-cmdline p))
|
||||
(parameterize ([current-directory (let-values ([(base name dir?) (split-path p)])
|
||||
|
@ -616,9 +622,9 @@
|
|||
(and (path? base)
|
||||
(omit-path? base))))))
|
||||
|
||||
(define (get-cmdline p)
|
||||
(define (get-cmdline p [default null])
|
||||
(let ([p (normalize-info-path p)])
|
||||
(hash-ref command-line-arguments p null)))
|
||||
(hash-ref command-line-arguments p default)))
|
||||
|
||||
;; --------------------------------------------------
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user