[next] telepathy-salut: Add infrastructure to run installed-tests under the mock Avahi
Simon McVittie
smcv at kemper.freedesktop.org
Mon May 12 03:56:46 PDT 2014
Module: telepathy-salut
Branch: next
Commit: 9cd71e3c357b74486b7bc59cafe7d1ffd47dc38e
URL: http://cgit.freedesktop.org/telepathy/telepathy-salut/commit/?id=9cd71e3c357b74486b7bc59cafe7d1ffd47dc38e
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date: Mon May 12 10:41:09 2014 +0100
Add infrastructure to run installed-tests under the mock Avahi
---
tests/twisted/run-test.sh.in | 1 +
tests/twisted/tools/Makefile.am | 16 ++++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/tests/twisted/run-test.sh.in b/tests/twisted/run-test.sh.in
index d0574fa..a33735e 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 a083f92..dfe1dee 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
More information about the telepathy-commits
mailing list