[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 2/2] tests: old automake lacks abs_builddir



On RHEL 5, 'make check' included failures such as:

TEST: virstoragetest
unable to create directory /virstoragedata/sub
unable to return to correct directory, refusing to clean up /virstoragedata

It turns out that with automake 1.9.x, $(abs_builddir) is not
automatically provided.  We have previously worked around this
by using `pwd` before, but because we did not do it everywhere,
we had a number of broken tests.

This patch brings RHEL 5 from 8 failed tests down to 5 (the
remaining failures may be due to bugs in the older libxml2 and
RNG schema validation available in RHEL 5, so I'm not sure if
they can be fixed in libvirt, but I'm still investigating).

* tests/Makefile.am (AM_CFLAGS): Reliably set abs_builddir.
(*_la_CFLAGS): Factor out common settings; delete when nothing
remains to be added.
---

Pushing under the build-breaker rule.

 tests/Makefile.am | 25 ++-----------------------
 1 file changed, 2 insertions(+), 23 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0304829..d3a7868 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -15,6 +15,7 @@ INCLUDES = \
 	$(GETTEXT_CPPFLAGS)

 AM_CFLAGS = \
+	-Dabs_builddir="\"`pwd`\"" \
 	$(LIBXML_CFLAGS) \
 	$(GNUTLS_CFLAGS) \
 	$(SASL_CFLAGS) \
@@ -336,9 +337,6 @@ QEMUMONITORTESTUTILS_SOURCES = \
 if WITH_QEMU

 libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)
-libqemumonitortestutils_la_CFLAGS = \
-	-Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
-

 qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
 if WITH_NETWORK
@@ -381,7 +379,6 @@ qemumonitorjsontest_SOURCES = \
 	testutilsqemu.c testutilsqemu.h \
 	$(NULL)
 qemumonitorjsontest_LDADD = $(qemu_LDADDS) libqemumonitortestutils.la
-qemumonitorjsontest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\""  $(AM_CFLAGS)

 domainsnapshotxml2xmltest_SOURCES = \
 	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
@@ -519,12 +516,10 @@ nodeinfotest_LDADD = $(LDADDS)

 commandtest_SOURCES = \
 	commandtest.c testutils.h testutils.c
-commandtest_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
 commandtest_LDADD = $(LDADDS)

 commandhelper_SOURCES = \
 	commandhelper.c
-commandhelper_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
 commandhelper_LDADD = $(LDADDS)
 commandhelper_LDFLAGS = -static

@@ -532,7 +527,6 @@ if WITH_LIBVIRTD
 libvirtdconftest_SOURCES = \
 	libvirtdconftest.c testutils.h testutils.c \
 	../daemon/libvirtd-config.c
-libvirtdconftest_CFLAGS = $(AM_CFLAGS)
 libvirtdconftest_LDADD = $(LDADDS)
 else
 EXTRA_DIST += libvirtdconftest.c
@@ -540,19 +534,16 @@ endif

 virnetmessagetest_SOURCES = \
 	virnetmessagetest.c testutils.h testutils.c
-virnetmessagetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" \
-		$(XDR_CFLAGS) $(AM_CFLAGS)
+virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
 virnetmessagetest_LDADD = $(LDADDS)

 virnetsockettest_SOURCES = \
 	virnetsockettest.c testutils.h testutils.c
-virnetsockettest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
 virnetsockettest_LDADD = $(LDADDS)

 if WITH_GNUTLS
 virnettlscontexttest_SOURCES = \
 	virnettlscontexttest.c testutils.h testutils.c
-virnettlscontexttest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
 virnettlscontexttest_LDADD = $(LDADDS)
 if HAVE_LIBTASN1
 virnettlscontexttest_SOURCES += pkix_asn1_tab.c
@@ -567,27 +558,22 @@ endif

 virtimetest_SOURCES = \
 	virtimetest.c testutils.h testutils.c
-virtimetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
 virtimetest_LDADD = $(LDADDS)

 virstringtest_SOURCES = \
 	virstringtest.c testutils.h testutils.c
-virstringtest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
 virstringtest_LDADD = $(LDADDS)

 virstoragetest_SOURCES = \
 	virstoragetest.c testutils.h testutils.c
-virstoragetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
 virstoragetest_LDADD = $(LDADDS)

 virlockspacetest_SOURCES = \
 	virlockspacetest.c testutils.h testutils.c
-virlockspacetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
 virlockspacetest_LDADD = $(LDADDS)

 virportallocatortest_SOURCES = \
 	virportallocatortest.c testutils.h testutils.c
-virportallocatortest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
 virportallocatortest_LDADD = $(LDADDS)

 libvirportallocatormock_la_SOURCES = \
@@ -599,17 +585,14 @@ libvirportallocatormock_la_LDFLAGS = -module -avoid-version \

 viruritest_SOURCES = \
 	viruritest.c testutils.h testutils.c
-viruritest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
 viruritest_LDADD = $(LDADDS)

 virkeyfiletest_SOURCES = \
 	virkeyfiletest.c testutils.h testutils.c
-virkeyfiletest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
 virkeyfiletest_LDADD = $(LDADDS)

 virauthconfigtest_SOURCES = \
 	virauthconfigtest.c testutils.h testutils.c
-virauthconfigtest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
 virauthconfigtest_LDADD = $(LDADDS)

 seclabeltest_SOURCES = \
@@ -625,13 +608,11 @@ endif

 libsecurityselinuxhelper_la_SOURCES = \
 	securityselinuxhelper.c
-libsecurityselinuxhelper_la_CFLAGS = $(AM_CFLAGS)
 libsecurityselinuxhelper_la_LDFLAGS = -module -avoid-version \
         -rpath /evil/libtool/hack/to/force/shared/lib/creation

 securityselinuxtest_SOURCES = \
 	securityselinuxtest.c testutils.h testutils.c
-securityselinuxtest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
 securityselinuxtest_LDADD = $(LDADDS)
 securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la ../src/libvirt.la

@@ -640,7 +621,6 @@ if WITH_ATTR
 securityselinuxlabeltest_SOURCES = \
 	securityselinuxlabeltest.c testutils.h testutils.c \
         testutilsqemu.h testutilsqemu.c
-securityselinuxlabeltest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
 securityselinuxlabeltest_LDADD = $(qemu_LDADDS)
 securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la ../src/libvirt.la
 endif
@@ -679,7 +659,6 @@ utiltest_LDADD = $(LDADDS)
 if WITH_DRIVER_MODULES
 virdrivermoduletest_SOURCES = \
 	virdrivermoduletest.c testutils.h testutils.c
-virdrivermoduletest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
 virdrivermoduletest_LDADD = $(LDADDS)
 endif

-- 
1.8.1.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]