Add a test case for the various options to get_args_list.
[dbus-python-phuang.git] / test / run-test.sh
blobd592309e180c37f8c93e73e9e385a3964145ee02
1 #! /bin/bash
3 function die()
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
11 exit 1
15 SCRIPTNAME=$0
16 MODE=$1
18 #create service file
19 SERVICE_DIR=test/data/valid-service-files/
20 SERVICE_FILE=$SERVICE_DIR/test-python.service
21 mkdir -p $SERVICE_DIR
22 echo "[D-BUS Service]" > $SERVICE_FILE
23 echo "Name=org.freedesktop.DBus.TestSuitePythonService" >> $SERVICE_FILE
24 echo "Exec=`pwd`/test/test-service.py" >> $SERVICE_FILE
26 ## so the tests can complain if you fail to use the script to launch them
27 export DBUS_TEST_PYTHON_RUN_TEST_SCRIPT=1
28 export LD_LIBRARY_PATH="$DBUS_TOP_BUILDDIR/dbus"
29 # Rerun ourselves with tmp session bus if we're not already
30 if test -z "$DBUS_TEST_PYTHON_IN_RUN_TEST"; then
31 DBUS_TEST_PYTHON_IN_RUN_TEST=1
32 export DBUS_TEST_PYTHON_IN_RUN_TEST
33 exec tools/run-with-tmp-session-bus.sh $SCRIPTNAME $MODE
34 fi
35 echo "running test-standalone.py"
36 test/test-standalone.py || die "test-standalone.py failed"
37 echo "running test-client.py"
38 test/test-client.py || die "test-client.py failed"