aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/run-test26
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