[folks] Run Telepathy test cases under GTestDBus instead of with-session-bus.sh



commit 165e6ff8254476246095c769be59d121d3b6edd1
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Tue Mar 19 12:25:42 2013 +0000

    Run Telepathy test cases under GTestDBus instead of with-session-bus.sh
    
    Bug https://bugzilla.gnome.org/show_bug.cgi?id=690830
    Signed-off-by: Simon McVittie <simon mcvittie collabora co uk>
    Reviewed-by: Philip Withnall <philip tecnocode co uk>

 configure.ac                                    |    1 -
 tests/folks/Makefile.am                         |    8 +---
 tests/lib/telepathy/contactlist/Makefile.am     |    5 +--
 tests/lib/telepathy/contactlist/session.conf.in |   54 -----------------------
 tests/lib/telepathy/test-case.vala              |   20 +++-----
 tests/telepathy/Makefile.am                     |    9 +---
 6 files changed, 14 insertions(+), 83 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index bb89574..d35e0f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -657,7 +657,6 @@ AC_CONFIG_FILES([
     tests/lib/telepathy/Makefile
     tests/lib/tracker/Makefile
     tests/lib/telepathy/contactlist/Makefile
-    tests/lib/telepathy/contactlist/session.conf
     tests/tools/Makefile
     tools/Makefile
     tools/inspect/Makefile
diff --git a/tests/folks/Makefile.am b/tests/folks/Makefile.am
index c680437..ef1ab84 100644
--- a/tests/folks/Makefile.am
+++ b/tests/folks/Makefile.am
@@ -23,8 +23,6 @@ LDADD = \
        $(TP_GLIB_LIBS) \
        $(NULL)
 
-RUN_WITH_PRIVATE_BUS = $(top_srcdir)/tests/tools/with-session-bus.sh
-
 # --disable-warnings is necessary so that we can test deprecated API such as
 # the IndividualAggregator.individuals_changed signal.
 AM_VALAFLAGS += \
@@ -65,14 +63,12 @@ noinst_PROGRAMS = \
        init \
        $(NULL)
 
-SESSION_CONF = $(top_builddir)/tests/lib/telepathy/contactlist/session.conf
 avatar_file= abs_top_srcdir@/tests/data/avatar-01.jpg
 TESTS_ENVIRONMENT = \
        FOLKS_BACKEND_PATH=$(BACKEND_UNINST_PATH) \
        AVATAR_FILE_PATH=$(avatar_file) \
-       $(RUN_WITH_PRIVATE_BUS) \
-       --config-file=$(SESSION_CONF) \
-       --
+       $(top_srcdir)/tests/tools/execute-test.sh \
+       $(NULL)
 
 TESTS = $(noinst_PROGRAMS)
 
diff --git a/tests/lib/telepathy/contactlist/Makefile.am b/tests/lib/telepathy/contactlist/Makefile.am
index 2512900..4c81c07 100644
--- a/tests/lib/telepathy/contactlist/Makefile.am
+++ b/tests/lib/telepathy/contactlist/Makefile.am
@@ -98,9 +98,7 @@ MAINTAINERCLEANFILES = \
        $(introspection_files) \
        $(NULL)
 
-DISTCLEANFILES = \
-       session.conf \
-       $(NULL)
+DISTCLEANFILES =
 
 if NOT_RELEASE
 DISTCLEANFILES += $(dist_noinst_DATA)
@@ -108,7 +106,6 @@ endif
 
 EXTRA_DIST = \
        manager-file.py \
-       session.conf.in \
        tp-test-contactlist.h \
        $(NULL)
 
diff --git a/tests/lib/telepathy/test-case.vala b/tests/lib/telepathy/test-case.vala
index f2b9f10..54343c7 100644
--- a/tests/lib/telepathy/test-case.vala
+++ b/tests/lib/telepathy/test-case.vala
@@ -29,9 +29,6 @@
  *
  * Folks is configured to use the Telepathy backend, with no primary store,
  * unless //use_keyfile_too// is set.
- *
- * FIXME: for now, this relies on being run under with-session-bus.sh
- * with no activatable services.
  */
 public class TpfTest.TestCase : Folks.TestCase
 {
@@ -90,12 +87,6 @@ public class TpfTest.TestCase : Folks.TestCase
    */
   public TestCase (string name)
     {
-      /* This variable is set in the same place as the various variables we
-       * care about for sandboxing purposes, like XDG_CONFIG_HOME and
-       * DBUS_SESSION_BUS_ADDRESS. */
-      if (Environment.get_variable ("FOLKS_TESTS_SANDBOXED_DBUS")
-          != "no-services")
-        error ("Telepathy tests must be run in a private D-Bus session");
 
       base (name);
 
@@ -116,10 +107,15 @@ public class TpfTest.TestCase : Folks.TestCase
       this.create_tp_backend ();
     }
 
-  public override void private_bus_up ()
+  /**
+   * This test does use libdbus, via telepathy-glib.
+   */
+  public override bool uses_dbus_1
     {
-      /* Don't do anything. We're currently relying on
-       * being wrapped in with-session-bus.sh. */
+      get
+        {
+          return true;
+        }
     }
 
   /**
diff --git a/tests/telepathy/Makefile.am b/tests/telepathy/Makefile.am
index aa17a9b..1677984 100644
--- a/tests/telepathy/Makefile.am
+++ b/tests/telepathy/Makefile.am
@@ -28,8 +28,6 @@ LDADD = \
        -L$(top_srcdir)/backends/telepathy/lib \
        $(NULL)
 
-RUN_WITH_PRIVATE_BUS = $(top_srcdir)/tests/tools/with-session-bus.sh
-
 AM_VALAFLAGS += \
        $(ERROR_VALAFLAGS) \
        --vapidir=$(abs_top_srcdir)/tests/lib/telepathy/contactlist/ \
@@ -60,13 +58,12 @@ AM_VALAFLAGS += \
        -g \
        $(NULL)
 
-SESSION_CONF = $(top_builddir)/tests/lib/telepathy/contactlist/session.conf
 TESTS_ENVIRONMENT = \
        FOLKS_BACKEND_PATH=$(BACKEND_UNINST_PATH) \
        FOLKS_BACKEND_KEY_FILE_PATH=$(srcdir)/data/relationships-empty.ini \
-       $(RUN_WITH_PRIVATE_BUS) \
-       --config-file=$(SESSION_CONF) \
-       --
+       $(top_srcdir)/tests/tools/execute-test.sh \
+       $(NULL)
+
 TESTS = \
        persona-store-capabilities \
        individual-retrieval \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]