raco test: add ++ignore-stderr <pattern>
option
I'm using this option to ignore "Xlib: extension \"RANDR\" missing"
warnings.
original commit: a011f9b816
This commit is contained in:
parent
9f37438fe0
commit
7380ec5e0e
|
@ -31,6 +31,7 @@
|
||||||
(define table? #f)
|
(define table? #f)
|
||||||
(define fresh-user? #f)
|
(define fresh-user? #f)
|
||||||
(define empty-input? #f)
|
(define empty-input? #f)
|
||||||
|
(define ignore-stderr-patterns null)
|
||||||
|
|
||||||
(define jobs 0) ; 0 mean "default"
|
(define jobs 0) ; 0 mean "default"
|
||||||
(define task-sema (make-semaphore 1))
|
(define task-sema (make-semaphore 1))
|
||||||
|
@ -254,7 +255,10 @@
|
||||||
|
|
||||||
;; Check results:
|
;; Check results:
|
||||||
(when check-stderr?
|
(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))))
|
(error 'test "non-empty stderr: ~e" (get-output-bytes e))))
|
||||||
(unless (zero? result-code)
|
(unless (zero? result-code)
|
||||||
(error 'test "non-zero exit: ~e" result-code))
|
(error 'test "non-zero exit: ~e" result-code))
|
||||||
|
@ -913,15 +917,21 @@
|
||||||
[("--fresh-user")
|
[("--fresh-user")
|
||||||
"Fresh PLTUSERHOME, etc., for each test"
|
"Fresh PLTUSERHOME, etc., for each test"
|
||||||
(set! fresh-user? #t)]
|
(set! fresh-user? #t)]
|
||||||
|
[("--empty-stdin")
|
||||||
|
"Call program with an empty stdin"
|
||||||
|
(set! empty-input? #t)]
|
||||||
[("--quiet-program" "-Q")
|
[("--quiet-program" "-Q")
|
||||||
"Quiet the program"
|
"Quiet the program"
|
||||||
(set! quiet-program? #t)]
|
(set! quiet-program? #t)]
|
||||||
[("--check-stderr" "-e")
|
[("--check-stderr" "-e")
|
||||||
"Treat stderr output as a test failure"
|
"Treat stderr output as a test failure"
|
||||||
(set! check-stderr? #t)]
|
(set! check-stderr? #t)]
|
||||||
[("--empty-stdin")
|
#:multi
|
||||||
"Call program with an empty stdin"
|
[("++ignore-stderr") pattern
|
||||||
(set! empty-input? #t)]
|
"Ignore standard error output if it matches #px\"<pattern>\""
|
||||||
|
(set! ignore-stderr-patterns
|
||||||
|
(cons (pregexp pattern) ignore-stderr-patterns))]
|
||||||
|
#:once-each
|
||||||
[("--quiet" "-q")
|
[("--quiet" "-q")
|
||||||
"Suppress `raco test: ...' message"
|
"Suppress `raco test: ...' message"
|
||||||
(set! quiet? #t)]
|
(set! quiet? #t)]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user