提交 fb59cf7a 编写于 作者: E Eric Blake

build: fix testing of augeas files in VPATH builds

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.
上级 aabf77aa
...@@ -109,6 +109,7 @@ ...@@ -109,6 +109,7 @@
/src/remote/*_protocol.[ch] /src/remote/*_protocol.[ch]
/src/rpc/virkeepaliveprotocol.[ch] /src/rpc/virkeepaliveprotocol.[ch]
/src/rpc/virnetprotocol.[ch] /src/rpc/virnetprotocol.[ch]
/src/test_libvirt*.aug
/src/util/virkeymaps.h /src/util/virkeymaps.h
/src/virt-aa-helper /src/virt-aa-helper
/tests/*.log /tests/*.log
......
...@@ -2243,6 +2243,9 @@ AM_CONDITIONAL([WITH_PYTHON], [test "$with_python" = "yes"]) ...@@ -2243,6 +2243,9 @@ AM_CONDITIONAL([WITH_PYTHON], [test "$with_python" = "yes"])
AC_SUBST([PYTHON_VERSION]) AC_SUBST([PYTHON_VERSION])
AC_SUBST([PYTHON_INCLUDES]) AC_SUBST([PYTHON_INCLUDES])
dnl Allow perl overrides
AC_PATH_PROG([PERL], [perl])
AC_ARG_ENABLE([with-test-suite], AC_ARG_ENABLE([with-test-suite],
AC_HELP_STRING([--with-test-suite], [build test suite by default @<:@default=check@:>@]), AC_HELP_STRING([--with-test-suite], [build test suite by default @<:@default=check@:>@]),
[case "${withval}" in [case "${withval}" in
......
...@@ -351,12 +351,14 @@ libvirtd.service: libvirtd.service.in $(top_builddir)/config.status ...@@ -351,12 +351,14 @@ libvirtd.service: libvirtd.service.in $(top_builddir)/config.status
check-local: check-augeas check-local: check-augeas
test_libvirtd.aug: test_libvirtd.aug.in libvirtd.conf AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
$(AM_V_GEN)$(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl libvirtd.conf $< $@
test_libvirtd.aug: test_libvirtd.aug.in $(srcdir)/libvirtd.conf
$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/libvirtd.conf $< $@
check-augeas: test_libvirtd.aug check-augeas: test_libvirtd.aug
$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \ $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
'$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug; \ '$(AUGPARSE)' -I $(srcdir) test_libvirtd.aug; \
fi fi
......
...@@ -782,8 +782,8 @@ libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES) ...@@ -782,8 +782,8 @@ libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
conf_DATA += qemu/qemu.conf conf_DATA += qemu/qemu.conf
augeas_DATA += qemu/libvirtd_qemu.aug augeas_DATA += qemu/libvirtd_qemu.aug
augeastest_DATA += qemu/test_libvirtd_qemu.aug augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += qemu/test_libvirtd_qemu.aug CLEANFILES += test_libvirtd_qemu.aug
endif endif
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \ EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
...@@ -823,8 +823,8 @@ libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES) ...@@ -823,8 +823,8 @@ libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
conf_DATA += lxc/lxc.conf conf_DATA += lxc/lxc.conf
augeas_DATA += lxc/libvirtd_lxc.aug augeas_DATA += lxc/libvirtd_lxc.aug
augeastest_DATA += lxc/test_libvirtd_lxc.aug augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += lxc/test_libvirtd_lxc.aug CLEANFILES += test_libvirtd_lxc.aug
endif endif
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
...@@ -1119,41 +1119,41 @@ check-local: check-augeas ...@@ -1119,41 +1119,41 @@ check-local: check-augeas
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock 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 if WITH_QEMU
qemu/test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in qemu/qemu.conf $(AUG_GENTEST) test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
$(AM_V_GEN)$(AUG_GENTEST) qemu/qemu.conf $< $@ $(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 \ $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
'$(AUGPARSE)' -I $(srcdir)/qemu \ '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
$(srcdir)/qemu/test_libvirtd_qemu.aug; \
fi fi
else else
check-augeas-qemu: check-augeas-qemu:
endif endif
if WITH_LXC if WITH_LXC
lxc/test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in lxc/lxc.conf $(AUG_GENTEST) test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
$(AM_V_GEN)$(AUG_GENTEST) lxc/lxc.conf $< $@ $(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 \ $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
'$(AUGPARSE)' -I $(srcdir)/lxc \ '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
$(srcdir)/lxc/test_libvirtd_lxc.aug; \
fi fi
else else
check-augeas-lxc: check-augeas-lxc:
endif endif
locking/test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in locking/qemu-sanlock.conf $(AUG_GENTEST) test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@ 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 \ $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
'$(AUGPARSE)' -I $(srcdir)/locking \ '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
$(srcdir)/locking/test_libvirt_sanlock.aug; \
fi fi
# #
...@@ -1357,8 +1357,8 @@ sanlock_la_LIBADD = -lsanlock_client \ ...@@ -1357,8 +1357,8 @@ sanlock_la_LIBADD = -lsanlock_client \
../gnulib/lib/libgnu.la ../gnulib/lib/libgnu.la
augeas_DATA += locking/libvirt_sanlock.aug augeas_DATA += locking/libvirt_sanlock.aug
augeastest_DATA += locking/test_libvirt_sanlock.aug augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += locking/test_libvirt_sanlock.aug CLEANFILES += test_libvirt_sanlock.aug
$(builddir)/locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf $(builddir)/locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
$(AM_V_GEN)$(MKDIR_P) locking ; \ $(AM_V_GEN)$(MKDIR_P) locking ; \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册