raco test: add ++ignore-stderr <pattern>
option
I'm using this option to ignore "Xlib: extension \"RANDR\" missing" warnings.
This commit is contained in:
parent
165f21a192
commit
a011f9b816
|
@ -31,6 +31,7 @@
|
|||
(define table? #f)
|
||||
(define fresh-user? #f)
|
||||
(define empty-input? #f)
|
||||
(define ignore-stderr-patterns null)
|
||||
|
||||
(define jobs 0) ; 0 mean "default"
|
||||
(define task-sema (make-semaphore 1))
|
||||
|
@ -254,7 +255,10 @@
|
|||
|
||||
;; Check results:
|
||||
(when check-stderr?
|
||||
(unless (equal? #"" (get-output-bytes e))
|
||||
(unless (let ([s (get-output-bytes e)])
|
||||
(or (equal? #"" s)
|
||||
(ormap (lambda (p) (regexp-match? p s))
|
||||
ignore-stderr-patterns)))
|
||||
(error 'test "non-empty stderr: ~e" (get-output-bytes e))))
|
||||
(unless (zero? result-code)
|
||||
(error 'test "non-zero exit: ~e" result-code))
|
||||
|
@ -913,15 +917,21 @@
|
|||
[("--fresh-user")
|
||||
"Fresh PLTUSERHOME, etc., for each test"
|
||||
(set! fresh-user? #t)]
|
||||
[("--empty-stdin")
|
||||
"Call program with an empty stdin"
|
||||
(set! empty-input? #t)]
|
||||
[("--quiet-program" "-Q")
|
||||
"Quiet the program"
|
||||
(set! quiet-program? #t)]
|
||||
[("--check-stderr" "-e")
|
||||
"Treat stderr output as a test failure"
|
||||
(set! check-stderr? #t)]
|
||||
[("--empty-stdin")
|
||||
"Call program with an empty stdin"
|
||||
(set! empty-input? #t)]
|
||||
#:multi
|
||||
[("++ignore-stderr") pattern
|
||||
"Ignore standard error output if it matches #px\"<pattern>\""
|
||||
(set! ignore-stderr-patterns
|
||||
(cons (pregexp pattern) ignore-stderr-patterns))]
|
||||
#:once-each
|
||||
[("--quiet" "-q")
|
||||
"Suppress `raco test: ...' message"
|
||||
(set! quiet? #t)]
|
||||
|
|
|
@ -113,14 +113,20 @@ The @exec{raco test} command accepts several flags:
|
|||
the add-on directory (which is where packages are installed, for
|
||||
example), does @emph{not} change for each test process.}
|
||||
|
||||
@item{@DFlag{empty-stdin}
|
||||
--- provide an empty stdin to each test program.}
|
||||
|
||||
@item{@Flag{Q} or @DFlag{quiet-program}
|
||||
--- suppresses output from each test program.}
|
||||
|
||||
@item{@Flag{e} or @DFlag{check-stderr}
|
||||
--- count any stderr output as a test failure.}
|
||||
|
||||
@item{@DFlag{empty-stdin}
|
||||
--- provide an empty stdin to each test program.}
|
||||
@item{@DPFlag{ignore-stderr} @nonterm{pattern}
|
||||
--- don't count stderr output as a test failure if it matches
|
||||
@nonterm{pattern}. This flag can be used multiple times, and
|
||||
stderr output is treated as success as long as it matches any
|
||||
one @nonterm{pattern}.}
|
||||
|
||||
@item{@Flag{q} or @DFlag{quiet}
|
||||
--- suppresses output of progress information, responsible
|
||||
|
|
Loading…
Reference in New Issue
Block a user