File: runner

package info (click to toggle)
rt-extension-commandbymail 3.01-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 440 kB
  • sloc: perl: 3,935; sh: 69; makefile: 33
file content (41 lines) | stat: -rwxr-xr-x 811 bytes parent folder | download | duplicates (9)
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
40
41
#!/bin/sh

#set -x

BASE=debian/tests/pkg-perl/tests

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