]>
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 ! expr match
"$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev
/null
; then
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 echo -n "${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
44 echo "${CTEST}Run Testcase ($(($ALL+1))/${TOTAL}) ${CHIGH}$(basename ${testcase})${CRESET}"
46 if ! ${testcase}; then
48 FAILED_TESTS
="$FAILED_TESTS $(basename $testcase)"
49 echo >&2 "$(basename $testcase) ... FAIL"
54 if [ "$MSGLEVEL" -le 2 ]; then
59 echo >&2 "Statistics: $ALL tests were run: $PASS successfully and $FAIL failed"
60 if [ -n "$FAILED_TESTS" ]; then
61 echo >&2 "Failed tests: $FAILED_TESTS"
63 echo >&2 'All tests seem to have been run successfully. What could possibly go wrong?'
65 # ensure we don't overflow
66 exit $((FAIL <= 255 ? FAIL : 255))