[PATCH 3/3] Makefile: Only print the test summary in the second pass of 'make check'
Adhemerval Zanella <[email protected]> Mon, 27 Jul 2026 18:28:30 +0000
| Newsgroups | gmane.comp.lib.glibc.alpha |
|---|---|
| Message-ID | <[email protected]> |
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. --- Makefile | 6 ++++++ Makerules | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a6aabca6911..375a14d9432 100644 --- a/Makefile +++ b/Makefile @@ -869,7 +869,10 @@ endif touch $(objpfx)testroot.pristine/install.stamp tests-special-notdir = $(patsubst $(objpfx)%, %, $(tests-special)) +# 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 +880,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 dfe66b7fa6c..e24865c6a00 100644 --- a/Makerules +++ b/Makerules @@ -1211,6 +1211,10 @@ 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, etc.), so tests-summary=no makes it skip +# the results merge and summary. check-twopass := ifndef subdir ifeq (yes,$(run-built-tests)) @@ -1219,10 +1223,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 -- 2.43.0