RFC: make fastcheck

Message ID xnpnlxip95.fsf@greed.delorie.com
State Superseded

Commit Message

DJ Delorie July 26, 2019, 1 a.m. UTC
  "Carlos O'Donell" <carlos@redhat.com> writes:
> I think that the support infrastructure could be told it's running
> a threaded test, and then allow them to be parallelized up to a
> point, perhaps a load factor, or something else.
> The first step would obviously be:
> * For all nptl tests support serializes them with a lock file.
> * Remove .NOTPARALLEL.

Given the huge number of tests in nptl, I'd try a makefile-based
serialization first, since the list could be automated.  I'm testing
this (requires make 3.80) and it seems to work, but not perfectly (maybe
it's just remnants of tests still running where ps can see them, but
there are two real FAILs for some reason).  Saves about 1.5 minutes (out
of 15) off a "rm -rf nptl; make; make check"

(and yes, I know, the tests are run in reverse order ;)


diff --git a/nptl/Makefile b/nptl/Makefile
index 0567e77a79..1eb7fd4286 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -666,7 +666,7 @@  $(objpfx)tst-cleanup0.out: /dev/null $(objpfx)tst-cleanup0
 $(objpfx)tst-cleanup0-cmp.out: tst-cleanup0.expect $(objpfx)tst-cleanup0.out
-	cmp $^ > $@; \
+	cmp tst-cleanup0.expect $(objpfx)tst-cleanup0.out > $@; \
 $(objpfx)crti.o: $(objpfx)pt-crti.o
@@ -723,7 +723,14 @@  tst-audit-threads-ENV = LD_AUDIT=$(objpfx)tst-audit-threads-mod1.so
 CFLAGS-tst-unwind-thread.c += -funwind-tables
+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))
 # The tests here better do not run in parallel
-ifneq ($(filter %tests,$(MAKECMDGOALS)),)
+$(foreach pair,$(TESTPAIRS),$(eval $(pair)))