diff options
author | Andrew Kroeger <andrew@id10ts.net> | 2009-09-08 16:01:26 -0500 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-09-10 01:09:56 +0200 |
commit | 67a8a8c9e652d0f1aa5a1c593177bd75bc4af284 (patch) | |
tree | 02824bcdf9fc26819392bb5664344a08e6aaa750 /testprogs | |
parent | ebdb9da78e4ab66a633145d668ef4f777120f9c2 (diff) | |
download | samba-67a8a8c9e652d0f1aa5a1c593177bd75bc4af284.tar.gz samba-67a8a8c9e652d0f1aa5a1c593177bd75bc4af284.tar.bz2 samba-67a8a8c9e652d0f1aa5a1c593177bd75bc4af284.zip |
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.
Diffstat (limited to 'testprogs')
-rwxr-xr-x | testprogs/blackbox/subunit.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/testprogs/blackbox/subunit.sh b/testprogs/blackbox/subunit.sh index cee8cf6f45..e16aee76ca 100755 --- a/testprogs/blackbox/subunit.sh +++ b/testprogs/blackbox/subunit.sh @@ -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 +} |