summaryrefslogtreecommitdiff
path: root/tools/dbus-launch.c
diff options
context:
space:
mode:
authorChengwei Yang <chengwei.yang@intel.com>2013-09-13 16:56:26 +0800
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-13 14:29:45 +0100
commitee0f28f6a575337fe6d0571f5935f82a601c37c9 (patch)
tree7d2bd64649ef210648f04c96d5985ec9c97a5a8d /tools/dbus-launch.c
parent2cf320fc82593fd1b3c71688f770e443366780ec (diff)
downloaddbus-ee0f28f6a575337fe6d0571f5935f82a601c37c9.tar.gz
Use test binaries in build dir to do test
When do autolaunch testing, libdbus will try to start dbus-launch in installed direcotry, if fail then fall back to dbus-launch in $PATH. dbus-launch does a relative better thing to start dbus-daemon in build directory, however, in most of case, the build $prefix is different from the real prefix where dbus-daemon installed. So dbus-daemon will fail to start due to can't find its config file. And then dbus-launch will fall back to finally the installed dbus-daemon. This patch fix this behavior and will start dbus-launch and dbus-daemon in build directory in test environment. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37849
Diffstat (limited to 'tools/dbus-launch.c')
-rw-r--r--tools/dbus-launch.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/dbus-launch.c b/tools/dbus-launch.c
index 15249759..14fa226d 100644
--- a/tools/dbus-launch.c
+++ b/tools/dbus-launch.c
@@ -1110,8 +1110,16 @@ main (int argc, char **argv)
#ifdef DBUS_ENABLE_EMBEDDED_TESTS
/* exec from testdir */
- if (getenv("DBUS_USE_TEST_BINARY") != NULL)
+ if (getenv ("DBUS_USE_TEST_BINARY") != NULL)
{
+ if (config_file == NULL && getenv ("DBUS_TEST_DATA") != NULL)
+ {
+ ret = asprintf (&config_file, "%s/valid-config-files/session.conf",
+ getenv ("DBUS_TEST_DATA"));
+ }
+ if (ret == -1 && config_file != NULL)
+ free (config_file);
+
execl (TEST_BUS_BINARY,
TEST_BUS_BINARY,
"--fork",