From 8177a9ac16d91720efcc7f78562d44aeff30aa92 Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Mon, 2 Mar 2026 21:43:22 -0800 Subject: [PATCH] tests: avoid false test failure when using address sanitizer * tests/misc/warning-errors.sh: Skip commands which have been built with sanitizers, since standard error will not be closed and checked for errors. Reported by Bruno Haible. --- tests/misc/warning-errors.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/misc/warning-errors.sh b/tests/misc/warning-errors.sh index cea0b618e..639a3a01a 100755 --- a/tests/misc/warning-errors.sh +++ b/tests/misc/warning-errors.sh @@ -64,6 +64,9 @@ expected_failure_status_env=0 # env's exec resets default exit handlers while read writer; do cmd=$(printf '%s\n' "$writer" | cut -d ' ' -f1) || framework_failure_ + # We don't close standard error with sanitizers, which may need to print. + # Therefore, these programs may succeed when they otherwise wouldn't. + sanitizer_build_ $cmd && continue eval "expected=\$expected_failure_status_$cmd" test x$expected = x && expected=1 returns_ $expected \