]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid false test failure when using address sanitizer
authorCollin Funk <collin.funk1@gmail.com>
Tue, 3 Mar 2026 05:43:22 +0000 (21:43 -0800)
committerPádraig Brady <P@draigBrady.com>
Tue, 3 Mar 2026 11:30:19 +0000 (11:30 +0000)
* 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

index cea0b618e46fcf5e3921e3950216747a4a2247ee..639a3a01a9bac2eaac92617cf61d5f67230a8d21 100755 (executable)
@@ -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 \