diff mbox series

[3/5] tests: Exit on first test failure

Message ID 20181108041311.182694-4-amitay@ozlabs.org
State Superseded
Headers show
Series Test framework improvements | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master

Commit Message

Amitay Isaacs Nov. 8, 2018, 4:13 a.m. UTC
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 tests/driver.sh | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/tests/driver.sh b/tests/driver.sh
index 9e92135..f1f7612 100644
--- a/tests/driver.sh
+++ b/tests/driver.sh
@@ -90,6 +90,7 @@  test_name=${TEST_NAME:-$0}
 test_logfile=${TEST_LOG:-}
 test_trsfile=${TEST_TRS:-}
 test_color=${TEST_COLOR:-yes}
+test_exit_failure=${TEST_EXIT_FAILURE:-yes}
 
 red= grn= lgn= blu= mgn= std=
 if [ $test_color = yes ] ; then
@@ -216,6 +217,10 @@  test_output ()
 	elif [ $res = "XPASS" -o $res = "FAIL" ] ; then
 		count_failed=$(( count_failed + 1 ))
 	fi
+
+	if [ $count_failed -gt 0 -a "$test_exit_failure" = "yes" ] ; then
+		exit 99
+	fi
 }
 
 test_wrapper_default ()