]> git.saurik.com Git - apt.git/blame_incremental - test/integration/run-tests
* apt-pkg/packagemanager.cc:
[apt.git] / test / integration / run-tests
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4FAIL=0
5DIR=$(readlink -f $(dirname $0))
6if [ "$1" = "-q" ]; then
7 export MSGLEVEL=2
8elif [ "$1" = "-v" ]; then
9 export MSGLEVEL=4
10fi
11
12if expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null; then
13 CTEST='\033[1;32m'
14 CHIGH='\033[1;35m'
15 CRESET='\033[0m'
16elif [ -z "${MSGLEVEL}" ]; then
17 export MSGLEVEL=2
18fi
19
20if [ -z "$MSGLEVEL" ]; then
21 MSGLEVEL=5
22fi
23
24for testcase in $(run-parts --list $DIR | grep '/test-'); do
25 if [ "$MSGLEVEL" -le 2 ]; then
26 echo -n "${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
27 else
28 echo "${CTEST}Run Testcase ${CHIGH}$(basename ${testcase})${CRESET}"
29 fi
30 if ! ${testcase}; then
31 FAIL=$((FAIL+1))
32 echo "$(basename $testcase) ... FAIL"
33 fi
34 if [ "$MSGLEVEL" -le 2 ]; then
35 echo
36 fi
37done
38
39echo "failures: $FAIL"
40exit $FAIL