diff options
author | Ruediger Meier | 2014-05-12 22:56:57 +0200 |
---|---|---|
committer | Ruediger Meier | 2014-05-13 15:39:25 +0200 |
commit | 733094a8510133a8ea72d52d5b8b3732b843b5fe (patch) | |
tree | 92baa30e5fe378703bacae4c86f4a5e7e6b93f90 /tests/functions.sh | |
parent | lib/colors: add to the man page hint about $HOME stuff (diff) | |
download | kernel-qcow2-util-linux-733094a8510133a8ea72d52d5b8b3732b843b5fe.tar.gz kernel-qcow2-util-linux-733094a8510133a8ea72d52d5b8b3732b843b5fe.tar.xz kernel-qcow2-util-linux-733094a8510133a8ea72d52d5b8b3732b843b5fe.zip |
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 <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/functions.sh')
-rw-r--r-- | tests/functions.sh | 27 |
1 files changed, 12 insertions, 15 deletions
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" |