diff options
author | Martin Pitt <martinpitt@gnome.org> | 2013-06-14 15:56:09 +0200 |
---|---|---|
committer | Martin Pitt <martinpitt@gnome.org> | 2013-06-20 10:40:46 +0200 |
commit | 4099005236ff64aad3cdf7d79bca5d8bd6741cfb (patch) | |
tree | 155fb7316f9adc3899e80029a7a4c6dcb952c6c5 /test | |
parent | 53f086bdb30a1cc582ed7064bbf69f931b398134 (diff) | |
download | gvfs-4099005236ff64aad3cdf7d79bca5d8bd6741cfb.tar.gz |
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.
Diffstat (limited to 'test')
-rwxr-xr-x | test/gvfs-test | 10 |
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() |