]>
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 for testcase
in $(run-parts --list $DIR | grep '/test-'); do
40 if [ "$MSGLEVEL" -le 2 ]; then
41 echo -n "${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
43 echo "${CTEST}Run Testcase ${CHIGH}$(basename ${testcase})${CRESET}"
45 if ! ${testcase}; then
47 FAILED_TESTS
="$FAILED_TESTS $(basename $testcase)"
48 echo >&2 "$(basename $testcase) ... FAIL"
53 if [ "$MSGLEVEL" -le 2 ]; then
58 echo >&2 "Statistics: $ALL tests were run: $PASS successfully and $FAIL failed"
59 if [ -n "$FAILED_TESTS" ]; then
60 echo >&2 "Failed tests: $FAILED_TESTS"
62 echo >&2 'All tests seem to have been run successfully. What could possibly go wrong?'
64 # ensure we don't overflow
65 exit $((FAIL <= 255 ? FAIL : 255))