chiark / gitweb /
Testing: New run-all script
[cgi-auth-flexible.git] / tests / run-all
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.