From b0d619e2c9595f4ec05463e87be9d0d3423c0a70 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 22 Aug 2025 15:27:17 +0300 Subject: use covsrv for coverage testing --- scripts/run-test | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 scripts/run-test (limited to 'scripts/run-test') diff --git a/scripts/run-test b/scripts/run-test new file mode 100755 index 0000000..05ddfe1 --- /dev/null +++ b/scripts/run-test @@ -0,0 +1,31 @@ +#!/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 + + if grep 'loss record' "reports/$NAME/run-$I" >/dev/null; then + echo "$NAME: MEM FAILED" + exit 1 + 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 -- cgit v1.2.3