[next] telepathy-rakia: Add support for installing tests

Simon McVittie smcv at kemper.freedesktop.org
Wed May 7 03:36:31 PDT 2014


Module: telepathy-rakia
Branch: next
Commit: a08b9266bb9449e1127f6d3cb925238fff7f3ec2
URL:    http://cgit.freedesktop.org/telepathy/telepathy-rakia/commit/?id=a08b9266bb9449e1127f6d3cb925238fff7f3ec2

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Wed May  7 11:04:51 2014 +0100

Add support for installing tests

---

 configure.ac              |    8 ++++++++
 tests/twisted/Makefile.am |   37 ++++++++++++++++++++++++++-----------
 2 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index 363356d..0bf9364 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,6 +145,14 @@ else
   AM_CONDITIONAL([WANT_TWISTED_TESTS], false)
 fi
 
+AC_ARG_ENABLE([installed-tests],
+  [AC_HELP_STRING([--enable-installed-tests],
+    [enable as-installed regression tests])],
+  [],
+  [enable_installed_tests=no])
+AM_CONDITIONAL([ENABLE_INSTALLED_TESTS],
+  [test "x$enable_installed_tests" = xyes])
+
 AC_CONFIG_FILES([
   Makefile
   rakia/Makefile
diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index 0ce3f17..5142a23 100644
--- a/tests/twisted/Makefile.am
+++ b/tests/twisted/Makefile.am
@@ -49,33 +49,48 @@ config.py: Makefile
 rakia-twisted-tests.list: Makefile
 	$(AM_V_GEN)echo $(TWISTED_TESTS) > $@
 
-BUILT_SOURCES = \
+built_test_data = \
 	config.py \
 	rakia-twisted-tests.list \
+	$(NULL)
+
+built_test_scripts = \
 	run-test.sh \
 	$(NULL)
 
-# We don't really use rakiatestsdir yet - we only support uninstalled testing
-# so far - but I'm substituting it to keep the script more similar to Gabble's.
-# ${pkglibexecdir}/tests is what GNOME's InstalledTests goal recommends.
-#
-# Similarly, Gabble supports TEST_PYTHON differing from PYTHON for historical
-# reasons, but we don't do that here.
+BUILT_SOURCES = \
+	$(built_test_data) \
+	$(built_test_scripts) \
+	$(NULL)
+
+if ENABLE_INSTALLED_TESTS
+testsdir = ${datadir}/telepathy-rakia-1-tests
+twistedtestsdir = ${testsdir}/twisted
+nobase_dist_twistedtests_DATA = $(dist_test_data)
+twistedtests_DATA = $(built_test_data)
+twistedtests_SCRIPTS = $(built_test_scripts)
+endif
+
 run-test.sh: run-test.sh.in Makefile
 	$(AM_V_GEN)sed \
-			-e 's![@]rakiatestsdir[@]!${pkglibexecdir}/tests!' \
+			-e 's![@]rakiatestsdir[@]!${testsdir}!' \
 			-e 's![@]TEST_PYTHON[@]!$(PYTHON)!' \
 			< $< > $@.tmp && \
 		chmod +x $@.tmp && \
 		mv $@.tmp $@
 
-EXTRA_DIST = \
+dist_test_data = \
 	$(TWISTED_TESTS) \
 	constants.py \
-	run-test.sh.in \
 	sofiatest.py \
 	servicetest.py \
-	voip/voip_test.py
+	voip/voip_test.py \
+	$(NULL)
+
+EXTRA_DIST = \
+	$(dist_test_data) \
+	run-test.sh.in \
+	$(NULL)
 
 CLEANFILES = \
 	$(BUILT_SOURCES) \



More information about the telepathy-commits mailing list