[folks] tests: limit backends via the environment a bit more directly
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] tests: limit backends via the environment a bit more directly
- Date: Mon, 18 Mar 2013 19:21:54 +0000 (UTC)
commit e4de6c5f6dd4eb66a7519afe2d60166c0cb7f0a7
Author: Simon McVittie <simon mcvittie collabora co uk>
Date: Thu Mar 14 15:48:26 2013 +0000
tests: limit backends via the environment a bit more directly
This makes it more obvious what's enabled and what isn't. We want to
make sure that only the intended backends are enabled, because those
are the ones for which we've done enough environmental setup
(D-Bus, etc.) to make sure they don't "leak out" into the user's
real data.
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=695381
Signed-off-by: Simon McVittie <simon mcvittie collabora co uk>
Reviewed-by: Philip Withnall <philip tecnocode co uk>
tests/data/Makefile.am | 1 -
tests/data/backend-store-all.ini | 9 ---------
tests/eds/Makefile.am | 4 ----
tests/eds/data/backend-eds-only.ini | 5 -----
tests/folks/Makefile.am | 3 ---
tests/key-file/Makefile.am | 4 ----
.../key-file/data/backend-store-key-file-only.ini | 5 -----
tests/lib/eds/test-case.vala | 4 ++++
tests/lib/key-file/test-case.vala | 3 +++
tests/lib/libsocialweb/test-case.vala | 3 +++
tests/lib/telepathy/test-case.vala | 13 +++++++++++++
tests/lib/test-case.vala | 3 +++
tests/lib/tracker/test-case.vala | 3 +++
tests/libsocialweb/Makefile.am | 4 ----
tests/libsocialweb/aggregation.vala | 2 ++
tests/libsocialweb/data/backend-lsw-only.ini | 5 -----
tests/telepathy/Makefile.am | 4 ----
.../data/backend-store-telepathy-only.ini | 5 -----
tests/tracker/Makefile.am | 4 ----
tests/tracker/data/backend-tracker-only.ini | 6 ------
20 files changed, 31 insertions(+), 59 deletions(-)
---
diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
index c8884b4..05425b4 100644
--- a/tests/data/Makefile.am
+++ b/tests/data/Makefile.am
@@ -1,6 +1,5 @@
EXTRA_DIST = \
avatar-01.jpg \
- backend-store-all.ini \
$(NULL)
-include $(top_srcdir)/git.mk
diff --git a/tests/eds/Makefile.am b/tests/eds/Makefile.am
index 60a863a..d4697ba 100644
--- a/tests/eds/Makefile.am
+++ b/tests/eds/Makefile.am
@@ -81,13 +81,10 @@ noinst_PROGRAMS = \
RUN_WITH_PRIVATE_BUS = $(top_srcdir)/tests/tools/with-session-bus-eds.sh
-backend_store_key_file=$(srcdir)/data/backend-eds-only.ini
avatar_file= abs_top_srcdir@/tests/data/avatar-01.jpg
TESTS_ENVIRONMENT = \
FOLKS_BACKEND_PATH=$(BACKEND_UNINST_PATH) \
- FOLKS_BACKEND_STORE_KEY_FILE_PATH=$(backend_store_key_file) \
AVATAR_FILE_PATH=$(avatar_file) \
- FOLKS_PRIMARY_STORE="eds:local://test" \
$(RUN_WITH_PRIVATE_BUS) \
--session \
--
@@ -239,7 +236,6 @@ MAINTAINERCLEANFILES = \
EXTRA_DIST = \
$(MAINTAINERCLEANFILES) \
- $(backend_store_key_file) \
$(NULL)
-include $(top_srcdir)/git.mk
diff --git a/tests/folks/Makefile.am b/tests/folks/Makefile.am
index b51f242..c680437 100644
--- a/tests/folks/Makefile.am
+++ b/tests/folks/Makefile.am
@@ -66,12 +66,9 @@ noinst_PROGRAMS = \
$(NULL)
SESSION_CONF = $(top_builddir)/tests/lib/telepathy/contactlist/session.conf
-backend_store_key_file=$(top_srcdir)/tests/data/backend-store-all.ini
avatar_file= abs_top_srcdir@/tests/data/avatar-01.jpg
TESTS_ENVIRONMENT = \
FOLKS_BACKEND_PATH=$(BACKEND_UNINST_PATH) \
- FOLKS_BACKEND_STORE_KEY_FILE_PATH=$(backend_store_key_file) \
- FOLKS_PRIMARY_STORE=key-file \
AVATAR_FILE_PATH=$(avatar_file) \
$(RUN_WITH_PRIVATE_BUS) \
--config-file=$(SESSION_CONF) \
diff --git a/tests/key-file/Makefile.am b/tests/key-file/Makefile.am
index 2d26d56..336e681 100644
--- a/tests/key-file/Makefile.am
+++ b/tests/key-file/Makefile.am
@@ -36,11 +36,8 @@ noinst_PROGRAMS = \
individual-retrieval \
$(NULL)
-backend_store_key_file=$(srcdir)/data/backend-store-key-file-only.ini
TESTS_ENVIRONMENT = \
FOLKS_BACKEND_PATH=$(BACKEND_UNINST_PATH) \
- FOLKS_BACKEND_STORE_KEY_FILE_PATH=$(backend_store_key_file) \
- FOLKS_PRIMARY_STORE=key-file \
$(NULL)
TESTS = $(noinst_PROGRAMS)
@@ -62,7 +59,6 @@ MAINTAINERCLEANFILES = \
EXTRA_DIST = \
$(MAINTAINERCLEANFILES) \
- $(backend_store_key_file) \
$(NULL)
-include $(top_srcdir)/git.mk
diff --git a/tests/lib/eds/test-case.vala b/tests/lib/eds/test-case.vala
index cecc16e..49bcab1 100644
--- a/tests/lib/eds/test-case.vala
+++ b/tests/lib/eds/test-case.vala
@@ -29,6 +29,10 @@ public class EdsTest.TestCase : Folks.TestCase
public TestCase (string name)
{
base (name);
+
+ Environment.set_variable ("FOLKS_BACKENDS_ALLOWED", "eds", true);
+ Environment.set_variable ("FOLKS_PRIMARY_STORE", "eds:local://test",
+ true);
}
public override void set_up ()
diff --git a/tests/lib/key-file/test-case.vala b/tests/lib/key-file/test-case.vala
index ee991d7..a804466 100644
--- a/tests/lib/key-file/test-case.vala
+++ b/tests/lib/key-file/test-case.vala
@@ -29,5 +29,8 @@ public class KfTest.TestCase : Folks.TestCase
base (name);
this.kf_backend = new KfTest.Backend ();
+
+ Environment.set_variable ("FOLKS_BACKENDS_ALLOWED", "key-file", true);
+ Environment.set_variable ("FOLKS_PRIMARY_STORE", "key-file", true);
}
}
diff --git a/tests/lib/libsocialweb/test-case.vala b/tests/lib/libsocialweb/test-case.vala
index 285d39b..18dffc2 100644
--- a/tests/lib/libsocialweb/test-case.vala
+++ b/tests/lib/libsocialweb/test-case.vala
@@ -31,6 +31,9 @@ public class LibsocialwebTest.TestCase : Folks.TestCase
base (name);
this.lsw_backend = new LibsocialwebTest.Backend ();
+
+ Environment.set_variable ("FOLKS_BACKENDS_ALLOWED", "libsocialweb", true);
+ Environment.set_variable ("FOLKS_PRIMARY_STORE", "", true);
}
public override void set_up ()
diff --git a/tests/lib/telepathy/test-case.vala b/tests/lib/telepathy/test-case.vala
index d57a21a..ca1e503 100644
--- a/tests/lib/telepathy/test-case.vala
+++ b/tests/lib/telepathy/test-case.vala
@@ -40,6 +40,19 @@ public class TpfTest.TestCase : Folks.TestCase
{
base (name);
+ if (use_keyfile_too)
+ {
+ Environment.set_variable ("FOLKS_BACKENDS_ALLOWED",
+ "telepathy,key-file", true);
+ Environment.set_variable ("FOLKS_PRIMARY_STORE", "key-file", true);
+ }
+ else
+ {
+ Environment.set_variable ("FOLKS_BACKENDS_ALLOWED",
+ "telepathy", true);
+ Environment.set_variable ("FOLKS_PRIMARY_STORE", "", true);
+ }
+
this.create_kf_backend ();
this.create_tp_backend ();
}
diff --git a/tests/lib/test-case.vala b/tests/lib/test-case.vala
index f344d77..f0c1590 100644
--- a/tests/lib/test-case.vala
+++ b/tests/lib/test-case.vala
@@ -34,6 +34,9 @@ public abstract class Folks.TestCase : Object
public TestCase (string name)
{
this._suite = new GLib.TestSuite (name);
+
+ /* By default, no backend is allowed. Subclasses must override. */
+ Environment.set_variable ("FOLKS_BACKENDS_ALLOWED", "", true);
}
public void add_test (string name, TestMethod test)
diff --git a/tests/lib/tracker/test-case.vala b/tests/lib/tracker/test-case.vala
index 872a32f..1340328 100644
--- a/tests/lib/tracker/test-case.vala
+++ b/tests/lib/tracker/test-case.vala
@@ -28,6 +28,9 @@ public class TrackerTest.TestCase : Folks.TestCase
{
base (name);
+ Environment.set_variable ("FOLKS_BACKENDS_ALLOWED", "tracker", true);
+ Environment.set_variable ("FOLKS_PRIMARY_STORE", "tracker", true);
+
this.tracker_backend = new TrackerTest.Backend ();
}
diff --git a/tests/libsocialweb/Makefile.am b/tests/libsocialweb/Makefile.am
index e7d5b2e..f61c9de 100644
--- a/tests/libsocialweb/Makefile.am
+++ b/tests/libsocialweb/Makefile.am
@@ -51,11 +51,8 @@ noinst_PROGRAMS = \
$(NULL)
SESSION_CONF = $(top_builddir)/tests/lib/libsocialweb/session.conf
-backend_store_key_file=$(srcdir)/data/backend-lsw-only.ini
TESTS_ENVIRONMENT = \
FOLKS_BACKEND_PATH=$(BACKEND_UNINST_PATH) \
- FOLKS_BACKEND_STORE_KEY_FILE_PATH=$(backend_store_key_file) \
- FOLKS_PRIMARY_STORE= \
$(RUN_WITH_PRIVATE_BUS) \
--config-file=$(SESSION_CONF) \
--
@@ -83,7 +80,6 @@ MAINTAINERCLEANFILES = \
EXTRA_DIST = \
$(MAINTAINERCLEANFILES) \
- $(backend_store_key_file) \
$(NULL)
-include $(top_srcdir)/git.mk
diff --git a/tests/libsocialweb/aggregation.vala b/tests/libsocialweb/aggregation.vala
index ab764fc..15b5866 100644
--- a/tests/libsocialweb/aggregation.vala
+++ b/tests/libsocialweb/aggregation.vala
@@ -40,6 +40,8 @@ public class AggregationTests : LibsocialwebTest.TestCase
public override void set_up ()
{
/* Ensure we have a primary store for linking */
+ Environment.set_variable ("FOLKS_BACKENDS_ALLOWED",
+ "libsocialweb,key-file", true);
Environment.set_variable ("FOLKS_PRIMARY_STORE", "key-file", true);
/* Initialize an empty key file for the relationships*/
diff --git a/tests/telepathy/Makefile.am b/tests/telepathy/Makefile.am
index 540fd7c..aa17a9b 100644
--- a/tests/telepathy/Makefile.am
+++ b/tests/telepathy/Makefile.am
@@ -61,12 +61,9 @@ AM_VALAFLAGS += \
$(NULL)
SESSION_CONF = $(top_builddir)/tests/lib/telepathy/contactlist/session.conf
-backend_store_key_file=$(srcdir)/data/backend-store-telepathy-only.ini
TESTS_ENVIRONMENT = \
FOLKS_BACKEND_PATH=$(BACKEND_UNINST_PATH) \
FOLKS_BACKEND_KEY_FILE_PATH=$(srcdir)/data/relationships-empty.ini \
- FOLKS_BACKEND_STORE_KEY_FILE_PATH=$(backend_store_key_file) \
- FOLKS_PRIMARY_STORE= \
$(RUN_WITH_PRIVATE_BUS) \
--config-file=$(SESSION_CONF) \
--
@@ -123,7 +120,6 @@ MAINTAINERCLEANFILES = \
EXTRA_DIST = \
$(MAINTAINERCLEANFILES) \
- $(backend_store_key_file) \
$(srcdir)/data/relationships-empty.ini \
$(NULL)
diff --git a/tests/tracker/Makefile.am b/tests/tracker/Makefile.am
index 2bda2ee..9b0c388 100644
--- a/tests/tracker/Makefile.am
+++ b/tests/tracker/Makefile.am
@@ -104,12 +104,9 @@ noinst_PROGRAMS = \
set-null-avatar \
$(NULL)
-backend_store_key_file=$(srcdir)/data/backend-tracker-only.ini
avatar_file= abs_top_srcdir@/tests/data/avatar-01.jpg
TESTS_ENVIRONMENT = \
FOLKS_BACKEND_PATH=$(BACKEND_UNINST_PATH) \
- FOLKS_BACKEND_STORE_KEY_FILE_PATH=$(backend_store_key_file) \
- FOLKS_PRIMARY_STORE=tracker \
AVATAR_FILE_PATH=$(avatar_file) \
$(RUN_WITH_PRIVATE_BUS) \
--session \
@@ -418,7 +415,6 @@ MAINTAINERCLEANFILES = \
EXTRA_DIST = \
$(MAINTAINERCLEANFILES) \
- $(backend_store_key_file) \
$(NULL)
-include $(top_srcdir)/git.mk
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]