X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=modelchecker%2Ftest.sh;h=84d30e71152bbd4fbec11ba4ed55bed8b0444e48;hb=ac8d9afc8de1218083638d0871e98ff15daa9aab;hp=e34ffaeec7ac815c6b6fa07c7738a06b5532f2e6;hpb=259ed7dfe69f50fd1b4967b272b094f1b2b50493;p=mc1516pa.git diff --git a/modelchecker/test.sh b/modelchecker/test.sh index e34ffae..84d30e7 100755 --- a/modelchecker/test.sh +++ b/modelchecker/test.sh @@ -1,16 +1,22 @@ #!/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+(?=\.)")" + ./main "$testscreen" 2>&1 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"