diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2024-11-21 15:36:59 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2024-11-21 15:38:18 +0100 |
| commit | 5af5b196742a477c3effb9534c5a3257c8075a8e (patch) | |
| tree | 0a2e820060c5350991379591c411e2a4619a0293 /test/integration/framework | |
| parent | 55c373ca9f6567a27ec9e8f90384781908157dae (diff) | |
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
Diffstat (limited to 'test/integration/framework')
| -rw-r--r-- | test/integration/framework | 3 |
1 files changed, 1 insertions, 2 deletions
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 } |
