raco test: fix process command-line handling and adjust timeout handling

This commit is contained in:
Matthew Flatt 2013-12-29 09:38:01 -06:00
parent 81a03d59de
commit bbb0c5f6e9
2 changed files with 9 additions and 5 deletions

View File

@ -43,7 +43,8 @@
(define test-module (read (open-input-string (vector-ref argv 1))))
(define d (read (open-input-string (vector-ref argv 2))))
(dynamic-require test-module d)
(parameterize ([current-command-line-arguments '#()])
(dynamic-require test-module d))
(call-with-output-file*
result-file
@ -235,7 +236,8 @@
(lambda (what get-default) (get-default))))
(dynamic-require-elsewhere
p d
#:timeout (or (lookup 'timeout
#:timeout (if default-timeout
(lookup 'timeout
(lambda () default-timeout))
+inf.0)))
@ -653,7 +655,7 @@
(set-jobs! (string->number* "jobs" n exact-positive-integer?))]
[("--timeout") seconds
"Set default timeout to <seconds>"
(set-jobs! (string->number* "timeout" seconds real?))]
(set! default-timeout (string->number* "timeout" seconds real?))]
[("--quiet-program" "-Q")
"Quiet the program"
(set! quiet-program? #t)]

View File

@ -79,7 +79,8 @@ The @exec{raco test} command accepts several flags:
@item{@DFlag{timeout} @nonterm{seconds}
--- Sets the default timeout (after which a test counts as failed)
to @nonterm{seconds}.}
to @nonterm{seconds}. Use @exec{+inf.0} to allow tests to run without
limit but allow @racket[timeout] sub-submodule configuration.}
@item{@Flag{Q} or @DFlag{quiet-program}
--- suppresses output from each test program.}
@ -107,7 +108,8 @@ identifiers:
@itemlist[
@item{@racket[timeout] --- override the default timeout for the test}
@item{@racket[timeout] --- override the default timeout for the test,
when timeouts are enabled.}
]