summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorAndrew Kroeger <andrew@sprocks.gotdns.com>2008-05-21 02:07:45 -0500
committerAndrew Kroeger <andrew@sprocks.gotdns.com>2008-05-21 20:46:14 -0500
commitfe17acfa82079559f8c8b30ab32564418a3cc87e (patch)
treeb742e18ad7474d572fc6b00ab26b0051378b927a /testprogs
parentd8459e3e1c87577768a2a250f701f14a64c22541 (diff)
downloadsamba-fe17acfa82079559f8c8b30ab32564418a3cc87e.tar.gz
samba-fe17acfa82079559f8c8b30ab32564418a3cc87e.tar.bz2
samba-fe17acfa82079559f8c8b30ab32564418a3cc87e.zip
subunit.sh: Properly capture and pass on the command output.
Previously, the output from $cmdline was never captured. In case of a failure, there was no output being passed to the subunit_fail_test() function, but that function contains a call to "cat -". This caused the script to hang indefinitely waiting for input. We now capture $cmdline output (including mapping stderr to stdout) using backticks, and then pipe that output to the subunit_fail_test() if there is a failure. (This used to be commit c0234d13192c1871971b45121249395ef15c5ae5)
Diffstat (limited to 'testprogs')
-rwxr-xr-xtestprogs/blackbox/subunit.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/testprogs/blackbox/subunit.sh b/testprogs/blackbox/subunit.sh
index 7a6b21e540..100dfd1a46 100755
--- a/testprogs/blackbox/subunit.sh
+++ b/testprogs/blackbox/subunit.sh
@@ -56,12 +56,12 @@ testit () {
shift
cmdline="$*"
subunit_start_test "$name"
- $cmdline
+ output=`$cmdline 2>&1`
status=$?
if [ x$status = x0 ]; then
subunit_pass_test "$name"
else
- subunit_fail_test "$name"
+ echo $output | subunit_fail_test "$name"
fi
return $status
}