diff options
author | Martin Pitt <martinpitt@gnome.org> | 2012-11-28 09:55:50 +0100 |
---|---|---|
committer | Martin Pitt <martinpitt@gnome.org> | 2012-11-29 14:47:18 +0100 |
commit | b1e7b70aa4db582743637fef4b2a00f19787d46f (patch) | |
tree | 2f00c713c1a2715e16ceeaec39f157b235f70eac /test/run-in-tree.sh | |
parent | 46b4898edc221eff6e1caffae894fc5a6f8d42ed (diff) | |
download | gvfs-b1e7b70aa4db582743637fef4b2a00f19787d46f.tar.gz |
gvfs-test: Move temporary D-BUS setup from run-in-tree.sh
For adding further tests such as for trash://, we want to be able to use a
temporary private $XDG_DATA_HOME, and also ensure that we do not touch the
user's configuration in any way by setting a temporary $XDG_CONFIG_HOME as
well. (The latter needs to be in the actual $HOME until
https://bugzilla.gnome.org/show_bug.cgi?id=142568 gets fixed)
To achieve this, set up the temporary session D-BUS in gvfs-test itself (so
that it sees our new XDG environment variables), and stop setting up a session
D-BUS in run-in-tree.sh when running under make. Retain the funtionality in
run-in-tree.sh for calling the script manually.
This also allows us to capture the output of the D-BUS daemon and its attached
processes. Show its stdout and stderr on test case failures for easier
debugging, and enable general GLib and gvfs debug messages.
In addition this simplifies the handling of $LIBSMB_PROG, as we can now set it
in the test suite and can stop setting it in the Makefile.
Diffstat (limited to 'test/run-in-tree.sh')
-rwxr-xr-x | test/run-in-tree.sh | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/test/run-in-tree.sh b/test/run-in-tree.sh index db39446f..8498a52f 100755 --- a/test/run-in-tree.sh +++ b/test/run-in-tree.sh @@ -12,21 +12,24 @@ export GVFS_MONITOR_DIR=`pwd` export PATH=`pwd`/../programs:$PATH export GIO_EXTRA_MODULES=`pwd`/../client/.libs:`pwd`/../monitor/proxy/.libs -if [ -e $(pwd)/session.conf ]; then - # case for out-of tree build (distcheck) - DBUS_CONF=`pwd`/session.conf -else - # case for calling this manually in a built tree - DBUS_CONF=`dirname $0`/session.conf -fi +# Start a custom session dbus, unless we run under "make check" (test suite +# starts its own) +if [ -z "$MAKEFLAGS" ]; then + if [ -e $(pwd)/session.conf ]; then + # case for out-of tree build (distcheck) + DBUS_CONF=`pwd`/session.conf + else + # case for calling this manually in a built tree + DBUS_CONF=`dirname $0`/session.conf + fi -# Start a custom session dbus -PIDFILE=`mktemp` -export DBUS_SESSION_BUS_ADDRESS=`dbus-daemon --config-file=$DBUS_CONF --fork --print-address=1 --print-pid=3 3>${PIDFILE}` -DBUS_SESSION_BUS_PID=`cat $PIDFILE` -rm $PIDFILE + PIDFILE=`mktemp` + export DBUS_SESSION_BUS_ADDRESS=`dbus-daemon --config-file=$DBUS_CONF --fork --print-address=1 --print-pid=3 3>${PIDFILE}` + DBUS_SESSION_BUS_PID=`cat $PIDFILE` + rm $PIDFILE -trap "kill -9 $DBUS_SESSION_BUS_PID" SIGINT SIGTERM EXIT + trap "kill -9 $DBUS_SESSION_BUS_PID" SIGINT SIGTERM EXIT +fi $@ |