* configure.in: Add test/name-test/Makefile to the generated
[platform/upstream/dbus.git] / test / name-test / run-test.sh
1 #! /bin/bash
2
3 function die()
4 {
5     if ! test -z "$DBUS_SESSION_BUS_PID" ; then
6         echo "killing message bus "$DBUS_SESSION_BUS_PID >&2
7         kill -9 $DBUS_SESSION_BUS_PID
8     fi
9     echo $SCRIPTNAME: $* >&2
10
11     rm $DBUS_TOP_BUILDDIR/python/dbus
12  
13     exit 1
14 }
15
16
17 SCRIPTNAME=$0
18 MODE=$1
19
20 ## so the tests can complain if you fail to use the script to launch them
21 export DBUS_TEST_NAME_RUN_TEST_SCRIPT=1
22
23 # Rerun ourselves with tmp session bus if we're not already
24 if test -z "$DBUS_TEST_NAME_IN_RUN_TEST"; then
25   DBUS_TEST_NAME_IN_RUN_TEST=1
26   export DBUS_TEST_NAME_IN_RUN_TEST
27   exec $DBUS_TOP_BUILDDIR/tools/run-with-tmp-session-bus.sh $SCRIPTNAME $MODE
28 fi 
29 echo "running test-names"
30 libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/name-test/test-names || die "test-client failed"