summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/functions.sh27
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"