summaryrefslogtreecommitdiff
path: root/test/solver.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/solver.sh')
-rwxr-xr-xtest/solver.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/solver.sh b/test/solver.sh
new file mode 100755
index 0000000..d819c70
--- /dev/null
+++ b/test/solver.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+APK_TEST=../src/apk_test
+
+fail=0
+for test in *.test; do
+ bn=$(basename $test .test)
+ $APK_TEST $(cat $test) &> $bn.got
+ if ! cmp $bn.expect $bn.got 2> /dev/null; then
+ fail=$((fail+1))
+ echo "FAIL: $test"
+ diff -ru $bn.expect $bn.got
+ else
+ echo "OK: $test"
+ fi
+done
+
+if [ "$fail" != "0" ]; then
+ echo "FAIL: $fail failed test cases"
+fi
+
+exit $fail
+