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