aboutsummaryrefslogtreecommitdiff
path: root/test/run-tests.sh
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-11-18 15:27:20 +1300
committerDavid Phillips <david@sighup.nz>2017-11-18 15:27:20 +1300
commite9ca2c4957c6187878425f6040fafbca54a965d2 (patch)
treeae90c4e0eba9947252914bb01954ea986b426584 /test/run-tests.sh
parent7e1f69a4c43b79f1424c78283f1825fe97638065 (diff)
downloadsand-leek-e9ca2c4957c6187878425f6040fafbca54a965d2.tar.xz
Output stderr and stdout on test failure
Diffstat (limited to 'test/run-tests.sh')
-rwxr-xr-xtest/run-tests.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/run-tests.sh b/test/run-tests.sh
index b7f7856..68a3adf 100755
--- a/test/run-tests.sh
+++ b/test/run-tests.sh
@@ -4,7 +4,6 @@
fail()
{
echo -e '[\e[1;31mFAIL\e[0m] '"$i:" "$@"
- exit 1
}
pass()
@@ -18,6 +17,7 @@ check_expected()
if [ -f "$1.expected" ] ; then
if ! diff "$1.expected" "$1.tmp" >/dev/null; then
fail "$1 didn't match expected"
+ exit 1
fi
fi
}
@@ -28,6 +28,11 @@ for i in *.test ; do
pushd "${i}" >/dev/null
if ! ( . ./run.sh ) 2>stderr.tmp >stdout.tmp; then
fail "script had non-zero return code"
+ echo "stderr:"
+ cat stderr.tmp
+ echo "stdout:"
+ cat stdout.tmp
+ exit 1
fi
check_expected stdout