summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-02 16:36:46 +0100
committerRalf Habacker <ralf.habacker@freenet.de>2013-10-26 10:06:26 +0200
commit6a7942f29cd92ec5162e5cc6fbb566101a280184 (patch)
tree7f9c99b89c54b1ed16595dae22db99c6317a0745
parentdb8a1b053c9e7eb79e0b1235e5ed8916c3473606 (diff)
downloaddbus-6a7942f29cd92ec5162e5cc6fbb566101a280184.tar.gz
test/dbus-daemon, test/dbus-daemon-eavesdrop: allow external dbus-daemon
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.
-rw-r--r--test/dbus-daemon-eavesdrop.c9
-rw-r--r--test/dbus-daemon.c17
2 files changed, 24 insertions, 2 deletions
diff --git a/test/dbus-daemon-eavesdrop.c b/test/dbus-daemon-eavesdrop.c
index 2c45f54e..bc5ba121 100644
--- a/test/dbus-daemon-eavesdrop.c
+++ b/test/dbus-daemon-eavesdrop.c
@@ -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);
diff --git a/test/dbus-daemon.c b/test/dbus-daemon.c
index 22ea23e3..c883425e 100644
--- a/test/dbus-daemon.c
+++ b/test/dbus-daemon.c
@@ -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);