2003-03-31 Havoc Pennington <hp@redhat.com>
+ * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): allow setting
+ DBUS_TEST_HOMEDIR when tests are enabled, so we can test without
+ having a real home directory available.
+
+2003-03-31 Havoc Pennington <hp@redhat.com>
+
* bus/Makefile.am (install-data-hook): create /var/run/dbus
* bus/messagebus.in: add init script for Red Hat /etc/init.d
## so if adding tests not to be run in make check, don't add them to
## TESTS
if DBUS_BUILD_TESTS
-TESTS_ENVIRONMENT=DBUS_TEST_DATA=$(top_srcdir)/test/data
-TESTS=dbus-test
+TESTS_ENVIRONMENT=DBUS_TEST_DATA=$(top_srcdir)/test/data DBUS_TEST_HOMEDIR=$(top_builddir)/dbus
+TESTS=dbus-test
else
TESTS=
endif
goto failed;
}
+#ifdef DBUS_BUILD_TESTS
+ {
+ const char *override;
+
+ override = _dbus_getenv ("DBUS_TEST_HOMEDIR");
+ if (override != NULL && *override != '\0')
+ {
+ _dbus_string_set_length (&homedir, 0);
+ if (!_dbus_string_append (&homedir, override))
+ _dbus_assert_not_reached ("no memory");
+
+ _dbus_verbose ("Using fake homedir for testing: %s\n",
+ _dbus_string_get_const_data (&homedir));
+ }
+ else
+ {
+ _dbus_warn ("Using your real home directory for testing, set DBUS_TEST_HOMEDIR to avoid\n");
+ }
+ }
+#endif
+
_dbus_assert (username != NULL);
keyring = _dbus_keyring_new ();