chiark / gitweb /
git-debrebase: merge: test suite: Check wreckage saving
[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 [-p|--progressive] [tests/tests/*]
5
6 set -o pipefail
7
8 while [ $# != 0 ]; do
9         case "$1" in
10         --progressive|-p)       shift; export DGIT_TESTS_PROGRESSIVE=y;;
11         --)                     shift; break ;;
12         -*)     echo >&2 "run-all: unknown option $1"; exit 20 ;;
13         *)                      break ;;
14         esac
15 done
16
17 ncpus=$(nproc || echo 1)
18 jcpus=-j$(( ncpus * 134 / 100 ))
19
20 if [ $# != 0 ]; then
21         set TESTSCRIPTS="$*"
22 fi
23
24 mkdir -p tests/tmp
25
26 ${DGIT_TESTS_PROGRESSIVE+:} rm -f tests/tmp/*.ok
27
28 export DGIT_GNUPG_STUNT_ERRLOG=$( tty -s ||: )
29
30 (
31  set -x
32  exec make $jcpus -k -f tests/Makefile "$@"
33 ) 2>&1 |tee tests/tmp/run-all.log