From 56e0833389c4eb3a492ba74003dd46d6852a7fb5 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 10 Oct 2016 12:28:13 +0200 Subject: [PATCH] support for expect_failure on localtests --- localtests/test.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/localtests/test.sh b/localtests/test.sh index f12b66f..fc0c9b6 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -95,7 +95,18 @@ test_single() { echo_dot bash $exec_command_file 1> $test_logfile 2>&1 - if [ $? -ne 0 ] ; then + execution_result=$? + + if [ -f $tests_path/$test_name/expect_failure ] ; then + if [ $execution_result -eq 0 ] ; then + echo + echo "ERROR $test_name execution was expected to exit on error but did not. cat $test_logfile" + return 1 + fi + return 0 + fi + + if [ $execution_result -ne 0 ] ; then echo echo "ERROR $test_name execution failure. cat $test_logfile" return 1