diff options
Diffstat (limited to 'run_tests.sh')
-rwxr-xr-x | run_tests.sh | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/run_tests.sh b/run_tests.sh index 2cff423..fe5f068 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,6 +1,8 @@ -#!/bin/bash -e +#!/bin/bash -exit_code=0 +t_pass=0 +t_fail=0 +t_xfail=0 [ -z "$SOLVER" ] && SOLVER="$PWD/test-solver" XFAILS="$PWD/test/xfails" @@ -8,26 +10,36 @@ XFAILS="$PWD/test/xfails" test_fail() { t="$(basename $1)" if grep -q "$t" "$XFAILS" ; then - echo -e "$t: "'[\e[34;1mXFAIL\e[0m]' + echo -e '[\e[34;1mXFAIL\e[0m]'" $t" + ((t_xfail++)) else - echo -e "$t: "'[\e[31;1mFAIL\e[0m]' + echo -e '[\e[31;1mFAIL\e[0m]'" $t" + ((t_fail++)) fi } test_pass() { t="$(basename $1)" - echo -e "$t: "'[\e[32;1mPASS\e[0m]' + echo -e '[\e[32;1mPASS\e[0m]'" $t" + ((t_pass++)) } for t in test/*-* ; do pushd "$t" >/dev/null if ! "$SOLVER" >/dev/null ; then test_fail "$t" - exit_code=1 else test_pass "$t" fi popd >/dev/null done -exit "$exit_code" +total_fail="$((t_fail + t_xfail))" +echo "========================================" +echo "Passes : $t_pass" +echo "Failures: $t_fail ($t_xfail of which are expected)" +echo "========================================" + +if [ "$t_fail" -gt "0" ]; then + exit 1 +fi |