summaryrefslogtreecommitdiff
path: root/test/integration/run-tests
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2015-08-18 11:54:05 +0200
committerMichael Vogt <mvo@debian.org>2015-08-18 11:54:05 +0200
commit21248c0f00ee71412dbadc6ebf84011cf974346d (patch)
tree7dc1f5904399482d2128765b5b86d57a4ac5b3e1 /test/integration/run-tests
parente5f34ad3b043abf033c1626eb8449b75955d6760 (diff)
parent4fc6b7570c3e97b65c118b58cdf6729fa94c9b03 (diff)
Merge branch 'debian/experimental' into feature/srv-records
Conflicts: cmdline/apt-helper.cc cmdline/makefile
Diffstat (limited to 'test/integration/run-tests')
-rwxr-xr-xtest/integration/run-tests13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/integration/run-tests b/test/integration/run-tests
index 79d5d1a29..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
@@ -36,16 +36,21 @@ else
CRESET=''
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 "${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
+ printf "($(($ALL+1))/${TOTAL}) ${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
else
- echo "${CTEST}Run Testcase ${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