[Libguestfs] [PATCH 2/3] tests: fix srcdir!=builddir runs

Richard W.M. Jones rjones at redhat.com
Wed May 7 08:58:50 UTC 2014


On Fri, May 02, 2014 at 12:29:08PM +0200, Pino Toscano wrote:
> Export $(srcdir) for the tests, so a test script which invokes other
> script(s) can locate them properly.

Part of this patch should not be needed.  According to
automake.info:

     Test programs that need data files should look for them in 'srcdir'
  (which is both a make variable and an environment variable made
  available to the tests), so that they work when building in a separate
  directory (*note Build Directories: (autoconf)Build Directories.), and
  in particular for the 'distcheck' rule (*note Checking the
  Distribution::).

Rich.

>  tests/Makefile.am                    | 2 ++
>  tests/test-binaries-exist-network.sh | 2 +-
>  tests/test-build-bash-network.sh     | 2 +-
>  tests/test-harder-network.sh         | 2 +-
>  4 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index 03c97b3..dc73737 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -33,3 +33,5 @@ TESTS += \
>  	test-binaries-exist-network.sh \
>  	test-harder-network.sh
>  endif
> +
> +TESTS_ENVIRONMENT = srcdir='$(srcdir)'
> diff --git a/tests/test-binaries-exist-network.sh b/tests/test-binaries-exist-network.sh
> index 19c3830..3fba38e 100755
> --- a/tests/test-binaries-exist-network.sh
> +++ b/tests/test-binaries-exist-network.sh
> @@ -1,2 +1,2 @@
>  #!/bin/sh
> -USE_NETWORK=1 ./test-binaries-exist.sh
> +USE_NETWORK=1 $srcdir/test-binaries-exist.sh
> diff --git a/tests/test-build-bash-network.sh b/tests/test-build-bash-network.sh
> index a80da4d..5c55243 100755
> --- a/tests/test-build-bash-network.sh
> +++ b/tests/test-build-bash-network.sh
> @@ -1,3 +1,3 @@
>  #!/bin/sh
>  
> -USE_NETWORK=1 ./test-build-bash.sh
> +USE_NETWORK=1 $srcdir/test-build-bash.sh
> diff --git a/tests/test-harder-network.sh b/tests/test-harder-network.sh
> index d1c1e99..0acdabd 100755
> --- a/tests/test-harder-network.sh
> +++ b/tests/test-harder-network.sh
> @@ -1,3 +1,3 @@
>  #!/bin/sh
>  
> -USE_NETWORK=1 ./test-harder.sh
> +USE_NETWORK=1 $srcdir/test-harder.sh
> -- 
> 1.9.0
> 
> _______________________________________________
> Libguestfs mailing list
> Libguestfs at redhat.com
> https://www.redhat.com/mailman/listinfo/libguestfs

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top




More information about the Libguestfs mailing list