From 2b7c6e32a9c529ddcdeac58cbb4f652f9f76e164 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 4 Feb 2013 20:37:40 -0600 Subject: [PATCH] adjust raco test so it test the command-line arguments to the empty vector before running anything --- collects/compiler/commands/test.rkt | 43 +++++++++++++++-------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/collects/compiler/commands/test.rkt b/collects/compiler/commands/test.rkt index db7ea32d9c..f4bf5bd9a5 100644 --- a/collects/compiler/commands/test.rkt +++ b/collects/compiler/commands/test.rkt @@ -23,27 +23,28 @@ [(and (file-exists? p) (or (not check-suffix?) (regexp-match #rx#"\\.rkt$" (path->bytes p)))) - (define something-wasnt-declared? #f) - (for ([submodule (in-list (if (null? submodules) - '(test) - (reverse submodules)))]) - (define mod `(submod ,p ,submodule)) - (cond - [(module-declared? mod #t) - (unless quiet? - (printf "running ~s:\n" `(submod ,(if (absolute-path? p) - `(file ,(path->string p)) - (path->string p)) - ,submodule))) - (dynamic-require mod #f)] - [else - (set! something-wasnt-declared? #t)])) - (when (and run-anyways? something-wasnt-declared?) - (unless quiet? - (printf "running ~s:\n" (if (absolute-path? p) - `(file ,(path->string p)) - (path->string p)))) - (dynamic-require p #f))] + (parameterize ([current-command-line-arguments '#()]) + (define something-wasnt-declared? #f) + (for ([submodule (in-list (if (null? submodules) + '(test) + (reverse submodules)))]) + (define mod `(submod ,p ,submodule)) + (cond + [(module-declared? mod #t) + (unless quiet? + (printf "running ~s:\n" `(submod ,(if (absolute-path? p) + `(file ,(path->string p)) + (path->string p)) + ,submodule))) + (dynamic-require mod #f)] + [else + (set! something-wasnt-declared? #t)])) + (when (and run-anyways? something-wasnt-declared?) + (unless quiet? + (printf "running ~s:\n" (if (absolute-path? p) + `(file ,(path->string p)) + (path->string p)))) + (dynamic-require p #f)))] [(not (file-exists? p)) (error 'test "given path ~e does not exist" p)])]))