runner 1.2 KB
Newer Older
1 2
#!/bin/sh

3
BASE=/usr/share/pkg-perl-autopkgtest
4 5 6 7 8 9 10

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

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

11
LLSOURCEDIR=`pwd`
12

13 14 15 16
LIST=$2

test "$LIST" == "" 2>/dev/null && LIST=lemonldap-ng-*

17
EXITCODE=0
18
for LLLIB in $LIST; do
19 20 21 22 23 24 25 26 27 28 29 30 31
    mkdir -p $LLSOURCEDIR/$LLLIB/debian/tests/pkg-perl
    for llfile in debian/tests/pkg-perl/${LLLIB}*; do
        if [ -r $llfile ]; then
            dest=${llfile#*$LLLIB.}
            cp -v $llfile $LLSOURCEDIR/$LLLIB/debian/tests/pkg-perl/$dest
        fi
    done
    cd $LLSOURCEDIR/$LLLIB

    SKIPLIST=debian/tests/pkg-perl/SKIP
    SKIPTMP=$(mktemp)
    if [ -f "$SKIPLIST" ]; then
        grep -v '^ *#' "$SKIPLIST" |grep -v '^ *$' > "$SKIPTMP"
32
    fi
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
    
    for T in $(run-parts --list --regex '(^[a-z0-9.]+$)' ${TESTDIR} | \
               grep -v -F -f "$SKIPTMP") ; 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

    cd $LLSOURCEDIR
    rm -rf $LLSOURCEDIR/$LLLIB/debian
50 51 52
done
rm -f "$SKIPTMP"
exit $EXITCODE