Commit 732a8bc0 authored by Martin Blanchard's avatar Martin Blanchard

Only require dbus-glib if needed at buildtime

#56
parent 69baa2e6
Pipeline #85176 passed with stage
in 9 minutes and 38 seconds
......@@ -70,7 +70,6 @@ min_eds_version = '3.33.2'
valac = meson.get_compiler('vala')
cc = meson.get_compiler('c')
dbus_glib_dep = dependency('dbus-glib-1') # FIXME: get rid of this when our dependencies stop using dbus-1 (GNOME#696177)
gee_dep = dependency('gee-0.8')
gio_dep = dependency('gio-2.0')
glib_dep = dependency('glib-2.0', version: '>=' + min_glib_version)
......@@ -85,6 +84,7 @@ if docs_enabled
endif
if telepathy_backend_enabled
dbus_glib_dep = dependency('dbus-glib-1') # FIXME: Drop this, see GNOME/folks#24
telepathy_glib_dep = dependency('telepathy-glib', version: '>= 0.19.9')
if zeitgeist_enabled
......
......@@ -11,7 +11,6 @@ libfolks_test_sources = [
libfolks_test_deps = [
build_conf_dep,
dbus_glib_dep,
libfolks_dep,
folks_test_dbus,
posix_dep,
......
telepathy_test_lib_sources = [
'test-case-helper.c',
'test-case.vala',
]
telepathy_test_lib_deps = [
common_test_lib_deps,
dbus_glib_dep,
telepathy_test_contactlist_dep,
telepathy_backendlib_dep,
libkeyfile_test_dep,
......
/* test-case-helper.c
*
* Copyright © 2013 Intel Corporation
* Copyright © 2015 Collabora Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author:
* Simon McVittie <simon.mcvittie@collabora.co.uk>
*/
#include <dbus/dbus.h>
void
_tpf_test_test_case_dbus_1_set_no_exit_on_disconnect (void)
{
DBusConnection *conn = dbus_bus_get (DBUS_BUS_SESSION, NULL);
if (conn != NULL)
{
dbus_connection_set_exit_on_disconnect (conn, FALSE);
dbus_connection_unref (conn);
}
}
......@@ -107,17 +107,6 @@ public class TpfTest.TestCase : Folks.TestCase
this.create_tp_backend ();
}
/**
* This test does use libdbus, via telepathy-glib.
*/
public override bool uses_dbus_1
{
get
{
return true;
}
}
/**
* Virtual method to create the keyfile backend. Currently called by
* the constructor (once per process), but might move into set_up() later.
......@@ -229,6 +218,15 @@ public class TpfTest.TestCase : Folks.TestCase
base.tear_down ();
}
internal extern static void _dbus_1_set_no_exit_on_disconnect ();
public override void final_tear_down ()
{
TestCase._dbus_1_set_no_exit_on_disconnect ();
base.final_tear_down ();
}
}
/**
......
......@@ -25,7 +25,6 @@
#include <glib.h>
#include <glib-object.h>
#include <dbus/dbus.h>
typedef struct {
gpointer self;
......@@ -105,15 +104,3 @@ folks_test_case_add_test_helper (FolksTestCase *self,
folks_test_case_weak_method_test,
folks_test_case_weak_method_teardown);
}
void
_folks_test_case_dbus_1_set_no_exit_on_disconnect (void)
{
DBusConnection *conn = dbus_bus_get (DBUS_BUS_SESSION, NULL);
if (conn != NULL)
{
dbus_connection_set_exit_on_disconnect (conn, FALSE);
dbus_connection_unref (conn);
}
}
......@@ -275,21 +275,6 @@ public abstract class Folks.TestCase : Object
*/
public Folks.TestDBus? test_system_dbus = null;
/**
* If true, libraries involved in this test use dbus-1 (or dbus-glib-1)
* so we need to turn off its exit-on-disconnect feature.
*
* FIXME: when our dependencies stop needing this, this whole feature
* can be removed (GNOME#696177).
*/
public virtual bool uses_dbus_1
{
get
{
return false;
}
}
/**
* Start the temporary D-Bus session.
*
......@@ -381,8 +366,6 @@ public abstract class Folks.TestCase : Object
/* assert (TestUtils.main_context_is_empty ()); */
}
internal extern static void _dbus_1_set_no_exit_on_disconnect ();
/**
* Clean up after all tests. If you have more than one test case, this
* will be called once, the last time only. It should undo the
......@@ -398,9 +381,6 @@ public abstract class Folks.TestCase : Object
{
TestCase.in_final_tear_down = true;
if (this.uses_dbus_1)
TestCase._dbus_1_set_no_exit_on_disconnect ();
/* FIXME: The EDS tests randomly fail due to race conditions in tearing
* down the GTestDBus. So avoid that completely, because I’m sick of not
* being able to release while waiting for a solution to be hammered out
......
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