Skip valgrind tests if the tool is present but does not support the options we use.

This commit is contained in:
Andrew Wood
2023-08-28 19:37:49 +01:00
parent f67d173aef
commit 4c71e96cba
+5
View File
@@ -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 \