]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: fix testing of augeas files in VPATH builds
authorEric Blake <eblake@redhat.com>
Tue, 29 May 2012 21:49:13 +0000 (15:49 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 30 May 2012 15:29:32 +0000 (09:29 -0600)
Without this fix, a VPATH build (such as used by ./autobuild.sh)
fails with messages like:

make[3]: Entering directory `/home/remote/eblake/libvirt-tmp2/build/daemon'
../../build-aux/augeas-gentest.pl libvirtd.conf ../../daemon/test_libvirtd.aug.in test_libvirtd.aug
cannot read libvirtd.conf: No such file or directory at ../../build-aux/augeas-gentest.pl line 38.

Since the test files are not part of the tarball, we can generate
them into the build dir, but rather than create a subdirectory
just for the test file, it is easier to test them directly in
libvirt.git/src.

* daemon/Makefile.am (AUG_GENTEST): Factor out definition.
(test_libvirtd.aug): Look for correct file.
* src/Makefile.am (AUG_GENTEST): Use $(PERL).
(qemu/test_libvirtd_qemu.aug, lxc/test_libvirtd_lxc.aug)
(locking/test_libvirt_sanlock.aug): Rename to avoid subdirectories.
(check-augeas-qemu, check-augeas-lxc, check-augeas-sanlock): Reflect
location of built tests.
* configure.ac (PERL): Substitute perl.

.gitignore
configure.ac
daemon/Makefile.am
src/Makefile.am

index 50ff3bf7d2e2f5544ab1554cb785fe60ff3e8c84..d535398622dc0961cb86b53492ece2760147e040 100644 (file)
 /src/remote/*_protocol.[ch]
 /src/rpc/virkeepaliveprotocol.[ch]
 /src/rpc/virnetprotocol.[ch]
+/src/test_libvirt*.aug
 /src/util/virkeymaps.h
 /src/virt-aa-helper
 /tests/*.log
index 59962c5133e02f5f01703b67bd4f3b3700df48f4..7d8d26b1e60081bdff8ae47f6e60c13bfc8fa98d 100644 (file)
@@ -2243,6 +2243,9 @@ AM_CONDITIONAL([WITH_PYTHON], [test "$with_python" = "yes"])
 AC_SUBST([PYTHON_VERSION])
 AC_SUBST([PYTHON_INCLUDES])
 
+dnl Allow perl overrides
+AC_PATH_PROG([PERL], [perl])
+
 AC_ARG_ENABLE([with-test-suite],
               AC_HELP_STRING([--with-test-suite], [build test suite by default @<:@default=check@:>@]),
               [case "${withval}" in
index daf24ea48ac05f53c0b47f7c79f5486e90f23bdb..08e37a9db758b83471df034888ea014ee967de60 100644 (file)
@@ -351,12 +351,14 @@ libvirtd.service: libvirtd.service.in $(top_builddir)/config.status
 
 check-local: check-augeas
 
-test_libvirtd.aug: test_libvirtd.aug.in libvirtd.conf
-       $(AM_V_GEN)$(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl libvirtd.conf $< $@
+AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
+
+test_libvirtd.aug: test_libvirtd.aug.in $(srcdir)/libvirtd.conf
+       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/libvirtd.conf $< $@
 
 check-augeas: test_libvirtd.aug
        $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
-         '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug; \
+         '$(AUGPARSE)' -I $(srcdir) test_libvirtd.aug; \
        fi
 
 
index 1fde93697175c6e11f58917502de8ea7f7ba6bd1..d7beea6a11ace148424a96f084639cf84a3a51ef 100644 (file)
@@ -782,8 +782,8 @@ libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
 conf_DATA += qemu/qemu.conf
 
 augeas_DATA += qemu/libvirtd_qemu.aug
-augeastest_DATA += qemu/test_libvirtd_qemu.aug
-CLEANFILES += qemu/test_libvirtd_qemu.aug
+augeastest_DATA += test_libvirtd_qemu.aug
+CLEANFILES += test_libvirtd_qemu.aug
 
 endif
 EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
@@ -823,8 +823,8 @@ libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
 conf_DATA += lxc/lxc.conf
 
 augeas_DATA += lxc/libvirtd_lxc.aug
-augeastest_DATA += lxc/test_libvirtd_lxc.aug
-CLEANFILES += lxc/test_libvirtd_lxc.aug
+augeastest_DATA += test_libvirtd_lxc.aug
+CLEANFILES += test_libvirtd_lxc.aug
 
 endif
 EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
@@ -1119,41 +1119,41 @@ check-local: check-augeas
 
 check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock
 
-AUG_GENTEST = $(top_srcdir)/build-aux/augeas-gentest.pl
+AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
 
 if WITH_QEMU
-qemu/test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in qemu/qemu.conf $(AUG_GENTEST)
-       $(AM_V_GEN)$(AUG_GENTEST) qemu/qemu.conf $< $@
+test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
+               $(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
+       $(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
 
-check-augeas-qemu: qemu/test_libvirtd_qemu.aug
+check-augeas-qemu: test_libvirtd_qemu.aug
        $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
-           '$(AUGPARSE)' -I $(srcdir)/qemu \
-           $(srcdir)/qemu/test_libvirtd_qemu.aug; \
+           '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
        fi
 else
 check-augeas-qemu:
 endif
 
 if WITH_LXC
-lxc/test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in lxc/lxc.conf $(AUG_GENTEST)
-       $(AM_V_GEN)$(AUG_GENTEST) lxc/lxc.conf $< $@
+test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
+               $(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
+       $(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
 
-check-augeas-lxc: lxc/test_libvirtd_lxc.aug
+check-augeas-lxc: test_libvirtd_lxc.aug
        $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
-           '$(AUGPARSE)' -I $(srcdir)/lxc \
-           $(srcdir)/lxc/test_libvirtd_lxc.aug; \
+           '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
        fi
 else
 check-augeas-lxc:
 endif
 
-locking/test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in locking/qemu-sanlock.conf $(AUG_GENTEST)
-       $(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
+test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
+               locking/qemu-sanlock.conf $(AUG_GENTEST)
+       $(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
 
-check-augeas-sanlock: locking/test_libvirt_sanlock.aug
+check-augeas-sanlock: test_libvirt_sanlock.aug
        $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
-           '$(AUGPARSE)' -I $(srcdir)/locking \
-           $(srcdir)/locking/test_libvirt_sanlock.aug; \
+           '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
        fi
 
 #
@@ -1357,8 +1357,8 @@ sanlock_la_LIBADD = -lsanlock_client \
                ../gnulib/lib/libgnu.la
 
 augeas_DATA += locking/libvirt_sanlock.aug
-augeastest_DATA += locking/test_libvirt_sanlock.aug
-CLEANFILES += locking/test_libvirt_sanlock.aug
+augeastest_DATA += test_libvirt_sanlock.aug
+CLEANFILES += test_libvirt_sanlock.aug
 
 $(builddir)/locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
        $(AM_V_GEN)$(MKDIR_P) locking ; \