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

Eric Blake eblake at redhat.com
Mon Mar 25 12:25:53 UTC 2013


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 at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130325/cd0bc962/attachment-0001.sig>


More information about the libvir-list mailing list