summaryrefslogtreecommitdiff
path: root/run_tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'run_tests.sh')
-rwxr-xr-xrun_tests.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/run_tests.sh b/run_tests.sh
new file mode 100755
index 0000000..2cff423
--- /dev/null
+++ b/run_tests.sh
@@ -0,0 +1,33 @@
+#!/bin/bash -e
+
+exit_code=0
+
+[ -z "$SOLVER" ] && SOLVER="$PWD/test-solver"
+XFAILS="$PWD/test/xfails"
+
+test_fail() {
+ t="$(basename $1)"
+ if grep -q "$t" "$XFAILS" ; then
+ echo -e "$t: "'[\e[34;1mXFAIL\e[0m]'
+ else
+ echo -e "$t: "'[\e[31;1mFAIL\e[0m]'
+ fi
+}
+
+test_pass() {
+ t="$(basename $1)"
+ echo -e "$t: "'[\e[32;1mPASS\e[0m]'
+}
+
+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"