X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b6fea8bbe25e3c0312de72c99b0d49c699d02b7b..e7ebb41440cbe298b07c7fb7c6b20a64a17200f0:/test/integration/run-tests diff --git a/test/integration/run-tests b/test/integration/run-tests index d39daeee5..6c6a37611 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -22,7 +22,7 @@ done export MSGLEVEL="${MSGLEVEL:-3}" if [ "$MSGCOLOR" != 'NO' ]; then - if ! expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null; then + if [ ! -t 1 ]; then # but check that we output to a terminal export MSGCOLOR='NO' fi fi @@ -39,14 +39,18 @@ fi TOTAL="$(run-parts --list $DIR | grep '/test-' | wc -l)" for testcase in $(run-parts --list $DIR | grep '/test-'); do if [ "$MSGLEVEL" -le 2 ]; then - echo -n "($(($ALL+1))/${TOTAL}) ${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: " + printf "($(($ALL+1))/${TOTAL}) ${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: " else - echo "${CTEST}Run Testcase ($(($ALL+1))/${TOTAL}) ${CHIGH}$(basename ${testcase})${CRESET}" + printf "${CTEST}Run Testcase ($(($ALL+1))/${TOTAL}) ${CHIGH}$(basename ${testcase})${CRESET}\n" fi if ! ${testcase}; then FAIL=$((FAIL+1)) FAILED_TESTS="$FAILED_TESTS $(basename $testcase)" - echo >&2 "$(basename $testcase) ... FAIL" + if [ "$MSGLEVEL" -le 2 ]; then + printf >&2 "\n${CHIGH}Running $(basename $testcase) -> FAILED${CRESET}" + else + echo >&2 "${CHIGH}Running $(basename $testcase) -> FAILED${CRESET}" + fi else PASS=$((PASS+1)) fi