summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-06-14 15:56:09 +0200
committerMartin Pitt <martinpitt@gnome.org>2013-06-20 10:40:46 +0200
commit4099005236ff64aad3cdf7d79bca5d8bd6741cfb (patch)
tree155fb7316f9adc3899e80029a7a4c6dcb952c6c5
parent53f086bdb30a1cc582ed7064bbf69f931b398134 (diff)
gvfs-test: Support calling this in an unbuilt tree
Instead of failing all over the place and complaining about a missing session.conf, run the tests against the installed gvfs.
-rwxr-xr-xtest/gvfs-test10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/gvfs-test b/test/gvfs-test
index e5094d4d..b8882db4 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -1692,7 +1692,6 @@ def start_dbus():
Return temporary XDG home directory.
'''
-
global dbus_daemon
# use temporary config/data/runtime directories; NB that these need to be
@@ -1704,10 +1703,10 @@ def start_dbus():
os.environ['XDG_CONFIG_HOME'] = os.path.join(temp_home, 'config')
os.environ['XDG_DATA_HOME'] = os.path.join(temp_home, 'data')
- # run local D-BUS
if os.path.exists('session.conf'):
dbus_conf = 'session.conf'
else:
+ # for out-of-tree builds
dbus_conf = os.path.join(os.path.dirname(__file__), 'session.conf')
env = os.environ.copy()
env['G_MESSAGES_DEBUG'] = 'all'
@@ -1715,7 +1714,12 @@ def start_dbus():
env['GVFS_SMB_DEBUG'] = '6'
env['GVFS_HTTP_DEBUG'] = 'all'
env['LIBSMB_PROG'] = "nc localhost 1445"
- argv = ['dbus-daemon', '--config-file', dbus_conf, '--print-address=1']
+ # run local D-BUS; if we run this in a built tree, use our config to pick
+ # up the built services, otherwise the standard session one
+ if os.path.exists(dbus_conf):
+ argv = ['dbus-daemon', '--config-file', dbus_conf, '--print-address=1']
+ else:
+ argv = ['dbus-daemon', '--session', '--print-address=1']
if umockdev_testbed:
argv.insert(0, 'umockdev-wrapper')
# Python doesn't catch the setenv() from UMockdev.Testbed.new()