chiark / gitweb /
test suite: Use nproc(1) rather than Sys::CPU.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 21 Jun 2018 00:10:38 +0000 (01:10 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 21 Jun 2018 00:32:31 +0000 (01:32 +0100)
This is more portable and does not depend on libsys-cpu-perl being
installed.

Closes:888496.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
tests/run-all

index 2c305561fcd6b7c9ab76191c8d435d352881b7e5..b34b4a0e090ed0041456966ab9faac9e8631b4c0 100644 (file)
@@ -15,6 +15,10 @@ dgit (5.2~) unstable; urgency=medium
     explanation, rather than looping with a false coplaint about git
     fetch.  Closes:#871317.
 
     explanation, rather than looping with a false coplaint about git
     fetch.  Closes:#871317.
 
+  test suite:
+  * Use nproc(1) rather than Sys::CPU.  This is more portable and does not
+    depend on libsys-cpu-perl being installed.  Closes:888496.
+
  --
 
 dgit (5.1) unstable; urgency=medium
  --
 
 dgit (5.1) unstable; urgency=medium
index cfa5ce2ff1ac7c260ca04fd088547dd15b5aef84..f72b9fae7d0958d490213027070c2736da87bc98 100755 (executable)
@@ -5,9 +5,8 @@ set -e
 
 set -o pipefail
 
 
 set -o pipefail
 
-set +e
-jcpus=`perl -MSys::CPU -we 'printf "-j%d\n", 1.34 * Sys::CPU::cpu_count()'`
-set -e
+ncpus=$(nproc || echo 1)
+jcpus=-j$(( ncpus * 134 / 100 ))
 
 if [ $# != 0 ]; then
        set TESTSCRIPTS="$*"
 
 if [ $# != 0 ]; then
        set TESTSCRIPTS="$*"