diff options
author | John (J5) Palmieri <johnp@redhat.com> | 2006-10-26 15:55:44 +0000 |
---|---|---|
committer | John (J5) Palmieri <johnp@redhat.com> | 2006-10-26 15:55:44 +0000 |
commit | a107da84891f941d591bcaa99641f4058f089c7d (patch) | |
tree | bbf7d763a721c2e134a51a3262ff8437d18bde9e /tools/dbus-launch.c | |
parent | 36608068cf84eca2a0e074fe6b1c416a4a8a2b08 (diff) |
* tools/dbus-launch.c (main): run the dbus-daemon in the builddir
if tests are enabled and the DBUS_USE_TEST_BINARY env variable is set
* tools/run-with-tmp-session-bus.sh: set DBUS_USE_TEST_BINARY
before we run dbus-launch
* configure.in: define TEST_BUS_BINARY to be the full path to
dbus-daemon in the build root
Diffstat (limited to 'tools/dbus-launch.c')
-rw-r--r-- | tools/dbus-launch.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tools/dbus-launch.c b/tools/dbus-launch.c index 7838fd8e..7e53e7e2 100644 --- a/tools/dbus-launch.c +++ b/tools/dbus-launch.c @@ -886,7 +886,26 @@ main (int argc, char **argv) "%d", bus_address_to_launcher_pipe[WRITE_END]); verbose ("Calling exec()\n"); - + +#ifdef DBUS_BUILD_TESTS + /* exec from testdir */ + if (getenv("DBUS_USE_TEST_BINARY") != NULL) + { + execl (TEST_BUS_BINARY, + TEST_BUS_BINARY, + "--fork", + "--print-pid", write_pid_fd_as_string, + "--print-address", write_address_fd_as_string, + config_file ? "--config-file" : "--session", + config_file, /* has to be last in this varargs list */ + NULL); + + fprintf (stderr, + "Failed to execute test message bus daemon %s: %s. Will try again with the system path.\n", + TEST_BUS_BINARY, strerror (errno)); + } + #endif /* DBUS_BUILD_TESTS */ + execl (DBUS_DAEMONDIR"/dbus-daemon", DBUS_DAEMONDIR"/dbus-daemon", "--fork", |