[PATCH] Makefile: add allow-list for failures
Andreas Schwab
schwab@suse.de
Mon Feb 23 14:10:47 GMT 2026
On Feb 23 2026, Florian Weimer wrote:
> * Martin Coufal:
>
>> Enable adding known failures to allowed-failures.txt and ignore failures
>> in case they are in the list. In case the allowed-failures.txt does not
>> exist, all failures lead to a failed status as before.
>>
>> When the file is present, failures of listed tests are ignored and reported
>> on stdout. If tests not in the allowed list fail, summarize-tests exits with
>> status 1 and reports the failing tests.
>>
>> The expected format of allowed-failures.txt file is:
>> <test_name> # <comment>
>> ---
>> Makefile | 29 ++++++++++++++++++++++++++++-
>> 1 file changed, 28 insertions(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index f81572c20a..f7a993f15b 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -594,7 +594,34 @@ define summarize-tests
>> @grep -E '^[A-Z]+:' $(objpfx)$1 | grep -E -v '^(PASS|XFAIL):' || true
>> @echo " === Summary of results$2 ==="
>> @sed -e '/:.*/!d' -e 's/:.*//' < $(objpfx)$1 | sort | uniq -c
>> -@! grep -E '^[A-Z]+:' $(objpfx)$1 | grep -E -q -v '^(X?PASS|XFAIL|UNSUPPORTED):'
>> +@{ \
>> + grep -E '^[A-Z]+:' $(objpfx)$1 | \
>> + grep -E -v '^(X?PASS|XFAIL|UNSUPPORTED):' | \
>> + ( \
>> + if ! test -f $(..)allowed-failures.txt; then \
>> + read -r _; exit $$(( $$? == 0 )); \
>
> Can we use bash-only constracts in Makefiles?
Arithmetic expansion has been part of POSIX for more than 30 years.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
More information about the Libc-alpha
mailing list