cmake: Add X11 include path for tools
[platform/upstream/dbus.git] / test / glib-tap-test.sh
1 #!/bin/sh
2 # Wrapper to make GTest tests output TAP syntax, because Automake's test
3 # drivers do not currently support passing the same command-line argument
4 # to each test executable. All GTest tests produce TAP output if invoked
5 # with the --tap option.
6 #
7 # Usage: "glib-tap-test.sh test-foo --verbose ..." is equivalent to
8 # "test-foo --tap --verbose ..."
9
10 set -e
11 t="$1"
12 shift
13
14 case "$t" in
15     (*.exe)
16         # We're running a Windows executable, possibly on a Unix
17         # platform. Avoid having invalid TAP syntax like "ok 3\r\n"
18         # where "ok 3\n" was intended.
19         echo 1 > "$t".exit-status.tmp
20         (
21             set +e
22             "$t" --tap "$@"
23             echo "$?" > "$t".exit-status.tmp
24         ) | sed -e 's/\r$//'
25         e="$(cat "$t".exit-status.tmp)"
26         rm "$t".exit-status.tmp
27         exit "$e"
28         ;;
29
30     (*)
31         exec "$t" --tap "$@"
32         ;;
33 esac