summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-05-07 11:04:51 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-05-07 11:04:51 +0100
commita08b9266bb9449e1127f6d3cb925238fff7f3ec2 (patch)
treeb79a5157cc581213548268b9e661d20a2880106c
parentce574d858443398abda95440cb154469194e7a4a (diff)
Add support for installing tests
-rw-r--r--configure.ac8
-rw-r--r--tests/twisted/Makefile.am37
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) \