From 733094a8510133a8ea72d52d5b8b3732b843b5fe Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Mon, 12 May 2014 22:56:57 +0200 Subject: tests: fix "KNOWN FAILED" for subtests It didn't worked for tests with subtests. Here we consolidate both cases which fixes the issue by the way. This is basically a rewrite of 7641ccec. Signed-off-by: Ruediger Meier --- tests/functions.sh | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'tests/functions.sh') diff --git a/tests/functions.sh b/tests/functions.sh index 1dc671d9e..7174a35af 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -64,25 +64,25 @@ function ts_skip_nonroot { } function ts_failed_subtest { + local msg="FAILED" + local ret=1 + if [ "$TS_KNOWN_FAIL" = "yes" ]; then + msg="KNOWN FAILED" + ret=0 + fi + if [ x"$1" == x"" ]; then - ts_report " FAILED ($TS_NS)" + ts_report " $msg ($TS_NS)" else - ts_report " FAILED ($1)" + ts_report " $msg ($1)" fi + + return $ret } function ts_failed { ts_failed_subtest "$1" - exit 1 -} - -function ts_known_failed { - if [ x"$1" == x"" ]; then - ts_report " KNOWN FAILED ($TS_NS)" - else - ts_report " KNOWN FAILED ($1)" - fi - exit 0 + exit $? } function ts_ok_subtest { @@ -393,9 +393,6 @@ function ts_finalize { if [ -s $TS_EXPECTED ]; then ts_gen_diff if [ $? -eq 1 ]; then - if [ "$TS_KNOWN_FAIL" = "yes" ]; then - ts_known_failed "$1" - fi ts_failed "$1" fi ts_ok "$1" -- cgit v1.2.3-55-g7522