Add GTestDBus object

This is a helper to write unit tests using a private dbus-daemon.

session_bus_up/down() are now just wrappers around a GTestDBus singleton.

https://bugzilla.gnome.org/show_bug.cgi?id=672985
This commit is contained in:
Xavier Claessens
2012-04-18 08:50:07 +02:00
committed by David Zeuthen
parent f8a8e90398
commit 1b5f70b5b0
30 changed files with 838 additions and 469 deletions

View File

@@ -205,11 +205,6 @@ test_proxy (void)
session_bus_up ();
/* TODO: wait a bit for the bus to come up.. ideally session_bus_up() won't return
* until one can connect to the bus but that's not how things work right now
*/
usleep (500 * 1000);
loop = g_main_loop_new (NULL, TRUE);
connection = g_bus_get_sync (G_BUS_TYPE_SESSION,
@@ -240,12 +235,11 @@ int
main (int argc,
char *argv[])
{
g_unsetenv ("DISPLAY");
g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE);
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_dbus_unset ();
g_test_add_func ("/gdbus/proxy/vs-threads", test_proxy);
return g_test_run();