summaryrefslogtreecommitdiff
path: root/tests/twisted/Makefile.am
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-09-10 15:19:02 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-09-11 15:36:40 +0200
commit6dd2177a31a0d111dd0025892d95cbdcd2a23c78 (patch)
treec192ec8b42ddf511eba56d6cbbbb5d6062f73810 /tests/twisted/Makefile.am
parent7647a1a355e34f8eaa0d5ea20d2d7b20dac6e927 (diff)
Run regression tests under the run-test.sh "driver"
As well as making the tests pass under Automake 1.13, this lays the groundwork for OSTree-style "installed tests" later. https://bugs.freedesktop.org/show_bug.cgi?id=69216
Diffstat (limited to 'tests/twisted/Makefile.am')
-rw-r--r--tests/twisted/Makefile.am56
1 files changed, 37 insertions, 19 deletions
diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index a78a99ff..a434bbcf 100644
--- a/tests/twisted/Makefile.am
+++ b/tests/twisted/Makefile.am
@@ -61,11 +61,6 @@ TWISTED_AVAHI_TESTS = \
TWISTED_AVAHI_OLPC_TESTS = \
avahi/olpc-activity-announcements.py
-TESTS =
-
-TESTS_ENVIRONMENT = \
- PYTHONPATH=@abs_top_srcdir@/tests/twisted:@abs_top_builddir@/tests/twisted:$(PYTHONPATH)
-
if WANT_TWISTED_TESTS
TWISTED_TESTS += $(TWISTED_BASIC_TESTS)
endif
@@ -80,20 +75,20 @@ endif
check-local: check-coding-style check-twisted
-check-twisted:
+CHECK_TWISTED_SLEEP=0
+
+check-twisted: $(BUILT_SOURCES)
$(MAKE) -C tools
- rm -f tools/core
- rm -f tools/salut-testing.log
- if ! test -n "$$SALUT_TEST_REAL_AVAHI"; then \
- also_for_system="--also-for-system"; \
+ if test "x$(CHECK_TWISTED_SLEEP)" = x0; then \
+ salut_test_sleep= ; \
+ else \
+ salut_test_sleep=--sleep=$(CHECK_TWISTED_SLEEP); \
fi; \
- sh $(srcdir)/tools/with-session-bus.sh $$also_for_system --config-file=tools/tmp-session-bus.conf -- $(MAKE) check-TESTS \
- TESTS="$(TWISTED_TESTS)" \
- TESTS_ENVIRONMENT="$(TESTS_ENVIRONMENT) $(TEST_PYTHON)"
- @if test -e tools/core; then\
- echo "Core dump exists: tools/core";\
- exit 1;\
- fi
+ SALUT_TEST_UNINSTALLED=1 \
+ SALUT_ABS_TOP_SRCDIR=@abs_top_srcdir@ \
+ SALUT_ABS_TOP_BUILDDIR=@abs_top_builddir@ \
+ SALUT_TEST_SLEEP=$$salut_test_sleep \
+ ./run-test.sh "$(TWISTED_TESTS)"
if ENABLE_PLUGINS
PLUGINS_ENABLED_PYBOOL = True
@@ -107,7 +102,25 @@ config.py: Makefile
echo "PLUGINS_ENABLED = $(PLUGINS_ENABLED_PYBOOL)"; \
} > $@
-BUILT_SOURCES = config.py
+salut-twisted-tests.list: Makefile
+ $(AM_V_GEN)echo $(TWISTED_TESTS) > $@
+
+BUILT_SOURCES = \
+ config.py \
+ salut-twisted-tests.list \
+ run-test.sh \
+ $(NULL)
+
+# We don't really use saluttestsdir 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.
+run-test.sh: run-test.sh.in Makefile
+ $(AM_V_GEN)sed \
+ -e 's![@]saluttestsdir[@]!${pkglibexecdir}/tests!' \
+ -e 's![@]TEST_PYTHON[@]!$(TEST_PYTHON)!' \
+ < $< > $@.tmp && \
+ chmod +x $@.tmp && \
+ mv $@.tmp $@
EXTRA_DIST = \
$(TWISTED_AVAHI_TESTS) \
@@ -127,7 +140,12 @@ EXTRA_DIST = \
xmppstream.py \
ipv6.py
-CLEANFILES = salut-[1-9]*.log *.pyc */*.pyc config.py
+CLEANFILES = \
+ $(BUILT_SOURCES) \
+ salut-[1-9]*.log \
+ *.pyc \
+ */*.pyc \
+ $(NULL)
check_misc_sources = $(TESTS)