]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
test/dbus-daemon, test/dbus-daemon-eavesdrop: allow external dbus-daemon
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 2 Sep 2013 15:36:46 +0000 (16:36 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Tue, 7 Jan 2014 22:02:18 +0000 (23:02 +0100)
It's easier to automate these tests if they launch their own
dbus-daemon, but easier to debug them if they don't: you can launch
a dbus-daemon separately, under gdb. However, tests that need a
specially-configured dbus-daemon will have to be skipped.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
test/dbus-daemon-eavesdrop.c
test/dbus-daemon.c

index 2c45f54e11f4134e8212a43a1b44b0ada9d9b88b..bc5ba1211802ce8fe27a038ecb8a1457309dca73 100644 (file)
@@ -409,7 +409,14 @@ setup (Fixture *f,
       config = g_strdup ("--session");
     }
 
-  address = spawn_dbus_daemon (dbus_daemon, config, &f->daemon_pid);
+  if (g_getenv ("DBUS_TEST_DAEMON_ADDRESS") != NULL)
+    {
+      address = g_strdup (g_getenv ("DBUS_TEST_DAEMON_ADDRESS"));
+    }
+  else
+    {
+      address = spawn_dbus_daemon (dbus_daemon, config, &f->daemon_pid);
+    }
 
   g_free (dbus_daemon);
   g_free (config);
index 22ea23e3e380663b72e77e22afc23b96fa21de5a..c883425ed94385fb081ac5a5470a84c9fcdc662e 100644 (file)
@@ -194,6 +194,14 @@ setup (Fixture *f,
 
   if (config != NULL && config->config_file != NULL)
     {
+      if (g_getenv ("DBUS_TEST_DAEMON_ADDRESS") != NULL)
+        {
+          g_message ("SKIP: cannot use DBUS_TEST_DAEMON_ADDRESS for "
+              "unusally-configured dbus-daemon");
+          f->skip = TRUE;
+          return;
+        }
+
       if (g_getenv ("DBUS_TEST_DATA") == NULL)
         {
           g_message ("SKIP: set DBUS_TEST_DATA to a directory containing %s",
@@ -227,7 +235,14 @@ setup (Fixture *f,
   if (dbus_daemon == NULL)
     dbus_daemon = g_strdup ("dbus-daemon");
 
-  address = spawn_dbus_daemon (dbus_daemon, arg, &f->daemon_pid);
+  if (g_getenv ("DBUS_TEST_DAEMON_ADDRESS") != NULL)
+    {
+      address = g_strdup (g_getenv ("DBUS_TEST_DAEMON_ADDRESS"));
+    }
+  else
+    {
+      address = spawn_dbus_daemon (dbus_daemon, arg, &f->daemon_pid);
+    }
 
   g_free (dbus_daemon);
   g_free (arg);