From 4c71e96cba340fd1a1b0533669029653082643eb Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Mon, 28 Aug 2023 19:37:49 +0100 Subject: [PATCH] Skip valgrind tests if the tool is present but does not support the options we use. --- tests/run-valgrind.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/run-valgrind.sh b/tests/run-valgrind.sh index 454b19c..97e785e 100755 --- a/tests/run-valgrind.sh +++ b/tests/run-valgrind.sh @@ -29,6 +29,11 @@ if ! command -v valgrind >/dev/null 2>&1; then exit 77 fi +valgrindHelp="$(valgrind --help 2>&1)" +for valgrindOption in "verbose" "show-error-list" "error-exitcode" "track-fds" "leak-check"; do + echo "${valgrindHelp}" | grep -Fq "${valgrindOption}" || { echo "test requires \`valgrind --${valgrindOption}'"; exit 77; } +done + runWithValgrind () { valgrind --tool=memcheck \