[glibc] Makefile: Only print the test summary in the second pass of 'make check'

Adhemerval Zanella via Glibc-cvs <[email protected]>
Newsgroups gmane.comp.lib.glibc.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=96a9a09d7d5527462a823c247569e65feeca8ddb

commit 96a9a09d7d5527462a823c247569e65feeca8ddb
Author: Adhemerval Zanella <[email protected]>
Date:   Thu Aug 6 14:07:57 2026 -0300

    Makefile: Only print the test summary in the second pass of 'make check'
    
    The build-only first pass of the two-pass 'make check' still runs the
    static checks (abi, conformtest, installed headers, etc.), and the
    top-level tests recipe merged and summarized their results.
    
    An unexpected FAIL there (e.g. check-abi) aborted 'check' before the
    second pass ran any built test, and even a clean run printed a misleading
    partial summary.
    
    Pass tests-summary=no in the first pass to skip the merge and summary;
    the .test-result files persist, so the second pass folds those results
    into the one complete summary at the end, restoring the single-pass
    reporting behavior.
    Reviewed-by: Sam James <[email protected]>

Diff:
---
 Makefile  |  7 +++++++
 Makerules | 11 +++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index a6aabca691..b9fac6f47c 100644
--- a/Makefile
+++ b/Makefile
@@ -869,7 +869,11 @@ endif
 	touch $(objpfx)testroot.pristine/install.stamp
 
 tests-special-notdir = $(patsubst $(objpfx)%, %, $(tests-special))
+# The build-only first pass of the two-pass 'make check' (see Makerules)
+# passes tests-summary=no: the merge and summary are left to the second
+# pass, which folds in this pass's $(tests-special) results.
 tests: $(tests-special)
+ifneq ($(tests-summary),no)
 	$(..)scripts/merge-test-results.sh -s $(objpfx) "" \
 	  $(sort $(tests-special-notdir:.out=)) \
 	  > $(objpfx)subdir-tests.sum
@@ -877,11 +881,14 @@ tests: $(tests-special)
 	  $(sort $(subdirs) .) \
 	  > $(objpfx)tests.sum
 	$(call summarize-tests,tests.sum)
+endif
 xtests:
+ifneq ($(tests-summary),no)
 	$(..)scripts/merge-test-results.sh -t $(objpfx) subdir-xtests.sum \
 	  $(sort $(subdirs)) \
 	  > $(objpfx)xtests.sum
 	$(call summarize-tests,xtests.sum, for extra tests)
+endif
 
 # The realclean target is just like distclean for the parent, but we want
 # the subdirs to know the difference in case they care.
diff --git a/Makerules b/Makerules
index dfe66b7fa6..5f65f3ab9e 100644
--- a/Makerules
+++ b/Makerules
@@ -1211,6 +1211,13 @@ ALL_BUILD_CFLAGS = $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -D_GNU_SOURCE \
 # therefore builds the test programs (run-built-tests=no, recursion fully
 # parallel) and then runs them (run-built-tests=yes).  'make tests' and a
 # subdirectory's own 'check' stay single-pass.
+# The first pass still runs the static checks ($(tests-special): abi,
+# conformtest, installed headers, ...), so tests-summary=no makes it skip
+# the results merge and summary: an unexpected FAIL there would otherwise
+# abort 'check' before the second pass runs any built test, and even a
+# clean run would print a misleading partial summary.  The .test-result
+# files persist, so the second pass folds those results into the one
+# complete summary at the end.
 check-twopass :=
 ifndef subdir
 ifeq (yes,$(run-built-tests))
@@ -1219,10 +1226,10 @@ endif
 endif
 ifeq (yes,$(check-twopass))
 check:
-	$(MAKE) run-built-tests=no  tests
+	$(MAKE) run-built-tests=no  tests-summary=no tests
 	$(MAKE) run-built-tests=yes tests
 xcheck:
-	$(MAKE) run-built-tests=no  xtests
+	$(MAKE) run-built-tests=no  tests-summary=no xtests
 	$(MAKE) run-built-tests=yes xtests
 else
 check: tests
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.