[Libguestfs] [PATCH 5/7] Do not run appliance-related checks if not building appliance

Richard W.M. Jones rjones at redhat.com
Fri Jan 20 13:26:50 UTC 2012


On Fri, Jan 20, 2012 at 08:44:45AM +0100, Hilko Bengen wrote:
> ---
>  Makefile.am          |    2 ++
>  cat/Makefile.am      |    2 ++
>  clone/Makefile.am    |    2 ++
>  df/Makefile.am       |    2 ++
>  edit/Makefile.am     |    2 ++
>  fish/Makefile.am     |   10 +++++++---
>  fuse/Makefile.am     |    4 +++-
>  haskell/Makefile.am  |    5 ++++-
>  java/Makefile.am     |    6 +++++-
>  ocaml/Makefile.am    |   10 +++++++---
>  perl/Makefile.am     |   10 ++++++++--
>  python/Makefile.am   |    8 ++++++--
>  resize/Makefile.am   |    5 ++++-
>  sparsify/Makefile.am |    2 ++
>  tools/Makefile.am    |    2 ++
>  15 files changed, 58 insertions(+), 14 deletions(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index f925529..7cd4a7d 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -33,6 +33,7 @@ SUBDIRS += appliance
>  endif
>  
>  # Tests - order is important.
> +if ENABLE_APPLIANCE
>  SUBDIRS += tests/qemu
>  SUBDIRS += tests/guests
>  SUBDIRS += tests/c-api
> @@ -41,6 +42,7 @@ SUBDIRS += tests/lvm
>  SUBDIRS += tests/luks
>  SUBDIRS += tests/md
>  SUBDIRS += tests/regressions
> +endif
>  
>  # Extra tests don't run by default.  You have to do 'make extra-tests'.
>  SUBDIRS += tests/extra
> diff --git a/cat/Makefile.am b/cat/Makefile.am
> index c9889ca..f883d10 100644
> --- a/cat/Makefile.am
> +++ b/cat/Makefile.am
> @@ -134,4 +134,6 @@ TESTS_ENVIRONMENT = \
>  	MALLOC_PERTURB_=$(random_val) \
>  	$(top_builddir)/run
>  
> +if ENABLE_APPLIANCE
>  TESTS = test-virt-cat.sh test-virt-filesystems.sh test-virt-ls.sh
> +endif ENABLE_APPLIANCE
> diff --git a/clone/Makefile.am b/clone/Makefile.am
> index 3c54843..4d586c6 100644
> --- a/clone/Makefile.am
> +++ b/clone/Makefile.am
> @@ -46,4 +46,6 @@ TESTS_ENVIRONMENT = \
>  	MALLOC_PERTURB_=$(random_val) \
>  	$(top_builddir)/run
>  
> +if ENABLE_APPLIANCE
>  TESTS = test-virt-sysprep.sh
> +endif ENABLE_APPLIANCE
> diff --git a/df/Makefile.am b/df/Makefile.am
> index 455f45d..83409da 100644
> --- a/df/Makefile.am
> +++ b/df/Makefile.am
> @@ -80,4 +80,6 @@ TESTS_ENVIRONMENT = \
>  	MALLOC_PERTURB_=$(random_val) \
>  	$(top_builddir)/run
>  
> +if ENABLE_APPLIANCE
>  TESTS = test-virt-df.sh
> +endif ENABLE_APPLIANCE
> diff --git a/edit/Makefile.am b/edit/Makefile.am
> index c359c28..e89136a 100644
> --- a/edit/Makefile.am
> +++ b/edit/Makefile.am
> @@ -72,4 +72,6 @@ TESTS_ENVIRONMENT = \
>  	MALLOC_PERTURB_=$(random_val) \
>  	$(top_builddir)/run
>  
> +if ENABLE_APPLIANCE
>  TESTS = test-virt-edit.sh
> +endif ENABLE_APPLIANCE
> diff --git a/fish/Makefile.am b/fish/Makefile.am
> index ffe3ede..8a6f88b 100644
> --- a/fish/Makefile.am
> +++ b/fish/Makefile.am
> @@ -238,15 +238,19 @@ TESTS_ENVIRONMENT = \
>  
>  TESTS = \
>  	test-add-domain.sh \
> -	test-copy.sh \
> -	test-find0.sh \
>  	test-guestfish-a.sh \
>  	test-guestfish-d.sh \
>  	test-guestfish-escapes.sh \
>  	test-guestfish-events.sh \
> -	test-guestfish-tilde.sh \
> +	test-guestfish-tilde.sh
> +
> +if ENABLE_APPLIANCE
> +TESTS += \
> +	test-copy.sh \
> +	test-find0.sh \
>  	test-read_file.sh \
>  	test-remote.sh \
>  	test-reopen.sh \
>  	test-stringlist.sh \
>  	test-upload-to-dir.sh
> +endif
> diff --git a/fuse/Makefile.am b/fuse/Makefile.am
> index d6db45c..19c498b 100644
> --- a/fuse/Makefile.am
> +++ b/fuse/Makefile.am
> @@ -74,8 +74,10 @@ stamp-guestmount.pod: guestmount.pod
>  
>  # Tests.
>  
> +if ENABLE_APPLIANCE
>  TESTS = test-fuse.sh
> +endif ENABLE_APPLIANCE
>  TESTS_ENVIRONMENT = \
>  	top_builddir=..
>  
> -endif
> +endif HAVE_FUSE
> diff --git a/haskell/Makefile.am b/haskell/Makefile.am
> index 2321bbc..8dd2244 100644
> --- a/haskell/Makefile.am
> +++ b/haskell/Makefile.am
> @@ -31,7 +31,10 @@ TESTS_ENVIRONMENT = \
>  	$(VG) \
>  	$(top_builddir)/run
>  
> -TESTS = run-bindtests Guestfs005Load Guestfs010Basic
> +TESTS = run-bindtests
> +if ENABLE_APPLIANCE
> +TESTS += Guestfs005Load Guestfs010Basic
> +endif ENABLE_APPLIANCE
>  
>  check_DATA = Bindtests
>  
> diff --git a/java/Makefile.am b/java/Makefile.am
> index a96d304..ef78773 100644
> --- a/java/Makefile.am
> +++ b/java/Makefile.am
> @@ -102,7 +102,11 @@ install-data-hook:
>  
>  # Tests (not comprehensive).
>  
> -TESTS = run-bindtests run-java-tests
> +TESTS = run-bindtests
> +if ENABLE_APPLIANCE
> +TESTS += run-java-tests
> +endif ENABLE_APPLIANCE
> +
>  TESTS_ENVIRONMENT = \
>  	JAVA=$(JAVA) \
>  	CLASSPATH=.:t:libguestfs-$(VERSION).jar \
> diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
> index c7eb2cc..76b0374 100644
> --- a/ocaml/Makefile.am
> +++ b/ocaml/Makefile.am
> @@ -79,11 +79,15 @@ TESTS_ENVIRONMENT = \
>  
>  TESTS = run-bindtests \
>  	t/guestfs_005_load \
> -	t/guestfs_010_basic \
> -	t/guestfs_070_threads \
>  	t/guestfs_080_optargs \
> -	t/guestfs_400_events \
> +	t/guestfs_400_events
> +
> +if ENABLE_APPLIANCE
> +TESTS += t/guestfs_010_basic \
> +	t/guestfs_070_threads \
>  	t/guestfs_400_progress
> +endif
> +
>  noinst_DATA += bindtests \
>  	t/guestfs_005_load \
>  	t/guestfs_010_basic \
> diff --git a/perl/Makefile.am b/perl/Makefile.am
> index 7fc0eb6..404a4e9 100644
> --- a/perl/Makefile.am
> +++ b/perl/Makefile.am
> @@ -46,9 +46,15 @@ src_deps: $(top_builddir)/src/libguestfs.la $(generator_built)
>  test_images:
>  	$(MAKE) -C $(top_builddir)/tests/data
>  
> -TESTS = run-bindtests run-perl-tests
> +TESTS = run-bindtests
> +test_prereq = src_deps all test_images
>  
> -$(TESTS): src_deps all appliance test_images
> +if ENABLE_APPLIANCE
> +test_prereq += appliance
> +TESTS += run-perl-tests
> +endif
> +
> +$(TESTS): $(test_prereq)
>  
>  TESTS_ENVIRONMENT = \
>  	$(top_builddir)/run
> diff --git a/python/Makefile.am b/python/Makefile.am
> index b2c69e6..2731a43 100644
> --- a/python/Makefile.am
> +++ b/python/Makefile.am
> @@ -51,6 +51,10 @@ TESTS_ENVIRONMENT = \
>  	TMPDIR=$(top_builddir) \
>  	PYTHON=$(PYTHON)
>  
> -TESTS = run-bindtests run-python-tests
> +TESTS = run-bindtests
>  
> -endif
> +if ENABLE_APPLIANCE
> +TESTS += run-python-tests
> +endif ENABLE_APPLIANCE
> +
> +endif HAVE_PYTHON
> diff --git a/resize/Makefile.am b/resize/Makefile.am
> index 0d64028..bbae32f 100644
> --- a/resize/Makefile.am
> +++ b/resize/Makefile.am
> @@ -105,7 +105,10 @@ TESTS_ENVIRONMENT = \
>  	MALLOC_PERTURB_=$(random_val) \
>  	$(top_builddir)/run
>  
> -TESTS = test-virt-resize.sh utils_tests
> +TESTS = utils_tests
> +if ENABLE_APPLIANCE
> +TESTS += test-virt-resize.sh
> +endif
>  
>  # Dependencies.
>  depend: .depend
> diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am
> index 76d9022..17ee638 100644
> --- a/sparsify/Makefile.am
> +++ b/sparsify/Makefile.am
> @@ -98,7 +98,9 @@ TESTS_ENVIRONMENT = \
>  	MALLOC_PERTURB_=$(random_val) \
>  	$(top_builddir)/run
>  
> +if ENABLE_APPLIANCE
>  TESTS = test-virt-sparsify.sh
> +endif ENABLE_APPLIANCE
>  
>  # Dependencies.
>  depend: .depend
> diff --git a/tools/Makefile.am b/tools/Makefile.am
> index 82b5852..0a7cfaa 100644
> --- a/tools/Makefile.am
> +++ b/tools/Makefile.am
> @@ -61,9 +61,11 @@ TESTS_ENVIRONMENT = \
>  	MALLOC_PERTURB_=$(random_val) \
>  	$(top_builddir)/run
>  
> +if ENABLE_APPLIANCE
>  TESTS = test-virt-list-filesystems.sh \
>  	test-virt-make-fs.sh \
>  	test-virt-tar.sh
> +endif ENABLE_APPLIANCE
>  
>  endif
>  
> -- 
> 1.7.8.3

ACK.

Be careful when you apply this because it conflicts with Matt's
GObject series.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org




More information about the Libguestfs mailing list