chiark / gitweb /
Testing: New run-all script
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 29 Oct 2015 02:09:01 +0000 (02:09 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 Nov 2015 21:08:39 +0000 (21:08 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/README
tests/run-all [new file with mode: 0755]

index b13e658..8f63daa 100644 (file)
@@ -1,3 +1,5 @@
+tests/run-all
+
 tests/autotest tests/loginout.at
 
 REQUEST_METHOD=post CAFTEST_CAF=`pwd` tests/cgi ; echo
diff --git a/tests/run-all b/tests/run-all
new file mode 100755 (executable)
index 0000000..1ae2817
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -e
+make=`type gmake >/dev/null 2>&1 && echo gmake || echo make`
+if [ $# = 0 ]; then
+       ncpus=`
+               perl -e 'use Sys::CPU; print Sys::CPU::cpu_count()' \
+                       2>/dev/null \
+               || echo 1
+       `
+       set -- -j$(( $ncpus * 2 ))
+fi
+x () {
+       echo >&2 "$*"
+       "$@"
+}
+x $make -C tests "$@"
+echo all ok.