From cfb0dca6ec0cf51c934552e18b5d70ad1b12354e Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 24 Nov 2008 19:23:39 +0000 Subject: [PATCH] Fix test suite build when Xen driver is disabled --- ChangeLog | 9 ++++++++ tests/Makefile.am | 48 ++++++++++++++++++++++++++++++------------- tests/sexpr2xmltest.c | 10 --------- tests/testutilsxen.c | 2 -- tests/xencapstest.c | 11 ---------- tests/xmconfigtest.c | 10 --------- tests/xml2sexprtest.c | 7 ------- 7 files changed, 43 insertions(+), 54 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb1bdf78cd..98ecc9013b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Mon Nov 24 19:22:40 GMT 2008 Dnaiel P. Berrange + + * tests/Makefile.am, tests/sexpr2xmltest.c, + tests/testutilsxen.c, tests/xencapstest.c, + tests/xmconfigtest.c, tests/xml2sexprtest.c: Disable all + Xen tests when Xen driver build is disabled. Remove unneccessary + WITH_XEN conditionals from source, since the entire build + is disabled in Makefile.am + Mon Nov 24 16:49:40 GMT 2008 Dnaiel P. Berrange * autobuild.sh: Disable UML driver on mingw32 biuld diff --git a/tests/Makefile.am b/tests/Makefile.am index 1efa0c83f6..9752cbf69e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -43,10 +43,13 @@ EXTRA_DIST = \ nodeinfodata \ domainschematest -noinst_PROGRAMS = xmlrpctest xml2sexprtest sexpr2xmltest virshtest conftest \ - reconnect xmconfigtest xencapstest \ +noinst_PROGRAMS = xmlrpctest virshtest conftest \ nodeinfotest statstest qparamtest +if WITH_XEN +noinst_PROGRAMS += xml2sexprtest sexpr2xmltest \ + reconnect xmconfigtest xencapstest +endif if WITH_QEMU noinst_PROGRAMS += qemuxml2argvtest qemuxml2xmltest endif @@ -68,12 +71,22 @@ endif EXTRA_DIST += $(test_scripts) -TESTS = xml2sexprtest sexpr2xmltest virshtest xmconfigtest \ - xencapstest nodeinfotest \ - statstest qparamtest $(test_scripts) +TESTS = virshtest \ + nodeinfotest \ + statstest \ + qparamtest \ + $(test_scripts) + +if WITH_XEN +TESTS += xml2sexprtest \ + sexpr2xmltest \ + xmconfigtest \ + xencapstest if ENABLE_XEN_TESTS - TESTS += reconnect +TESTS += reconnect endif +endif + if WITH_QEMU TESTS += qemuxml2argvtest qemuxml2xmltest endif @@ -105,6 +118,7 @@ xmlrpctest_SOURCES = \ xmlrpctest_LDADD = $(LDADDS) +if WITH_XEN xml2sexprtest_SOURCES = \ xml2sexprtest.c testutilsxen.c testutilsxen.h \ testutils.c testutils.h @@ -120,6 +134,20 @@ xmconfigtest_SOURCES = \ testutils.c testutils.h xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS) +xencapstest_SOURCES = \ + xencapstest.c testutils.h testutils.c +xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS) + +reconnect_SOURCES = \ + reconnect.c +reconnect_LDADD = $(LDADDS) + +else +EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \ + xencapstest.c reconnect.c \ + testutilsxen.c testutilsxen.h +endif + if WITH_QEMU qemuxml2argvtest_SOURCES = \ qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \ @@ -143,10 +171,6 @@ conftest_SOURCES = \ conftest.c conftest_LDADD = $(LDADDS) -xencapstest_SOURCES = \ - xencapstest.c testutils.h testutils.c -xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS) - nodeinfotest_SOURCES = \ nodeinfotest.c testutils.h testutils.c nodeinfotest_LDADD = $(LDADDS) @@ -159,8 +183,4 @@ qparamtest_SOURCES = \ qparamtest.c testutils.h testutils.c qparamtest_LDADD = $(LDADDS) -reconnect_SOURCES = \ - reconnect.c -reconnect_LDADD = $(LDADDS) - CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c index d36bc72fea..9e8bac4480 100644 --- a/tests/sexpr2xmltest.c +++ b/tests/sexpr2xmltest.c @@ -4,8 +4,6 @@ #include #include -#ifdef WITH_XEN - #include "internal.h" #include "xml.h" #include "xend_internal.h" @@ -146,11 +144,3 @@ mymain(int argc, char **argv) VIRT_TEST_MAIN(mymain) -#else /* WITHOUT_XEN */ -int -main(void) -{ - fprintf(stderr, "libvirt compiled without Xen support\n"); - return(0); -} -#endif /* WITH_XEN */ diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c index a16d91291f..7685bd2cde 100644 --- a/tests/testutilsxen.c +++ b/tests/testutilsxen.c @@ -1,6 +1,5 @@ #include -#ifdef WITH_XEN #include #include @@ -52,4 +51,3 @@ cleanup: virCapabilitiesFree(caps); return NULL; } -#endif diff --git a/tests/xencapstest.c b/tests/xencapstest.c index 1c173d3b4e..24b338ffaf 100644 --- a/tests/xencapstest.c +++ b/tests/xencapstest.c @@ -5,8 +5,6 @@ #include #include -#ifdef WITH_XEN - #include "internal.h" #include "xml.h" #include "testutils.h" @@ -225,12 +223,3 @@ mymain(int argc, char **argv) VIRT_TEST_MAIN(mymain) -#else /* !WITH_XEN */ - -int -main (void) -{ - exit (EXIT_SUCCESS); -} - -#endif /* !WITH_XEN */ diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index b88637f1c5..0577da5ae6 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -27,8 +27,6 @@ #include #include -#ifdef WITH_XEN - #include "internal.h" #include "datatypes.h" #include "xen_unified.h" @@ -239,11 +237,3 @@ mymain(int argc, char **argv) VIRT_TEST_MAIN(mymain) -#else /* WITHOUT_XEN */ -int -main(void) -{ - fprintf(stderr, "libvirt compiled without Xen support\n"); - return(0); -} -#endif /* WITH_XEN */ diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c index aee006a7cc..b05e6c8d66 100644 --- a/tests/xml2sexprtest.c +++ b/tests/xml2sexprtest.c @@ -8,8 +8,6 @@ #include #include -#if WITH_XEN - #include "internal.h" #include "xend_internal.h" #include "testutils.h" @@ -155,8 +153,3 @@ mymain(int argc, char **argv) VIRT_TEST_MAIN(mymain) -#else /* WITH_XEN */ - -int main (void) { exit (77); /* means 'test skipped' for automake */ } - -#endif /* ! WITH_XEN */