transition fix
[mc1516pa.git] / modelchecker / test.sh
index e34ffae..2aa9aea 100755 (executable)
@@ -1,16 +1,21 @@
 #!/bin/bash
+set -e
 
+make
+cd tests
+./generate_tests.sh
+cd ..
 TOTAL=0
 PASSED=0
-for testscreen in tests/*; do
+for testscreen in tests/[^g]*; do
        NUM="$(basename "$(echo $testscreen | cut -d'.' -f1)")"
        OUT="$(./main "$testscreen" 2>&1| grep -Po "(?<=Satcount: )\d+(?=\.)")"
        if [ "$NUM" -ne "$OUT" ]; then
                echo "$testscreen failed, expected: $NUM, got: $OUT."
-               cat "$testscreen"
+               echo "'$(cat "$testscreen")'"
        else
                PASSED=$((PASSED+1))
        fi
        TOTAL=$((TOTAL+1))
 done
-echo "$PASSED/$TOTAL passed"
+echo "$((TOTAL-PASSED))/$TOTAL failed"