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

Gaetan Nadon memsize at videotron.ca
Tue Mar 22 08:26:24 PDT 2011


On Tue, 2011-03-22 at 11:56 +1000, Peter Hutterer 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(-)
> 

Now that I have cleared some of my misunderstandings, there is little
benefits
in using XORG_ENABLE_UNIT_TESTS for such a simple case,
unless you foresee a more complex situation in the short term.
But nothing wrong in using it either. It helps establishing a pattern.

Using the check_PROGRAMS pattern would most likely ease maintenance and
reduce
the risk of errors as it would work like most/all other modules.

If there is a need to build the test program in the regular build, it
could be moved
to the eventcomm dir. The test dir would simply make use of it. There is
no obligation
for programs to be built in the test dir. 


> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110322/a189535c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110322/a189535c/attachment.pgp>


More information about the xorg-devel mailing list