[Telepathy-commits] [telepathy-salut/master] Only run tests that poke avahi when configure with --enable-avahi-tests

Sjoerd Simons sjoerd.simons at collabora.co.uk
Thu Sep 4 03:51:32 PDT 2008


---
 configure.ac              |   14 ++++++++++++++
 tests/Makefile.am         |    6 +-----
 tests/twisted/Makefile.am |   16 ++++++++++++++--
 3 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 41a86e5..c7f02eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -94,6 +94,20 @@ done
 AC_SUBST(TEST_PYTHON)
 AM_CONDITIONAL([WANT_TWISTED_TESTS], test false != "$TEST_PYTHON")
 
+dnl enable avahi tests
+AC_ARG_ENABLE(avahi-tests,
+  AC_HELP_STRING([ --enable-avahi-tests],
+    [Enable tests that use the system avahi ]),
+    enable_avahi_tests=$enableval, enable_avahi_tests=no)
+
+if test x$enable_avahi_tests = xyes; then
+  if test false == "$TEST_PYTHON"; then
+    AC_MSG_ERROR(
+      [Python with twisted support is needed for avahi twisted tests])
+  fi
+fi
+AM_CONDITIONAL(WANT_TWISTED_AVAHI_TESTS, test "x$enable_avahi_tests" = "xyes")
+
 dnl olpc specific code switch
 AC_ARG_ENABLE(olpc,
   AC_HELP_STRING([--enable-olpc],[compile with olpc specific code]),
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 66b3de9..8f6b619 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -133,11 +133,7 @@ clean-local:
 	-rm -rf outputs
 	-rm -f sasl-test.db
 
-if WANT_TWISTED_TESTS
-  CHECK_TWISTED = twisted
-endif
-
-SUBDIRS = inputs $(CHECK_TWISTED)
+SUBDIRS = inputs twisted
 
 $(check_SCRIPTS): always-run
 	chmod +x $(srcdir)/$@
diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index fdad1e2..5f1c860 100644
--- a/tests/twisted/Makefile.am
+++ b/tests/twisted/Makefile.am
@@ -1,19 +1,30 @@
-TWISTED_TESTS = \
+TWISTED_TESTS =
+
+TWISTED_AVAHI_TESTS = \
 	avahi/test-register.py \
 	avahi/test-aliases.py
 
 TESTS =
+TESTS_TO_RUN =
 
 TESTS_ENVIRONMENT = \
 	PYTHONPATH=@abs_top_srcdir@/tests/twisted:@abs_top_builddir@/tests/twisted
 
+if WANT_TWISTED_TESTS
+  TESTS_TO_RUN += $(TWISTED_TESTS)
+endif
+
+if WANT_TWISTED_AVAHI_TESTS
+  TESTS_TO_RUN += $(TWISTED_AVAHI_TESTS)
+endif
+
 check-local: check-coding-style check-twisted
 
 check-twisted:
 	$(MAKE) -C tools
 	rm -f tools/core
 	sh $(srcdir)/tools/with-session-bus.sh --config-file=tools/tmp-session-bus.conf -- $(MAKE) check-TESTS \
-		TESTS="$(TWISTED_TESTS)" \
+		TESTS="$(TESTS_TO_RUN)" \
 		TESTS_ENVIRONMENT="$(TESTS_ENVIRONMENT) $(TEST_PYTHON)"
 	@if test -e tools/core; then\
 		echo "Core dump exists: tools/core";\
@@ -21,6 +32,7 @@ check-twisted:
 	fi
 
 EXTRA_DIST = \
+	$(AVAHI_TWISTED_TESTS) \
 	$(TWISTED_TESTS) \
 	saluttest.py \
 	servicetest.py
-- 
1.5.6.3




More information about the Telepathy-commits mailing list