summaryrefslogtreecommitdiff
path: root/scripts/run-test
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/run-test')
-rwxr-xr-xscripts/run-test13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/run-test b/scripts/run-test
index 05ddfe1..017562e 100755
--- a/scripts/run-test
+++ b/scripts/run-test
@@ -5,11 +5,18 @@ NAME=$(basename "$TEST")
mkdir -p "reports/$NAME"
+try_vg() {
+ if which -s valgrind; then
+ valgrind -q --leak-check=full --error-exitcode=1 "$1"
+ else
+ eval "$1"
+ fi
+}
+
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
+ if try_vg "./${TEST}" > "reports/$NAME/run-$I" 2>&1
then
echo "$NAME: PASSED"
exit 0
@@ -17,6 +24,7 @@ while :; do
if grep 'loss record' "reports/$NAME/run-$I" >/dev/null; then
echo "$NAME: MEM FAILED"
+ cat "reports/$NAME/run-$I"
exit 1
fi
@@ -27,5 +35,6 @@ while :; do
fi
echo "$NAME: FAILED"
+ cat "reports/$NAME/run-$I"
exit 1
done