]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
* tools/dbus-launch.c (main): run the dbus-daemon in the builddir
authorJohn (J5) Palmieri <johnp@redhat.com>
Thu, 26 Oct 2006 15:55:44 +0000 (15:55 +0000)
committerJohn (J5) Palmieri <johnp@redhat.com>
Thu, 26 Oct 2006 15:55:44 +0000 (15:55 +0000)
  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

ChangeLog
configure.in
tools/dbus-launch.c
tools/run-with-tmp-session-bus.sh

index 2f238ced3b5456216707666d001a7b2bc1771520..2722f329639dad8ed748680b78161ec4607c17a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-10-26  John (J5) Palmieri  <johnp@redhat.com>
+
+       * 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 
+
 2006-10-25  Sjoerd Simons  <sjoerd@luon.net>
 
        * dbus/Makefile.am:
index 0a5fdbb4fd4bfd2c53c87a901b68dc635c9338de..9efd8178c97af74270467c928ecf7d245bc30471 100644 (file)
@@ -1138,6 +1138,10 @@ TEST_PATH(EXIT_BINARY, test-exit)
 TEST_PATH(SEGFAULT_BINARY, test-segfault)
 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
 
+AC_DEFINE_UNQUOTED(TEST_BUS_BINARY, "$DBUS_PWD/bus/dbus-daemon",
+                   [Full path to the daemon in the builddir])
+AC_SUBST(TEST_BUS_BINARY)
+
 #### Find socket directories
 if ! test -z "$TMPDIR" ; then
    DEFAULT_SOCKET_DIR=$TMPDIR
index 7838fd8e7a68416d16c84fbeef632b6259fe0abc..7e53e7e2aa9ca6e75bfabf0657d8bb1a7a97f778 100644 (file)
@@ -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",
index b72a56a534644f13a0d7454efe34c2a2f5c07a9c..3ef3b39eeef0416826a63a3843833373bef737ba 100755 (executable)
@@ -47,6 +47,7 @@ unset DBUS_SESSION_BUS_PID
 
 echo "Running $DBUS_TOP_BUILDDIR/tools/dbus-launch --sh-syntax --config-file=$CONFIG_FILE" >&2
 
+export DBUS_USE_TEST_BINARY=1 
 eval `$DBUS_TOP_BUILDDIR/tools/dbus-launch --sh-syntax --config-file=$CONFIG_FILE`
 
 if test -z "$DBUS_SESSION_BUS_PID" ; then