]> git.saurik.com Git - apt.git/blobdiff - test/integration/run-tests
Use _apt as our unprivileged user name
[apt.git] / test / integration / run-tests
index d39daeee59d8c24543206bac9b35693d97945c68..c39a2ac68a16bef50d93a791c53e9dbd1aeed1d8 100755 (executable)
@@ -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,9 +39,9 @@ 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))