[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] make: obey WITH_TESTS; do not run test suite when --enable-test-suite=no



On 03/24/2013 04:54 PM, TJ wrote:
> make: obey WITH_TESTS; do not run test suite when --enable-test-suite=no
> 
> Even when --enable-test-suite=no a build would run the test suite. Fix the Makefile so that
> tests are conditional on WITH_TESTS.
> 
> Signed-off-by: TJ <libvirt iam tj>
> ---
>  Makefile.am | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index 5b1e27e..3b5e7a2 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -7,10 +7,14 @@ LCOV = lcov
>  GENHTML = genhtml
>   SUBDIRS = gnulib/lib include src daemon tools docs gnulib/tests \
> -  python tests po examples/domain-events/events-c examples/hellolibvirt \
> +  python po examples/domain-events/events-c examples/hellolibvirt \
>    examples/dominfo examples/domsuspend examples/python examples/apparmor \
>    examples/xml/nwfilter examples/openauth examples/systemtap
>  +if WITH_TESTS
> +SUBDIRS += tests
> +endif

NACK. This completely skips the test directory if tests are disabled.
Our intention is that the test directory is always visited, so that a
plain 'make' will build the tests and catch compile errors, if tests are
enabled; and so that 'make check' will always run the tests even if
tests are disabled.  The point of enabling tests is more precisely
whether tests are enabled to be built during plain 'make' (useful to
developers) or only during 'make check' (useful to casual self-builds).

This is the relevant section of tests/Makefile.am that encodes our
intentions:

if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
noinst_LTLIBRARIES = $(test_libraries)
else
check_PROGRAMS = $(test_programs) $(test_helpers)
check_LTLIBRARIES = $(test_libraries)
endif

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]