summaryrefslogtreecommitdiffstats
path: root/utils/tap-test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:18:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:18:39 +0000
commitfff5217f02d91268ce90c8c05665602c059faaef (patch)
tree2ba24d32dc96eafe7ed0a85269548e76796d849d /utils/tap-test
parentInitial commit. (diff)
downloadirssi-fff5217f02d91268ce90c8c05665602c059faaef.tar.xz
irssi-fff5217f02d91268ce90c8c05665602c059faaef.zip
Adding upstream version 1.4.5.upstream/1.4.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xutils/tap-test23
1 files changed, 23 insertions, 0 deletions
diff --git a/utils/tap-test b/utils/tap-test
new file mode 100755
index 0000000..b3ef8b0
--- /dev/null
+++ b/utils/tap-test
@@ -0,0 +1,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