bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: coreutils/gnulib-tests to run in parallel


From: Jim Meyering
Subject: FYI: coreutils/gnulib-tests to run in parallel
Date: Fri, 13 Jun 2008 09:22:31 +0200

Hello,

Just a heads up that I'll soon be making coreutils run its gnulib-tests/
in parallel.  There are now enough tests in that directory that this
results in significantly shorter "make -j$N check" times on multi-core
systems.

This means we need to be careful about the choice of temporary file
names used when running those tests.

I haven't audited any of the tests for conflicts, so there may well
be potential temporary file collisions, but with the patch below,
"make -j8 check" has passed numerous times in coreutils' gnulib-tests/.

In case you hadn't heard, I converted the 300+ tests under coreutils' main
test directory, tests/ to run safely in parallel a couple months ago --
each runs in its own uniquely-named subdirectory so that it is guaranteed
not to have collisions when they're run in parallel (or even the same
test run twice concurrently).  That also makes tests cleaner because
the shared infrastructure (tests/test-lib.sh) takes care of creating
the temporary directory and cleaning up after the test has completed.
So they don't have to be careful about temporary file names in the current
directory, no do they have to handle clean-up e.g., on interrupt or exit.

There is also a side effect with this change: PASS and FAIL
are printed in color (green, red) when possible also for the
tests in gnulib-tests/.

Actually, the difference in total run time isn't as great as I'd hoped it
would be due to two relatively long-running tests, test-malloca and
test-stat-time.  The latter takes over 8 seconds even on a fast system.
because of its four sleep(2) calls, and the former just does a lot
of computation.  At least with -j2 or better, they run in parallel.
For reference, "make -j5 check" now takes about 10-11 seconds on a fast
dual-core system, while before it took well over twice as long.


>From a1d76dc206b8da3254130cf9de02b0e70d6b50ba Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 12 Jun 2008 22:50:58 +0200
Subject: [PATCH] run gnulib-tests in parallel

* tests/Makefile.am: Define AUTOMAKE_OPTIONS, so check.mk can append.
* tests/check.mk: Define SUFFIXES, so check.mk can append.
* build-aux/check.mk (SUFFIXES): Append, so as not to evoke
automake warning the prior definition in gnulib-tests/gnulib.mk.
(AUTOMAKE_OPTIONS): Likewise.
* gnulib-tests/Makefile.am (TEST_LOGS): Define.
Include build-aux/check.mk
---
 build-aux/check.mk       |    4 ++--
 gnulib-tests/Makefile.am |    5 +++++
 tests/Makefile.am        |    1 +
 tests/check.mk           |    1 +
 4 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/build-aux/check.mk b/build-aux/check.mk
index 165ea36..f26696d 100644
--- a/build-aux/check.mk
+++ b/build-aux/check.mk
@@ -41,7 +41,7 @@ ENABLE_HARD_ERRORS = :

 ## We use GNU Make extensions (%-rules) inside GNU_MAKE checks,
 ## and we override check-TESTS.
-AUTOMAKE_OPTIONS = -Wno-portability -Wno-override
+AUTOMAKE_OPTIONS += -Wno-portability -Wno-override

 # Restructured Text title and section.
 am__rst_title   = sed 's/.*/   &   /;h;s/./=/g;p;x;p;g;p;s/.*//'
@@ -145,7 +145,7 @@ echo "$$res: $@ (exit: $$estatus)" |                        
\
 cat address@hidden >>$@;                                               \
 rm address@hidden

-SUFFIXES = .html .log
+SUFFIXES += .html .log

 # From a test (with no extension) to a log file.
 if GNU_MAKE
diff --git a/gnulib-tests/Makefile.am b/gnulib-tests/Makefile.am
index 6635f70..7523e0d 100644
--- a/gnulib-tests/Makefile.am
+++ b/gnulib-tests/Makefile.am
@@ -1 +1,6 @@
 include gnulib.mk
+
+TEST_LOGS = $(TESTS:=.log)
+
+# Parallel replacement of Automake's check-TESTS target.
+include $(top_srcdir)/build-aux/check.mk
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d33005a..5e3a526 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -562,4 +562,5 @@ pr_data =                                   \
   pr/ttb3-FF                                   \
   pr/w72l24f-ll

+AUTOMAKE_OPTIONS =
 include $(srcdir)/check.mk
diff --git a/tests/check.mk b/tests/check.mk
index 0e34e98..3ac5e42 100644
--- a/tests/check.mk
+++ b/tests/check.mk
@@ -91,6 +91,7 @@ TESTS_ENVIRONMENT =                           \
 TEST_LOGS = $(TESTS:=.log)

 # Parallel replacement of Automake's check-TESTS target.
+SUFFIXES =
 include $(top_srcdir)/build-aux/check.mk

 VERBOSE = yes
--
1.5.6.rc0.30.g7c3f3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]