[functional-tests] fix up some tests.

This commit is contained in:
Joe Thornber
2017-09-20 17:13:03 +01:00
parent 5814fea96a
commit 7079b1ec9e
3 changed files with 13 additions and 10 deletions

View File

@@ -49,16 +49,18 @@
(if (pred exit-code)
(values stdout stderr)
(begin
(info (fmt #f (dsp "stdout: ") stdout))
(info (fmt #f (dsp "stderr: ") stderr))
(fail (fmt #f (dsp "unexpected exit code (")
(num exit-code)
(dsp ")")))))))
(let ((msg (fmt #f "unexpected exit code (" exit-code ")")))
(info msg)
(fail msg))))))
(define (run-ok . cmd-and-args)
(run-with-exit-code zero? cmd-and-args))
;; Exit code 139 is a segfault, which is not acceptable
(define (run-fail . cmd-and-args)
(define (not-zero? x) (not (zero? x)))
(define (fails? x) (not
(or (= 139 x)
(zero? x))))
(run-with-exit-code fails? cmd-and-args)))
(run-with-exit-code not-zero? cmd-and-args)))