Skip to content

Commit e2c2050

Browse files
authored
print output on failed tests (#67)
* print output on failed tests * fix name collision
1 parent 1639113 commit e2c2050

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/run_test.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,17 @@ for test in "$@"; do
9090
cat - "$test.in" |
9191
"$cmd")
9292
fi
93-
# exit code stored in $?
93+
result_code=$?
9494

95-
if [ $? -ne $expect ]; then
95+
if [ $result_code -ne $expect ]; then
9696
# If the exit code is wrong, the test is a failure and --bless won't help
97-
echo "${red}failed${off}"; exit_code=1; continue
97+
echo "${red}failed${off} (exit code = $result_code)"; exit_code=1
98+
if [ "$outfile" != "/dev/null" ]; then
99+
echo "---------------------------------------"
100+
cat "$test.produced"
101+
echo "---------------------------------------\n"
102+
fi
103+
continue
98104
fi
99105

100106
# Strip the first and last line of the output.

0 commit comments

Comments
 (0)