File: runner

package info (click to toggle)
pkg-perl-tools 0.85
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 796 kB
  • sloc: perl: 3,254; sh: 3,244; makefile: 144; python: 18
file content (39 lines) | stat: -rwxr-xr-x 806 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

BASE=/usr/share/pkg-perl-autopkgtest

TYPE=$1
[ -n "$TYPE" ] || exit 1

TESTDIR=${BASE}/${TYPE}.d
[ -d "$TESTDIR" ] || exit 1

SKIPLIST=debian/tests/pkg-perl/SKIP
SKIPTMP=$(mktemp)
if [ -f "$SKIPLIST" ]; then
    grep -v '^ *#' "$SKIPLIST" |grep -v '^ *$' > "$SKIPTMP"
fi

EXITCODE=0
LIST=$(run-parts --list --regex '(^[a-z0-9.]+$)' ${TESTDIR} | \
       grep -v -F -f "$SKIPTMP")

# If no test is launched, exit with code 77 (== skip)
if test "$LIST" = ""; then
    echo "Test skipped"
    exit 77
fi
for T in $LIST; do
    if echo "$T" | grep -q '\.t$'
    then
        prove --norc -v "$T"
        RET=$?
        if [ $EXITCODE = 0 ]; then EXITCODE=$RET; fi
    else
        "$T"
        RET=$?
        if [ $EXITCODE = 0 ]; then EXITCODE=$RET; fi
    fi
done
rm -f "$SKIPTMP"
exit $EXITCODE