Skip to content

Commit

Permalink
better handling of error logs for wml unit test script
Browse files Browse the repository at this point in the history
error logs get pooled in errors.log
This is necessary because we don't stop testing when we get an
error anymore.
  • Loading branch information
cbeck88 committed May 10, 2014
1 parent 8acf5db commit f08db9b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions run_wml_tests
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,16 @@ run_test()
wesnoth -u $2 $opts 2> error.log
if check_errs $2 $? $1; then
FirstTest=0 #Don't start using validcache flag until at least one test has passed without error
rm error.log
return 0
else
if [ -f "errors.log" ]; then
echo -e "\n--- next unit test ---\n" >> errors.log
cat error.log >> errors.log
else
cp error.log errors.log
fi
rm error.log
return 1
fi
}
Expand All @@ -133,8 +141,16 @@ run_test_unix_timeout()
timeout "--kill-after=$timer1" $timer wesnoth -u $2 $opts 2> error.log
if check_errs $2 $? $1; then
FirstTest=0 #Don't start using validcache flag until at least one test has passed without error
rm error.log
return 0
else
if [ -f "errors.log" ]; then
echo -e "\n--- next unit test ---\n" >> errors.log
cat error.log >> errors.log
else
cp error.log errors.log
fi
rm error.log
return 1
fi
}
Expand Down Expand Up @@ -194,6 +210,10 @@ done

echo "Running" $TESTS "test scenarios."

if [ -f "errors.log" ]; then
rm errors.log
fi

AllPassed=1
FirstTest=1

Expand Down Expand Up @@ -226,6 +246,7 @@ done

if [ $AllPassed -eq 0 ]; then
echo "Not all tests gave the correct result."
echo "Check errors.log for error reports."
exit 1
else
echo "All tests gave the correct result."
Expand Down

0 comments on commit f08db9b

Please sign in to comment.