summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-05-12 10:41:09 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-05-12 10:41:09 +0100
commit9cd71e3c357b74486b7bc59cafe7d1ffd47dc38e (patch)
tree50fbb5cdbb6d331cff5dc7b3f0c6ecbda5f02687
parent92dba4e2a7265c8249b5965487ce5dc565dd3f6e (diff)
downloadtelepathy-salut-9cd71e3c357b74486b7bc59cafe7d1ffd47dc38e.tar.gz
Add infrastructure to run installed-tests under the mock Avahi
-rw-r--r--tests/twisted/run-test.sh.in1
-rw-r--r--tests/twisted/tools/Makefile.am16
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/twisted/run-test.sh.in b/tests/twisted/run-test.sh.in
index d0574fa9..a33735e0 100644
--- a/tests/twisted/run-test.sh.in
+++ b/tests/twisted/run-test.sh.in
@@ -67,6 +67,7 @@ fi
if [ -z "$SALUT_TEST_REAL_AVAHI" ]; then
also_for_system="--also-for-system";
+ config_file="${G_TEST_BUILDDIR}/tools/mock-avahi/tmp-session-bus.conf"
fi
n=0
diff --git a/tests/twisted/tools/Makefile.am b/tests/twisted/tools/Makefile.am
index a083f920..dfe1dee4 100644
--- a/tests/twisted/tools/Makefile.am
+++ b/tests/twisted/tools/Makefile.am
@@ -11,12 +11,21 @@ installed/%.conf: %.conf.in Makefile
@$(MKDIR_P) installed
$(AM_V_GEN)sed -e 's|[@]servicedir[@]|$(servicedir)|g' $< > $@
+# For the mock Avahi we need to set DBUS_SYSTEM_BUS_ADDRESS to the
+# temporary session bus's address
+mock-avahi/%.conf: %.conf.in Makefile
+ @$(MKDIR_P) mock-avahi
+ $(AM_V_GEN)sed -e "s|^Exec=.*|Exec=/bin/sh -c 'DBUS_SYSTEM_BUS_ADDRESS=$$DBUS_SESSION_BUS_ADDRESS ${libexecdir}/telepathy-salut-1'|g" $< > $@
+
# We don't use the full filename for the .in because > 99 character filenames
# in tarballs are non-portable (and automake 1.8 doesn't let us build
# non-archaic tarballs)
im.telepathy.v1.ConnectionManager.%.service: %.service.in
$(AM_V_GEN)sed -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" $< > $@
+mock-avahi/im.telepathy.v1.ConnectionManager.%.service: %.service.in
+ $(AM_V_GEN)sed -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" $< > $@
+
# D-Bus service file for testing
service_in_files = salut.service.in
service_files = im.telepathy.v1.ConnectionManager.salut.service
@@ -28,6 +37,7 @@ conf_files = $(conf_in_files:.conf.in=.conf)
BUILT_SOURCES = \
$(built_test_data) \
$(conf_files) \
+ $(nobase_built_test_data) \
$(service_files) \
exec-with-log.sh \
$(NULL)
@@ -43,6 +53,11 @@ built_test_data = \
installed/tmp-session-bus.conf \
$(NULL)
+nobase_built_test_data = \
+ mock-avahi/tmp-session-bus.conf \
+ mock-avahi/im.telepathy.v1.ConnectionManager.salut.service \
+ $(NULL)
+
EXTRA_DIST = \
$(conf_in_files) \
$(dist_test_data) \
@@ -63,4 +78,5 @@ if ENABLE_INSTALLED_TESTS
dist_twistedtools_SCRIPTS = ${dist_test_scripts}
dist_twistedtools_DATA = ${dist_test_data}
twistedtools_DATA = ${built_test_data}
+nobase_twistedtools_DATA = ${nobase_built_test_data}
endif