Package: debhelper
Version: 7.9.3
Severity: wishlist
Tags: patch

Hello,

CTest (CMake test suite runner) as of 2.8 supports running tests in parallel
(-jN) option. This patch adds support for this feature to the debhelper cmake
build system (see commit message).

Fortunately, ctest does not seem to choke on unknown options so this change
should not break CTest 2.6 or earlier. Another issue is "unlimited paralel".
Unlike makefile, CTest parallel is typically not dependency based so running
with huge number of threads (-j999) is likely to run all existing tests in
paralel and if there is a huge number of them, this will kill every machine
which is not a supercomputer.  So whoever uses `dpkg-buildpackage -j` (without
parallel limit) may burn. Therefore, feel free to reduce that value if you
wish. IMHO, people using `dpkg-buildpackage -j` (very unwise choice) get what
they asked for and deserve this "lesson".

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (101, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.34-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=lt_LT.UTF-8, LC_CTYPE=lt_LT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages debhelper depends on:
ii  binutils                      2.20.1-11  The GNU assembler, linker and bina
ii  dpkg-dev                      1.15.7.2   Debian package development tools
ii  file                          5.04-2     Determines file type using "magic"
ii  html2text                     1.3.2a-15  advanced HTML to text converter
ii  man-db                        2.5.7-3    on-line manual pager
ii  perl                          5.10.1-13  Larry Wall's Practical Extraction 
ii  perl-base                     5.10.1-13  minimal Perl system
ii  po-debconf                    1.0.16     tool for managing templates file t

debhelper recommends no packages.

Versions of packages debhelper suggests:
pn  dh-make                       <none>     (no description available)

-- no debconf information
>From e74abe3a706d37513889f7722be245ae6c26659e Mon Sep 17 00:00:00 2001
From: Modestas Vainius <modes...@vainius.eu>
Date: Fri, 2 Jul 2010 05:11:24 +0300
Subject: [PATCH] Add support for running tests in parallel to the cmake build 
system.

Pass appropriate -jN option to ctest (via ARGS variable in the Makefile) to
enable support for running tests in parallel. Similarly to makefile build
system, ctest -j1 mode is enforced even when parallel mode in debhelper is not
explicitly enabled.

Unlike make, CTest does not have "unlimited parallel" setting (-j implies -j1).
So in order to simulate unlimited parallel, allow to fork a huge number of
threads instead.
---
 Debian/Debhelper/Buildsystem/cmake.pm |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Debian/Debhelper/Buildsystem/cmake.pm 
b/Debian/Debhelper/Buildsystem/cmake.pm
index d4a98f4..3207d24 100644
--- a/Debian/Debhelper/Buildsystem/cmake.pm
+++ b/Debian/Debhelper/Buildsystem/cmake.pm
@@ -50,8 +50,12 @@ sub configure {
 sub test {
        my $this=shift;
 
+       # Unlike make, CTest does not have "unlimited parallel" setting (-j 
implies
+       # -j1). So in order to simulate unlimited parallel, allow to fork a huge
+       # number of threads instead.
+       my $parallel = ($this->get_parallel() > 0) ? $this->get_parallel() : 
999;
        $ENV{CTEST_OUTPUT_ON_FAILURE} = 1;
-       return $this->SUPER::test(@_);
+       return $this->SUPER::test(@_, "ARGS+=-j$parallel");
 }
 
 1
-- 
1.7.1

Reply via email to