From 0908c44d684c1af7f7892ccde584d98eae3c22ef Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Fri, 13 Jun 2014 22:22:19 -0400 Subject: [PATCH] Make test.sh return an error code on failure. --- test.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test.sh b/test.sh index 9ca252e..3194c72 100755 --- a/test.sh +++ b/test.sh @@ -16,4 +16,9 @@ if [ $? != 0 ]; then exit 1 fi -phantomjs phantom-driver.js $* +phantomjs phantom-driver.js $* | tee /tmp/test-results.txt +trap "rm -f /tmp/test-results.txt" EXIT +if grep -q 'FAIL' /tmp/test-results.txt; then + echo One or more tests failed. + exit 1 +fi -- 2.7.4