summaryrefslogtreecommitdiff
path: root/debian/tests/installed-tests
blob: 0d9f1f6f06b5f69760d963cce2dbd40808408196 (plain)
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
#!/bin/sh
# installed-tests wrapper for dbus. Outputs TAP format because why not

set -e

multiarch="`dpkg-architecture -qDEB_HOST_MULTIARCH`"

ret=0
i=0

for dir in "/usr/lib/$multiarch/dbus-1.0/test" "/usr/lib/$multiarch/dbus-1.0/debug-build/lib/dbus-1.0/test"; do
    for t in "$dir"/test-*; do
        i=$(( $i + 1 ))
        echo "# $i - $t ..."
        echo "x" > "$ADTTMP/result"
        ( set +e; $t; echo "$?" > "$ADTTMP/result" ) 2>&1 | sed 's/^/# /'
        e="$(cat "$ADTTMP/result")"
        case "$e" in
            (0)
                echo "ok $i - $t"
                ;;
            (77)
                echo "ok $i # SKIP $t"
                ;;
            (*)
                echo "not ok $i - $t ($e)"
                ret=1
                ;;
        esac
    done
done

exit $ret