Commit 6a57bf12 authored by Matthias Clasen's avatar Matthias Clasen

Make the dbus menu tests independent from the session bus

With this change,
DBUS_SESSION_BUS_ADDRESS= make check
succeed here.
parent d036960d
......@@ -433,6 +433,7 @@ gapplication_example_cmdline3_LDADD = $(progs_ldadd)
gapplication_example_actions_SOURCES = gapplication-example-actions.c
gapplication_example_actions_LDADD = $(progs_ldadd)
gmenumodel_SOURCES = gmenumodel.c gdbus-sessionbus.h gdbus-sessionbus.c
gmenumodel_LDADD = $(progs_ldadd)
schema_tests = \
......
#include <gio/gio.h>
#include "gdbus-sessionbus.h"
/* Markup printing {{{1 */
/* This used to be part of GLib, but it was removed before the stable
......@@ -1019,10 +1021,16 @@ test_mutable (void)
int
main (int argc, char **argv)
{
g_test_init (&argc, &argv, NULL);
gboolean ret;
g_test_init (&argc, &argv, NULL);
g_type_init ();
g_unsetenv ("DISPLAY");
g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE);
session_bus_up ();
g_test_add_func ("/gmenu/equality", test_equality);
g_test_add_func ("/gmenu/random", test_random);
g_test_add_func ("/gmenu/dbus/roundtrip", test_dbus_roundtrip);
......@@ -1032,6 +1040,10 @@ main (int argc, char **argv)
g_test_add_func ("/gmenu/links", test_links);
g_test_add_func ("/gmenu/mutable", test_mutable);
return g_test_run ();
ret = g_test_run ();
session_bus_down ();
return ret;
}
/* vim:set foldmethod=marker: */
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