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

Amitay Isaacs amitay at ozlabs.org
Wed Nov 14 16:14:09 AEDT 2018


Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
 tests/driver.sh | 5 +++++
 1 file changed, 5 insertions(+)

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 ()
-- 
2.19.1



More information about the Pdbg mailing list