summaryrefslogtreecommitdiff
path: root/test/tap-test.sh.in
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2015-03-02 12:36:16 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2015-04-16 13:06:29 +0100
commit4f4801346ef5a32c6b5bafc91383f3bb05c201a6 (patch)
tree13e266c03187eb390185982058fe5abd7a13e115 /test/tap-test.sh.in
parent536c5eb7cb5b8cd23907cee955ec0bfc64769e29 (diff)
downloaddbus-4f4801346ef5a32c6b5bafc91383f3bb05c201a6.tar.gz
Run most tests under the TAP driver, with a simple adaptor for non-TAP tests
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846
Diffstat (limited to 'test/tap-test.sh.in')
-rw-r--r--test/tap-test.sh.in32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/tap-test.sh.in b/test/tap-test.sh.in
new file mode 100644
index 00000000..743cdf39
--- /dev/null
+++ b/test/tap-test.sh.in
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# Wrapper to make an Automake-style test output TAP syntax:
+#
+# - arbitrary stdout/stderr is sent to stderr where it will not be
+# interpreted as TAP
+# - it is treated as a single test-case
+# - exit 77 is a skip
+# - exit 0 is a pass
+# - anything else is a failure
+#
+# Usage: use sed to replace @RUN@ with the shell command-line to be run.
+
+set -e
+
+# we plan to do 1 test-case
+echo "1..1"
+
+e=0
+@RUN@ >&2 || e=$?
+
+case "$e" in
+ (0)
+ echo "ok 1 @RUN@"
+ ;;
+ (77)
+ echo "ok 1 # SKIP @RUN@"
+ ;;
+ (*)
+ echo "not ok 1 @RUN@ (exit status $e)"
+ ;;
+esac