6 ## so the tests can complain if you fail to use the script to launch them
7 DBUS_TEST_NAME_RUN_TEST_SCRIPT=1
8 export DBUS_TEST_NAME_RUN_TEST_SCRIPT
10 # Rerun ourselves with tmp session bus if we're not already
11 if test -z "$DBUS_TEST_NAME_IN_RUN_TEST"; then
12 DBUS_TEST_NAME_IN_RUN_TEST=1
13 export DBUS_TEST_NAME_IN_RUN_TEST
14 exec $DBUS_TOP_SRCDIR/tools/run-with-tmp-session-bus.sh $SCRIPTNAME $MODE
17 if test -n "$DBUS_TEST_MONITOR"; then
18 dbus-monitor --session >&2 &
21 XDG_RUNTIME_DIR="$DBUS_TOP_BUILDDIR"/test/XDG_RUNTIME_DIR
22 test -d "$XDG_RUNTIME_DIR" || mkdir "$XDG_RUNTIME_DIR"
23 chmod 0700 "$XDG_RUNTIME_DIR"
24 export XDG_RUNTIME_DIR
26 # Translate a command and exit status into TAP syntax.
27 # Usage: interpret_result $? description-of-test
28 # Uses global variable $test_num.
34 echo "ok $test_num $*"
37 echo "ok $test_num # SKIP $*"
40 echo "not ok $test_num $*"
43 test_num=$(( $test_num + 1 ))
50 echo "# running test $t"
51 "${DBUS_TOP_BUILDDIR}/libtool" --mode=execute $DEBUG "$DBUS_TOP_BUILDDIR/test/name-test/$t" "$@" >&2 || e=$?
52 echo "# exit status $e"
53 interpret_result "$e" "$t" "$@"
59 if test "x$PYTHON" = "x:"; then
60 interpret_result 77 "$t" "(Python interpreter not found)"
63 echo "# running test $t"
64 $PYTHON "$DBUS_TOP_SRCDIR/test/name-test/$t" "$@" >&2 || e=$?
65 interpret_result "$e" "$t" "$@"
70 # TAP test plan: we will run 2 tests
73 py_test test-activation-forking.py
74 c_test test-autolaunch