diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-03-21 18:40:16 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-06-10 18:32:06 +0100 |
commit | ae5524d632c5cccb73f1f386b5c1d41b73861445 (patch) | |
tree | ee3b33d30692b975da0687b86ccce9b4c57980ec /test | |
parent | ba9c274f33eaa6c642a2e63f8191c483fcd941b9 (diff) | |
download | dbus-ae5524d632c5cccb73f1f386b5c1d41b73861445.tar.gz |
dbus-daemon test: sanity-check the just-installed config file when using DESTDIR
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 4 | ||||
-rw-r--r-- | test/dbus-daemon.c | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 97b080cb..bb57226d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -81,7 +81,9 @@ installcheck_tests = installcheck_environment = \ DBUS_TEST_DAEMON=$(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT) \ DBUS_TEST_DATA=@abs_top_builddir@/test/data \ - DBUS_TEST_USE_INSTALLED=1 + DBUS_TEST_USE_INSTALLED=1 \ + DBUS_TEST_SYSCONFDIR=$(sysconfdir) \ + DESTDIR=$(DESTDIR) TESTS_ENVIRONMENT = \ DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \ diff --git a/test/dbus-daemon.c b/test/dbus-daemon.c index 04955e03..d2d5246a 100644 --- a/test/dbus-daemon.c +++ b/test/dbus-daemon.c @@ -184,7 +184,17 @@ setup (Fixture *f, if (g_getenv ("DBUS_TEST_USE_INSTALLED") != NULL) { - config = g_strdup ("--session"); + /* we strdup this because it might be clobbered by a subsequent + * g_getenv */ + gchar *destdir = g_strdup (g_getenv ("DESTDIR")); + + if (destdir != NULL && *destdir != '\0') + config = g_strdup_printf ("--config-file=%s%s/dbus-1/session.conf", + destdir, g_getenv ("DBUS_TEST_SYSCONFDIR")); + else + config = g_strdup ("--session"); + + g_free (destdir); } else { |