aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-03-27 15:11:33 -0500
committerTed Gould <ted@gould.cx>2012-03-27 15:11:33 -0500
commitef80236d7f7f501eb9bfef9f5de2d914d4db534f (patch)
tree20b68d1af5a75f9888915f520f845fc1f3b4bf06 /tests
parent4dd014ca94bd0a47cece8fcc1cf978431adc2888 (diff)
downloadlibdbusmenu-ef80236d7f7f501eb9bfef9f5de2d914d4db534f.tar.gz
libdbusmenu-ef80236d7f7f501eb9bfef9f5de2d914d4db534f.tar.bz2
libdbusmenu-ef80236d7f7f501eb9bfef9f5de2d914d4db534f.zip
Using the new --wait-for attribute of dbus-test-runner
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/test-json-client.c21
2 files changed, 3 insertions, 20 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6824c1c..16f00c5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -208,7 +208,7 @@ test-json: test-json-client test-json-server Makefile.am
@echo export UBUNTU_MENUPROXY="" >> $@
@echo export G_DEBUG=fatal_criticals >> $@
@echo $(XVFB_RUN) >> $@
- @echo $(DBUS_RUNNER) --task ./test-json-client --task-name Client --parameter $(top_builddir)/tools/dbusmenu-dumper --parameter test-json-01.output.json --ignore-return --task ./test-json-server --task-name Server --parameter $(srcdir)/test-json-01.json --ignore-return >> $@
+ @echo $(DBUS_RUNNER) --task ./test-json-client --wait-for org.dbusmenu.test --task-name Client --parameter $(top_builddir)/tools/dbusmenu-dumper --parameter test-json-01.output.json --ignore-return --task ./test-json-server --task-name Server --parameter $(srcdir)/test-json-01.json --ignore-return >> $@
@echo diff $(srcdir)/test-json-01.json test-json-01.output.json \> /dev/null >> $@
@chmod +x $@
diff --git a/tests/test-json-client.c b/tests/test-json-client.c
index d4e782b..55d2ede 100644
--- a/tests/test-json-client.c
+++ b/tests/test-json-client.c
@@ -27,14 +27,6 @@ GMainLoop * mainloop = NULL;
gboolean
timeout_func (gpointer user_data)
{
- g_warning("Timeout without getting name");
- g_main_loop_quit(mainloop);
- return FALSE;
-}
-
-void
-name_appeared (GDBusConnection * connection, const gchar * name, const gchar * owner, gpointer user_data)
-{
char ** argv = (char **)user_data;
g_usleep(500000);
@@ -53,24 +45,15 @@ name_appeared (GDBusConnection * connection, const gchar * name, const gchar * o
}
g_main_loop_quit(mainloop);
- return;
+ return TRUE;
}
int
main (int argc, char ** argv)
{
g_type_init();
- g_debug("Wait for friends");
-
- g_bus_watch_name(G_BUS_TYPE_SESSION,
- "org.dbusmenu.test",
- G_BUS_NAME_WATCHER_FLAGS_NONE,
- name_appeared,
- NULL,
- argv,
- NULL);
- g_timeout_add_seconds(2, timeout_func, NULL);
+ g_timeout_add_seconds(2, timeout_func, argv);
mainloop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(mainloop);