From 704928a807a3b17029d092eef2b24c76ab7c7890 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 1 May 2012 18:51:19 +0100 Subject: [PATCH] build: Allow disabling all tests and examples This should allow nicer build automation and cross-compilation support. The former --disable-conformance configure switch has been deprecated by the --disable-tests one, which is more encompassing as it disables the whole test suite. --- Makefile.am | 12 +++++++++++- configure.ac | 36 +++++++++++++++++++++++++----------- tests/Makefile.am | 16 +--------------- 3 files changed, 37 insertions(+), 27 deletions(-) diff --git a/Makefile.am b/Makefile.am index c8b3de923..e8cd0ffe1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,17 @@ include $(top_srcdir)/build/autotools/Makefile.am.silent NULL = -SUBDIRS = clutter tests examples doc po build +SUBDIRS = clutter doc po build + +if BUILD_TESTS +SUBDIRS += tests +endif + +if BUILD_EXAMPLES +SUBDIRS += examples +endif + +DIST_SUBDIRS = clutter tests examples doc po build # XXX - this is a massive hack to make autoreconf honour the ACLOCAL_FLAGS # that jhbuild sets while still retaining build/autotools as the authoritative diff --git a/configure.ac b/configure.ac index 18b792380..fe9bbf058 100644 --- a/configure.ac +++ b/configure.ac @@ -866,16 +866,6 @@ AS_CASE([$enable_deprecated], AC_SUBST([CLUTTER_DEPRECATED_CFLAGS]) -dnl === Conformance test suite ================================================ - -AC_ARG_ENABLE([conformance], - [AS_HELP_STRING([--enable-conformance=@<:@no/yes@:>@], - [Build conformance test suite @<:@default=yes@:>@])], - [], - [enable_conformance=yes]) - -AM_CONDITIONAL([BUILD_TESTS], [test "x$enable_conformance" = "xyes"]) - dnl === Profiling ============================================================= m4_define([profile_default], [no]) @@ -1088,6 +1078,27 @@ AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], [The prefix for our gettext translation domains.]) AS_ALL_LINGUAS +dnl = Build optionals ========================================================= + +dnl === Conformance test suite ================================================ + +AC_ARG_ENABLE([conformance], + [AS_HELP_STRING([--disable-conformance], [Whether the conformance tests should be built])], + [], + [enable_conformance=yes]) + +AC_ARG_ENABLE([tests], + [AS_HELP_STRING([--disable-tests], [Whether tests should be built])], + [], + [enable_tests=yes]) +AM_CONDITIONAL(BUILD_TESTS, [test "x$enable_tests" = "xyes" && "x$enable_conformance" = "xyes"]) + +AC_ARG_ENABLE([examples], + [AS_HELP_STRING([--disable-examples], [Whether examples should be built])], + [], + [enable_examples=yes]) +AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$enable_examples" = "xyes"]) + dnl =========================================================================== AC_CONFIG_FILES([ @@ -1170,9 +1181,12 @@ echo " Build Additional Documentation: ${enable_docs} (Generate PDF: ${en echo "" echo " • Extra:" echo " Build introspection data: ${enable_introspection}" -echo " Build conformance test suite: ${enable_conformance}" +echo " Build test suites: ${enable_tests}" +if test "x$enable_tests" = "xyes"; then echo " Build X11-specific tests: ${x11_tests}" echo " Build tests using GDK-Pixbuf: ${pixbuf_tests}" +fi +echo " Build examples: ${enable_examples}" # Clutter backend related flags echo "" diff --git a/tests/Makefile.am b/tests/Makefile.am index 9eeba79b3..48f253170 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,26 +1,12 @@ -SUBDIRS = accessibility data interactive micro-bench performance - -if BUILD_TESTS -SUBDIRS += conform -endif - -DIST_SUBDIRS = accessibility data conform interactive micro-bench performance +SUBDIRS = accessibility data conform interactive micro-bench performance EXTRA_DIST = README -if BUILD_TESTS test conform: ( cd ./conform && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $$? test-report full-report: ( cd ./conform && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $$? -else -test conform: - @true - -test-report full-report: - @true -endif # BUILD_TESTS .PHONY: test conform test-report full-report