[Libguestfs] [PATCH 2/2] golang: Don't run launch test if appliance has not been built.
Richard W.M. Jones
rjones at redhat.com
Fri Dec 13 08:32:59 UTC 2013
On Fri, Dec 13, 2013 at 12:00:13AM +0100, Hilko Bengen wrote:
> ---
> golang/Makefile.am | 7 ++++++-
> golang/src/libguestfs.org/guestfs/guestfs_100_launch_test.go | 2 ++
> 2 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/golang/Makefile.am b/golang/Makefile.am
> index a60c9ba..f59488e 100644
> --- a/golang/Makefile.am
> +++ b/golang/Makefile.am
> @@ -37,6 +37,11 @@ EXTRA_DIST = \
>
> if HAVE_GOLANG
>
> +GOFLAGS =
> +if ENABLE_APPLIANCE
> +GOFLAGS += -tags appliance
> +endif
> +
> golangpkgdir = $(GOROOT)/pkg/$(GOOS)_$(GOARCH)/$(pkg)
> golangsrcdir = $(GOROOT)/src/pkg/$(pkg)
>
> @@ -49,7 +54,7 @@ pkg/$(GOOS)_$(GOARCH)/$(pkg).a: src/$(pkg)/guestfs.go
>
> golangsrc_DATA = $(source_files)
>
> -TESTS_ENVIRONMENT = pkg=$(pkg) $(top_builddir)/run $(VG) # --test
> +TESTS_ENVIRONMENT = pkg=$(pkg) GOFLAGS="$(GOFLAGS)" $(top_builddir)/run $(VG) # --test
>
> TESTS = run-bindtests run-tests
>
> diff --git a/golang/src/libguestfs.org/guestfs/guestfs_100_launch_test.go b/golang/src/libguestfs.org/guestfs/guestfs_100_launch_test.go
> index cddc42d..9511819 100644
> --- a/golang/src/libguestfs.org/guestfs/guestfs_100_launch_test.go
> +++ b/golang/src/libguestfs.org/guestfs/guestfs_100_launch_test.go
> @@ -1,3 +1,5 @@
> +// +build appliance
> +
> /* libguestfs Go tests
> * Copyright (C) 2013 Red Hat Inc.
> *
> --
> 1.8.5.1
>
> _______________________________________________
> Libguestfs mailing list
> Libguestfs at redhat.com
> https://www.redhat.com/mailman/listinfo/libguestfs
ACK.
Thanks,
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