From 5af5b196742a477c3effb9534c5a3257c8075a8e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 21 Nov 2024 15:36:59 +0100 Subject: test: Do not fail if valgrind is not available The command -v check inadvertently exited 0 because it confusingly also considers functions and aliases. Check if we are able to run a valgrind binary instead by querying its version. Then, the msgdebug in the alternative code path was included in the output that we are asserting so that was causing failures too and needs removing. Everything is horrible :D --- test/integration/framework | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index e054b4209..10cae70a5 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -256,10 +256,9 @@ valgrind() { if [ "${CMD##*/}" = "$CMD" ]; then CMD="${APTCMDLINEBINDIR}/${CMD}" fi - if command -v valgrind > /dev/null; then + if command valgrind --version >/dev/null 2>&1; then runapt command valgrind -q --error-exitcode=7 "$CMD" "$@" else - msgdebug "Running without valgrind" runapt command "$CMD" "$@" fi } -- cgit v1.2.3-70-g09d2