typos
[mc1516pa.git] / modelchecker / test.sh
1 #!/bin/bash
2 set -e
3
4 make
5 cd tests
6 ./generate_tests.sh
7 cd ..
8 TOTAL=0
9 PASSED=0
10 for testscreen in tests/[^g]*; do
11 NUM="$(basename "$(echo $testscreen | cut -d'.' -f1)")"
12 OUT="$(./main "$testscreen" 2>&1| grep -Po "(?<=Satcount: )\d+(?=\.)")"
13 ./main "$testscreen" 2>&1
14 if [ "$NUM" -ne "$OUT" ]; then
15 echo "$testscreen failed, expected: $NUM, got: $OUT."
16 echo "'$(cat "$testscreen")'"
17 else
18 PASSED=$((PASSED+1))
19 fi
20 TOTAL=$((TOTAL+1))
21 done
22 echo "$((TOTAL-PASSED))/$TOTAL failed"