From 5ffc49a9b87d29a92049889193397b0e6ee81467 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 11 Jun 2013 15:26:21 +0100 Subject: [PATCH 7/7] Run tests during "make check" with run-test.sh Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54114 Signed-off-by: Simon McVittie --- tests/twisted/Makefile.am | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am index 764f074..0e3605a 100644 --- a/tests/twisted/Makefile.am +++ b/tests/twisted/Makefile.am @@ -34,28 +34,19 @@ TWISTED_TESTS = \ messages/room-config.py \ $(NULL) -TESTS = - -TESTS_ENVIRONMENT = \ - PYTHONPATH=@abs_top_srcdir@/tests/twisted:@abs_top_builddir@/tests/twisted \ - IDLE_SSL_KEY=@abs_top_srcdir@/tests/twisted/tools/idletest.key \ - IDLE_SSL_CERT=@abs_top_srcdir@/tests/twisted/tools/idletest.cert - if WANT_TWISTED_TESTS check-local: check-twisted -check-twisted: +check-twisted: $(BUILT_SOURCES) $(MAKE) -C tools rm -f tools/core rm -f tools/idle-testing.log failed=0; \ - sh $(srcdir)/tools/with-session-bus.sh \ - --config-file=tools/tmp-session-bus.conf \ - -- $(MAKE) check-TESTS \ - TESTS="$(TWISTED_TESTS)" \ - TESTS_ENVIRONMENT="$(TESTS_ENVIRONMENT) $(TEST_PYTHON) -u" || \ - failed=1; \ + IDLE_TEST_UNINSTALLED=1 \ + IDLE_ABS_TOP_SRCDIR=@abs_top_srcdir@ \ + IDLE_ABS_TOP_BUILDDIR=@abs_top_builddir@ \ + sh run-test.sh "$(TWISTED_TESTS)" || failed=1; \ if test -e tools/core; then\ echo -e "\033[0;31;1mCore dump exists: tools/core\033[0m";\ exit 1;\ @@ -66,13 +57,34 @@ check-twisted: endif +BUILT_SOURCES = \ + run-test.sh \ + idle-twisted-tests.list \ + $(NULL) + +run-test.sh: run-test.sh.in Makefile + $(AM_V_GEN)sed -e "s|[@]idletestsdir[@]|@idletestsdir@|g" \ + -e "s|[@]PYTHON[@]|$(PYTHON)|g" \ + -e "s|[@]TEST_PYTHON[@]|$(TEST_PYTHON)|g" \ + $< > $@ + @chmod +x $@ + +idle-twisted-tests.list: Makefile + $(AM_V_GEN)echo $(TWISTED_TESTS) > $@ + EXTRA_DIST = \ $(TWISTED_TESTS) \ servicetest.py \ idletest.py \ constants.py \ + run-test.sh.in \ $(NULL) -CLEANFILES = idle-[1-9]*.log *.pyc */*.pyc +CLEANFILES = \ + $(BUILT_SOURCES) \ + idle-[1-9]*.log \ + *.pyc \ + */*.pyc \ + $(NULL) SUBDIRS = tools -- 1.7.10.4