From bd70e8053165bdee620356cdff02c3979d7138e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Diego=20E=2E=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 20 Jan 2009 00:55:39 +0100 Subject: [PATCH] Allow to opt-out from building tests. Since the tests are only useful either if you're hacking at pulseaudio as a developer, or when running "make check", allow users to opt-out from their build. This for instance allows for Gentoo users not to build the tests when installing the ebuild with tests disabled, and also allow for skipping over eventually broken tests when trying to get the basic build going on a port. --- configure.ac | 6 ++++++ src/Makefile.am | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 8586dcd..411a14d 100644 --- a/configure.ac +++ b/configure.ac @@ -101,6 +101,12 @@ for flag in $DESIRED_FLAGS ; do CC_CHECK_CFLAGS([$flag], [CFLAGS="$CFLAGS $flag"]) done +dnl Check whether to build tests by default (as compile-test) or not +AC_ARG_ENABLE([default-build-tests], + AS_HELP_STRING([--disable-default-build-tests], [Build test programs only during make check])) + +AM_CONDITIONAL([BUILD_TESTS_DEFAULT], [test "x$enable_default_build_tests" = "xno"]) + # Native atomic operation support AC_ARG_ENABLE([atomic-arm-linux-helpers], AS_HELP_STRING([--disable-atomic-arm-linux-helpers],[use inline asm or libatomic_ops instead]), diff --git a/src/Makefile.am b/src/Makefile.am index e8f0a82..fbe9e91 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -253,7 +253,7 @@ TESTS = \ lock-autospawn-test \ prioq-test -noinst_PROGRAMS = \ +TESTS_BINARIES = \ mainloop-test \ mcalign-test \ pacat-simple \ @@ -293,7 +293,7 @@ if HAVE_SIGXCPU #TESTS += \ # cpulimit-test \ # cpulimit-test2 -noinst_PROGRAMS += \ +TESTS_BINARIES += \ cpulimit-test \ cpulimit-test2 endif @@ -301,10 +301,16 @@ endif if HAVE_GLIB20 TESTS += \ mainloop-test-glib -noinst_PROGRAMS += \ +TESTS_BINARIES += \ mainloop-test-glib endif +if BUILD_TESTS_DEFAULT +noinst_PROGRAMS = $(TESTS_BINARIES) +else +check_PROGRAMS = $(TESTS_BINARIES) +endif + mainloop_test_SOURCES = tests/mainloop-test.c mainloop_test_CFLAGS = $(AM_CFLAGS) mainloop_test_LDADD = $(AM_LDADD) libpulse.la -- 2.7.4