summaryrefslogtreecommitdiff
path: root/utils/tap-test
blob: b3ef8b0486812cdd5c4fb969d999f9c48b2635f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/sh

# run a GTest in tap mode. The test binary is passed as $1

t="$1"; shift
if ${PKG_CONFIG:-pkg-config} --atleast-version 2.40 glib-2.0; then
exec "$t" -k --tap "$@"
else # GTest does not support tap yet
    (((("$t" "$@"; echo $? >&3) | ${AM_TAP_AWK:-awk} '
{
    if (/: /) {
        i++
        ok = /: OK/
        sub(/:/, " #")
        print (ok ? "ok " : "not ok ") i " " $0
    } else {
        print "# " $0
    }
} END {
    print 1 ".." i
}
' >&4) 3>&1) | (read xs; exit $xs)) 4>&1
fi