[PATCH] Only build tests when unit tests are enabled.

Dan Nicholson dbn.lists at gmail.com
Tue Mar 22 05:39:36 PDT 2011


On Mon, Mar 21, 2011 at 6:56 PM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
> I'll squash this in with the other patch, no need to have two separate ones.
>
>  test/Makefile.am |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/test/Makefile.am b/test/Makefile.am
> index 16502ee..0b45a2d 100644
> --- a/test/Makefile.am
> +++ b/test/Makefile.am
> @@ -1,3 +1,4 @@
> +if ENABLE_UNIT_TESTS
>  AM_CPPFLAGS = -I$(top_srcdir)/src
>  AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS)
>  fake_syms = fake-symbols.c fake-symbols.h
> @@ -10,6 +11,5 @@ eventcomm_test_SOURCES = eventcomm-test.c\
>                         $(fake_syms)
>  endif
>
> -if ENABLE_UNIT_TESTS
>  TESTS = $(noinst_PROGRAMS)
>  endif

Not that it matters too much, but you just need to wrap the *_PROGRAMS
declaration to get automake to not output the toplevel rules. I do
notice here the TESTS = $(noinst_PROGRAMS) line. If check_PROGRAMS is
used instead, then the programs are only built on "make check". Not
sure that's the intention or not.

--
Dan


More information about the xorg-devel mailing list