aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-08-17 23:36:54 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2025-08-17 23:36:54 +0300
commit7a811406dd16e057204bed1aa15cfe33d81ccb6b (patch)
tree67437eea5c2b922cf3847f4b24b4988b0a566d36 /scripts
downloadcovsrv-7a811406dd16e057204bed1aa15cfe33d81ccb6b.tar.gz
covsrv-7a811406dd16e057204bed1aa15cfe33d81ccb6b.zip
initial commit
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