From e80d6d3093c737b50f301134891c7cf0c15df87c Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Fri, 2 Feb 2018 14:09:10 +0100 Subject: [PATCH] Merge pull request #818 from ailin-nemui/test-tap-backward-compat add backwards compatible code for running tap tests (cherry picked from commit 17aafe974b6251fecff4198d3dd3ab9cf1620b78) --- utils/tap-test | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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