diff options
author | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2018-01-18 12:02:29 +0100 |
---|---|---|
committer | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2018-01-18 12:13:23 +0100 |
commit | 5bae9a94c83b8ce21e21b18963db1aa43807c932 (patch) | |
tree | 8aef09990d602c1c773bb63780a615936a68d0ea /utils | |
parent | 243ae4be84d422322f20be1b715dc0b00ef9c32d (diff) | |
download | irssi-5bae9a94c83b8ce21e21b18963db1aa43807c932.zip |
add backwards compatible code for running tap tests
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/tap-test | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/utils/tap-test b/utils/tap-test index 481e333e..b3ef8b04 100755 --- a/utils/tap-test +++ b/utils/tap-test @@ -2,4 +2,22 @@ # run a GTest in tap mode. The test binary is passed as $1 -$1 -k --tap +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 |