]> git.saurik.com Git - apt.git/blobdiff - test/integration/run-tests
test-apt-update-reporting: Make more use of framework
[apt.git] / test / integration / run-tests
index 87cc292d7a083f52ab8044ba37582b5f6bcf0b21..78f24fbaf024e8f52784b80868fc8258f6e1ef75 100755 (executable)
@@ -47,6 +47,8 @@ fi
 if [ -n "$TESTTORUN" ]; then
        # collecting the output of one test to have it together
        OUTPUT="$(mktemp)"
+       CURRENTTRAP="rm -f \"$OUTPUT\"; $CURRENTTRAP"
+       trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
        {
                if [ "$MSGLEVEL" -le 2 ]; then
                        printf "${CTEST}Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}: "
@@ -81,12 +83,13 @@ PASS=0
 ALL=0
 FAILED_TESTS=""
 DIR="$(readlink -f "$(dirname "$0")")"
-TESTLIST="$(run-parts --list "$DIR" --regex '^test-.*$')"
+cd "$DIR"
+TESTLIST="$(find . -mindepth 1 -maxdepth 1 -regex '^\./test-[^/]*$' | sort)"
 if [ -n "$APT_TEST_JOBS" ]; then
        if [ "$MSGCOLOR" != 'NO' ]; then
                export MSGCOLOR='ALWAYS'
        fi
-       exec parallel -j "$APT_TEST_JOBS" "$0" -- $(echo "$TESTLIST")
+       exec parallel -j "$APT_TEST_JOBS" "./$(basename "$0")" -- $(echo "$TESTLIST")
 fi
 TOTAL="$(echo "$TESTLIST" | wc -l)"
 for testcase in $TESTLIST; do