1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

testprogs:subunit.sh: Add function for expected failures.

The testit_expect_failure() function is like the testit() function, with
reversed error detection logic.  This reversal only affects the pass/fail logic
and logging - the original return code from the command is still returned to the
calling script.
This commit is contained in:
Andrew Kroeger 2009-09-08 16:01:26 -05:00 committed by Matthias Dieter Wallnöfer
parent ebdb9da78e
commit 67a8a8c9e6

View File

@ -65,3 +65,18 @@ testit () {
fi
return $status
}
testit_expect_failure () {
name="$1"
shift
cmdline="$*"
subunit_start_test "$name"
output=`$cmdline 2>&1`
status=$?
if [ x$status = x0 ]; then
echo "$output" | subunit_fail_test "$name"
else
subunit_pass_test "$name"
fi
return $status
}