test: also output server.log on failure

master
Harald Hoyer 2018-08-14 11:37:57 +02:00
parent 393da0c370
commit 827a5b1a80
1 changed files with 5 additions and 1 deletions

View File

@ -75,6 +75,9 @@ while (($# > 0)); do
test_setup && test_run test_setup && test_run
ret=$? ret=$?
test_cleanup test_cleanup
if ((ret!=0)) && [[ -f "$TESTDIR"/server.log ]]; then
mv [[ -f "$TESTDIR"/server.log ]] ./
fi
rm -fr -- "$TESTDIR" rm -fr -- "$TESTDIR"
rm -f -- .testdir rm -f -- .testdir
exit $ret exit $ret
@ -88,7 +91,8 @@ while (($# > 0)); do
else else
echo -e "TEST: $TEST_DESCRIPTION " $COLOR_FAILURE "[FAILED]" $COLOR_NORMAL echo -e "TEST: $TEST_DESCRIPTION " $COLOR_FAILURE "[FAILED]" $COLOR_NORMAL
if [ "$V" == "2" ]; then if [ "$V" == "2" ]; then
cat $(pwd)/test.log cat $(pwd)/server.log $(pwd)/test.log
echo -e "TEST: $TEST_DESCRIPTION " $COLOR_FAILURE "[FAILED]" $COLOR_NORMAL
else else
echo "see $(pwd)/test.log" echo "see $(pwd)/test.log"
fi fi