[PATCH evemu 2/4] configure.ac: add '--disable-tests' option

Peter Hutterer peter.hutterer at who-t.net
Sun Aug 10 15:02:03 PDT 2014


On Sat, Aug 09, 2014 at 12:18:09AM +0200, Peter Seiderer wrote:
> Signed-off-by: Peter Seiderer <ps.report at gmx.net>
> ---
>  Makefile.am  | 2 +-
>  configure.ac | 9 +++++++++
>  2 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index 7b68f3d..a83b35f 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -1,4 +1,4 @@
> -SUBDIRS = src tools python test
> +SUBDIRS = src tools python $(SUBDIR_TESTS)
>  
>  pkgconfigdir = $(libdir)/pkgconfig
>  pkgconfig_DATA = evemu.pc
> diff --git a/configure.ac b/configure.ac
> index 239811c..c7e16b3 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -45,6 +45,15 @@ if test "x$XMLTO" = "x" || test "x$ASCIIDOC" = "x"; then
>  	AC_MSG_WARN([xmlto or asciidoc not found - cannot create man pages without it])
>  fi
>  
> +AC_ARG_ENABLE([tests],
> +	AS_HELP_STRING([--disable-tests], [Disable running tests]))
> +
> +AS_IF([test "x$enable_tests" != "xno"], [
> +	SUBDIR_TESTS=test
> +])
> +
> +AC_SUBST([SUBDIR_TESTS])
> +

there's a test in the python directory too, IMO --disable-tests should
disable all of them. Plus, after some issues with disabling things from
other projects I found it best to have a define for BUILD_TESTS and then
disable the various bits in each Makefile.am. That way it's less likely to
forget some EXTRA_DIST bit or similar in the light of whether tests are
enabled or not.

Cheers,
   Peter

>  AC_SUBST(AM_CFLAGS,
>           "-Wall -Wextra")
>  
> -- 
> 1.8.1.4


More information about the Input-tools mailing list