Patchwork RFC: make fastcheck

login
register
mail settings
Submitter DJ Delorie
Date July 27, 2019, 12:06 a.m.
Message ID <xnimroibnm.fsf@greed.delorie.com>
Download mbox | patch
Permalink /patch/33824/
State New
Headers show

Comments

DJ Delorie - July 27, 2019, 12:06 a.m.
"Carlos O'Donell" <carlos@redhat.com> writes:
> Please post that valuable patch for review for 2.31 :-)

Formal patch to follow once the testing and bikeshedding is done ;-)

Timing... on my 4/8-core i7 (i7-4790K, 4GHz), saves about 37 seconds of
build-the-tests time. (make -j8 nptl/tests run-built-tests=no, 48s->11s)

Patch

diff --git a/nptl/Makefile b/nptl/Makefile
index 0567e77a79..d7a3857c95 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -666,7 +666,7 @@  $(objpfx)tst-cleanup0.out: /dev/null $(objpfx)tst-cleanup0
 	$(evaluate-test)
 
 $(objpfx)tst-cleanup0-cmp.out: tst-cleanup0.expect $(objpfx)tst-cleanup0.out
-	cmp $^ > $@; \
+	cmp tst-cleanup0.expect $(objpfx)tst-cleanup0.out > $@; \
 	$(evaluate-test)
 
 $(objpfx)crti.o: $(objpfx)pt-crti.o
@@ -723,7 +723,23 @@  tst-audit-threads-ENV = LD_AUDIT=$(objpfx)tst-audit-threads-mod1.so
 
 CFLAGS-tst-unwind-thread.c += -funwind-tables
 
-# The tests here better do not run in parallel
-ifneq ($(filter %tests,$(MAKECMDGOALS)),)
-.NOTPARALLEL:
+ifeq ($(run-built-tests),yes)
+# The tests in this subdir should not be run in parallel.
+#
+# The following will create rules like "foo2.out :| foo1.out" for all
+# tests, which forces the tests to be run serially, but does not force
+# a test to be run just because some other test was run.
+#
+# Caveat: the :|-style dependencies won't be listed in $^, so avoid
+# using $^ to depend on test result files.
+
+ALLTESTS = $(tests:%=$(objpfx)%.out) $(tests-internal:%=$(objpfx)%.out) \
+	$(tests-container:%=$(objpfx)%.out) \
+	$(tests-special) $(tests-printers-out) \
+	$(xtests:%=$(objpfx)%.out) $(xtests-special)
+
+ALLBUTFIRSTTEST = $(filter-out $(firstword $(ALLTESTS)), $(ALLTESTS))
+ALLBUTLASTTEST = $(filter-out $(lastword $(ALLTESTS)), $(ALLTESTS))
+TESTPAIRS = $(join $(ALLBUTFIRSTTEST),$(addprefix :|,$(ALLBUTLASTTEST)))
+$(foreach pair,$(TESTPAIRS),$(eval $(pair)))
 endif