[dpkg] 15/187: build: Add support for running the test suite in parallel

Reiner Herrmann reiner at reiner-h.de
Sun Nov 6 12:46:18 UTC 2016


This is an automated email from the git hooks/post-receive script.

deki-guest pushed a commit to branch master
in repository dpkg.

commit c23a8958fdc84b60be640d6750967b85b75dd168
Author: Guillem Jover <guillem at debian.org>
Date:   Wed Sep 7 20:30:47 2016 +0200

    build: Add support for running the test suite in parallel
    
    Add a new test variable TEST_PARALLEL, and set it from debian/rules when
    we've got the parallel=N tag in DEB_BUILD_OPTIONS.
---
 check.am         | 3 +++
 debian/changelog | 1 +
 debian/rules     | 8 +++++++-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/check.am b/check.am
index 55b146f..c902a40 100644
--- a/check.am
+++ b/check.am
@@ -1,6 +1,7 @@
 # Variables to be defined:
 #
 #  TEST_VERBOSE - set to 0 (default) or 1 to control test suite verbosity
+#  TEST_PARALLEL - set to 1 (default) or N to control the parallel jobs
 #  TEST_ENV_VARS - environment variables to be set for the test suite
 #  TEST_COVERAGE - set to the perl module in charge of getting test coverage
 #  test_tmpdir - test suite temporary directory
@@ -9,12 +10,14 @@
 #  test_data - list of test data files
 
 TEST_VERBOSE ?= 0
+TEST_PARALLEL ?= 1
 
 TEST_RUNNER = '\
 	my $$harness = TAP::Harness->new({ \
 	    lib => [ "$(top_srcdir)/scripts", "$(top_srcdir)/dselect/methods"  ], \
 	    color => 1, \
 	    verbosity => $(TEST_VERBOSE), \
+	    jobs => $(TEST_PARALLEL), \
 	    failures => 1, \
 	}); \
 	my $$aggregate = $$harness->runtests(@ARGV); \
diff --git a/debian/changelog b/debian/changelog
index a4a9a96..ec86816 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,7 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
       As at least gcc and clang do not warn on -Wno-* warning flags, only
       when some unrelated warning needs to be emitted.
     - Bump po4a version to 0.43 (we are using --porefs wrap option).
+    - Add support for running the test suite in parallel.
 
   [ Updated manpages translations ]
   * German (Helge Kreutzmann).
diff --git a/debian/rules b/debian/rules
index cd5bd55..d57fa22 100755
--- a/debian/rules
+++ b/debian/rules
@@ -37,6 +37,12 @@ ifeq (,$(filter maintainer-build,$(DEB_BUILD_OPTIONS)))
 	confflags += --disable-silent-rules
 endif
 
+# Enable parallel test suite
+NUMJOBS = 1
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+  NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+endif
+
 D := $(CURDIR)/debian/tmp
 
 # Create configure script if necessary, automake handles rebuilding it.
@@ -75,7 +81,7 @@ check: build
 	dh_testdir
 
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-	cd build-tree && $(MAKE) VERBOSE=1 check
+	cd build-tree && $(MAKE) VERBOSE=1 TEST_PARALLEL=$(NUMJOBS) check
 endif
 
 # Install the package underneath debian/tmp

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list