summaryrefslogtreecommitdiffstats
path: root/tests/functions.sh
diff options
context:
space:
mode:
authorRuediger Meier2014-05-10 03:57:26 +0200
committerRuediger Meier2014-05-12 09:56:08 +0200
commit7641ccec603a5aaca7fad465bf558ed78e4c31a0 (patch)
treeb27c13eba465d7ce2fa3a59a1604d084efc5b3d7 /tests/functions.sh
parenttests: fix var names (diff)
downloadkernel-qcow2-util-linux-7641ccec603a5aaca7fad465bf558ed78e4c31a0.tar.gz
kernel-qcow2-util-linux-7641ccec603a5aaca7fad465bf558ed78e4c31a0.tar.xz
kernel-qcow2-util-linux-7641ccec603a5aaca7fad465bf558ed78e4c31a0.zip
tests: add exit case "KNOWN FAILED"
Now we can mark tests as known to be broken without bothering users with exit failure. In the build log this "KNOWN FAILED" may be interpreted as TODO ;) The main advantage of "known-fail" instead of just skipping is that we will still find the test diff. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/functions.sh')
-rw-r--r--tests/functions.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/functions.sh b/tests/functions.sh
index 6631de49d..1dc671d9e 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -76,6 +76,15 @@ function ts_failed {
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
+}
+
function ts_ok_subtest {
if [ x"$1" == x"" ]; then
ts_report " OK"
@@ -196,6 +205,7 @@ function ts_init_env {
TS_VERBOSE=$(ts_has_option "verbose" "$*")
TS_PARALLEL=$(ts_has_option "parallel" "$*")
+ TS_KNOWN_FAIL=$(ts_has_option "known-fail" "$*")
tmp=$( ts_has_option "memcheck" "$*")
if [ "$tmp" == "yes" -a -f /usr/bin/valgrind ]; then
@@ -383,6 +393,9 @@ 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"