Commit 2e9393ff authored by Havoc Pennington's avatar Havoc Pennington

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.
parent 18c470cd
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
......
......@@ -111,8 +111,8 @@ libdbus_1_la_LDFLAGS= -export-symbols-regex "^[^_].*"
## 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
......
......@@ -711,6 +711,27 @@ _dbus_keyring_new_homedir (const DBusString *username,
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 ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment