adjust raco test so it test the command-line

arguments to the empty vector before running anything
This commit is contained in:
Robby Findler 2013-02-04 20:37:40 -06:00
parent f749ab1538
commit 2b7c6e32a9

View File

@ -23,27 +23,28 @@
[(and (file-exists? p) [(and (file-exists? p)
(or (not check-suffix?) (or (not check-suffix?)
(regexp-match #rx#"\\.rkt$" (path->bytes p)))) (regexp-match #rx#"\\.rkt$" (path->bytes p))))
(define something-wasnt-declared? #f) (parameterize ([current-command-line-arguments '#()])
(for ([submodule (in-list (if (null? submodules) (define something-wasnt-declared? #f)
'(test) (for ([submodule (in-list (if (null? submodules)
(reverse submodules)))]) '(test)
(define mod `(submod ,p ,submodule)) (reverse submodules)))])
(cond (define mod `(submod ,p ,submodule))
[(module-declared? mod #t) (cond
(unless quiet? [(module-declared? mod #t)
(printf "running ~s:\n" `(submod ,(if (absolute-path? p) (unless quiet?
`(file ,(path->string p)) (printf "running ~s:\n" `(submod ,(if (absolute-path? p)
(path->string p)) `(file ,(path->string p))
,submodule))) (path->string p))
(dynamic-require mod #f)] ,submodule)))
[else (dynamic-require mod #f)]
(set! something-wasnt-declared? #t)])) [else
(when (and run-anyways? something-wasnt-declared?) (set! something-wasnt-declared? #t)]))
(unless quiet? (when (and run-anyways? something-wasnt-declared?)
(printf "running ~s:\n" (if (absolute-path? p) (unless quiet?
`(file ,(path->string p)) (printf "running ~s:\n" (if (absolute-path? p)
(path->string p)))) `(file ,(path->string p))
(dynamic-require p #f))] (path->string p))))
(dynamic-require p #f)))]
[(not (file-exists? p)) [(not (file-exists? p))
(error 'test "given path ~e does not exist" p)])])) (error 'test "given path ~e does not exist" p)])]))