]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/nolibc: show failed run if test process crashes
authorBenjamin Berg <benjamin.berg@intel.com>
Wed, 9 Jul 2025 15:55:10 +0000 (17:55 +0200)
committerThomas Weißschuh <linux@weissschuh.net>
Wed, 9 Jul 2025 16:28:36 +0000 (18:28 +0200)
The logic would not catch if the test process crashes and would
incorrectly report a "success" state. Fix this by looking for the final
"Total number of errors:" message and printing "failure" if it was not
seen.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://lore.kernel.org/r/20250709155512.971080-2-benjamin@sipsolutions.net
[Thomas: fix patch prefix]
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
tools/testing/selftests/nolibc/Makefile.nolibc

index 8cb65392fa105f544eacfb7711ca96b7ec5eb4fd..51ba853dd97eebed32f9808b0979460071f2514f 100644 (file)
@@ -245,8 +245,9 @@ endif
 include $(srctree)/tools/scripts/Makefile.include
 
 REPORT  ?= awk '/\[OK\][\r]*$$/{p++} /\[FAIL\][\r]*$$/{if (!f) printf("\n"); f++; print;} /\[SKIPPED\][\r]*$$/{s++} \
+               /^Total number of errors:/{done++} \
                END{ printf("\n%3d test(s): %3d passed, %3d skipped, %3d failed => status: ", p+s+f, p, s, f); \
-               if (f || !p) printf("failure\n"); else if (s) printf("warning\n"); else printf("success\n");; \
+               if (f || !p || !done) printf("failure\n"); else if (s) printf("warning\n"); else printf("success\n");; \
                printf("\nSee all results in %s\n", ARGV[1]); }'
 
 help: