diff options
Diffstat (limited to 'scripts/run-test')
-rwxr-xr-x | scripts/run-test | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/run-test b/scripts/run-test new file mode 100755 index 0000000..c971120 --- /dev/null +++ b/scripts/run-test @@ -0,0 +1,26 @@ +#!/bin/sh + +TEST="$1" +NAME=$(basename "$TEST") + +mkdir -p "reports/$NAME" + +I=0 +while :; do + # if no error happened, consider it a pass + if valgrind -q --leak-check=full --error-exitcode=1 \ + "./$TEST" > "reports/$NAME/run-$I" 2>&1 + then + echo "$NAME: PASSED" + exit 0 + fi + + # an error occured, was it handled properly? + if grep 'COVSRV: EXIT' "reports/$NAME/run-$I" >/dev/null; then + I=$((I+1)) + continue + fi + + echo "$NAME: FAILED" + exit 1 +done |