chiark / gitweb /
3e40369eeb601900f329e4d14457c362c30160d3
[dgit.git] / tests / run-all
1 #!/bin/bash
2 set -e
3 # convenience script for running the tests outside adt-run
4 # usage: tests/using-intree tests/run-all [tests/tests/*]
5
6 set -o pipefail
7
8 while [ $# != 0 ]; do
9         case "$1" in
10         --)                     shift; break ;;
11         -*)     echo >&2 "run-all: unknown option $1"; exit 20 ;;
12         *)                      break ;;
13         esac
14 done
15
16 ncpus=$(nproc || echo 1)
17 jcpus=-j$(( ncpus * 134 / 100 ))
18
19 if [ $# != 0 ]; then
20         set TESTSCRIPTS="$*"
21 fi
22
23 mkdir -p tests/tmp
24
25 export DGIT_GNUPG_STUNT_ERRLOG=$( tty -s ||: )
26
27 (
28  set -x
29  exec make $jcpus -k -f tests/Makefile "$@"
30 ) 2>&1 |tee tests/tmp/run-all.log