From 9b632b769d9f9fce08b6a17493ade3cc5417669a Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Mon, 21 Aug 2017 10:18:10 +0100 Subject: [PATCH] [functional-tests] return 1 as an exit code if there are failures. --- functional-tests/functional-tests.scm | 4 +++- functional-tests/run-functional-tests.scm | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/functional-tests/functional-tests.scm b/functional-tests/functional-tests.scm index 5e04c2e..8b15509 100644 --- a/functional-tests/functional-tests.scm +++ b/functional-tests/functional-tests.scm @@ -222,6 +222,7 @@ (thunk) #t))))) + ;; Returns #t if all tests pass. (define (run-scenarios ss) (let ((pass 0) (fail 0) @@ -250,7 +251,8 @@ (cat (dsp ", ") (num fail) (dsp " failures."))) - nl)))) + nl)) + (zero? fail))) ;;----------------------------------------------- diff --git a/functional-tests/run-functional-tests.scm b/functional-tests/run-functional-tests.scm index 0306034..016e065 100644 --- a/functional-tests/run-functional-tests.scm +++ b/functional-tests/run-functional-tests.scm @@ -5,5 +5,8 @@ (register-thin-tests) (register-cache-tests) -(run-scenarios (list-scenarios)) + +(if (run-scenarios (list-scenarios)) + (exit) + (exit #f))