]>
git.saurik.com Git - apt.git/blob - test/integration/run-tests
9 DIR
=$(readlink -f $(dirname $0))
11 if [ "$1" = "-q" ]; then
13 elif [ "$1" = "-v" ]; then
15 elif [ "$1" = '--color=no' ]; then
18 echo >&2 "WARNING: Unknown parameter »$1« will be ignored"
22 export MSGLEVEL
="${MSGLEVEL:-3}"
24 if [ "$MSGCOLOR" != 'NO' ]; then
25 if [ ! -t 1 ]; then # but check that we output to a terminal
29 if [ "$MSGCOLOR" != 'NO' ]; then
39 TOTAL
="$(run-parts --list $DIR | grep '/test-' | wc -l)"
40 for testcase
in $(run-parts --list $DIR | grep '/test-'); do
41 if [ "$MSGLEVEL" -le 2 ]; then
42 printf "($(($ALL+1))/${TOTAL}) ${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
44 printf "${CTEST}Run Testcase ($(($ALL+1))/${TOTAL}) ${CHIGH}$(basename ${testcase})${CRESET}\n"
46 if ! ${testcase}; then
48 FAILED_TESTS
="$FAILED_TESTS $(basename $testcase)"
49 if [ "$MSGLEVEL" -le 2 ]; then
50 printf >&2 "\n${CHIGH}Running $(basename $testcase) -> FAILED${CRESET}"
52 echo >&2 "${CHIGH}Running $(basename $testcase) -> FAILED${CRESET}"
58 if [ "$MSGLEVEL" -le 2 ]; then
63 echo >&2 "Statistics: $ALL tests were run: $PASS successfully and $FAIL failed"
64 if [ -n "$FAILED_TESTS" ]; then
65 echo >&2 "Failed tests: $FAILED_TESTS"
67 echo >&2 'All tests seem to have been run successfully. What could possibly go wrong?'
69 # ensure we don't overflow
70 exit $((FAIL <= 255 ? FAIL : 255))