Fix test suite build when Xen driver is disabled

This commit is contained in:
Daniel P. Berrange 2008-11-24 19:23:39 +00:00
parent 6f5600c803
commit cfb0dca6ec
7 changed files with 43 additions and 54 deletions

View File

@ -1,3 +1,12 @@
Mon Nov 24 19:22:40 GMT 2008 Dnaiel P. Berrange <berrange@redhat.com>
* 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 <berrange@redhat.com> Mon Nov 24 16:49:40 GMT 2008 Dnaiel P. Berrange <berrange@redhat.com>
* autobuild.sh: Disable UML driver on mingw32 biuld * autobuild.sh: Disable UML driver on mingw32 biuld

View File

@ -43,10 +43,13 @@ EXTRA_DIST = \
nodeinfodata \ nodeinfodata \
domainschematest domainschematest
noinst_PROGRAMS = xmlrpctest xml2sexprtest sexpr2xmltest virshtest conftest \ noinst_PROGRAMS = xmlrpctest virshtest conftest \
reconnect xmconfigtest xencapstest \
nodeinfotest statstest qparamtest nodeinfotest statstest qparamtest
if WITH_XEN
noinst_PROGRAMS += xml2sexprtest sexpr2xmltest \
reconnect xmconfigtest xencapstest
endif
if WITH_QEMU if WITH_QEMU
noinst_PROGRAMS += qemuxml2argvtest qemuxml2xmltest noinst_PROGRAMS += qemuxml2argvtest qemuxml2xmltest
endif endif
@ -68,12 +71,22 @@ endif
EXTRA_DIST += $(test_scripts) EXTRA_DIST += $(test_scripts)
TESTS = xml2sexprtest sexpr2xmltest virshtest xmconfigtest \ TESTS = virshtest \
xencapstest nodeinfotest \ nodeinfotest \
statstest qparamtest $(test_scripts) statstest \
qparamtest \
$(test_scripts)
if WITH_XEN
TESTS += xml2sexprtest \
sexpr2xmltest \
xmconfigtest \
xencapstest
if ENABLE_XEN_TESTS if ENABLE_XEN_TESTS
TESTS += reconnect TESTS += reconnect
endif endif
endif
if WITH_QEMU if WITH_QEMU
TESTS += qemuxml2argvtest qemuxml2xmltest TESTS += qemuxml2argvtest qemuxml2xmltest
endif endif
@ -105,6 +118,7 @@ xmlrpctest_SOURCES = \
xmlrpctest_LDADD = $(LDADDS) xmlrpctest_LDADD = $(LDADDS)
if WITH_XEN
xml2sexprtest_SOURCES = \ xml2sexprtest_SOURCES = \
xml2sexprtest.c testutilsxen.c testutilsxen.h \ xml2sexprtest.c testutilsxen.c testutilsxen.h \
testutils.c testutils.h testutils.c testutils.h
@ -120,6 +134,20 @@ xmconfigtest_SOURCES = \
testutils.c testutils.h testutils.c testutils.h
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS) 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 if WITH_QEMU
qemuxml2argvtest_SOURCES = \ qemuxml2argvtest_SOURCES = \
qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \ qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
@ -143,10 +171,6 @@ conftest_SOURCES = \
conftest.c conftest.c
conftest_LDADD = $(LDADDS) conftest_LDADD = $(LDADDS)
xencapstest_SOURCES = \
xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
nodeinfotest_SOURCES = \ nodeinfotest_SOURCES = \
nodeinfotest.c testutils.h testutils.c nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS) nodeinfotest_LDADD = $(LDADDS)
@ -159,8 +183,4 @@ qparamtest_SOURCES = \
qparamtest.c testutils.h testutils.c qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS) qparamtest_LDADD = $(LDADDS)
reconnect_SOURCES = \
reconnect.c
reconnect_LDADD = $(LDADDS)
CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda

View File

@ -4,8 +4,6 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#ifdef WITH_XEN
#include "internal.h" #include "internal.h"
#include "xml.h" #include "xml.h"
#include "xend_internal.h" #include "xend_internal.h"
@ -146,11 +144,3 @@ mymain(int argc, char **argv)
VIRT_TEST_MAIN(mymain) VIRT_TEST_MAIN(mymain)
#else /* WITHOUT_XEN */
int
main(void)
{
fprintf(stderr, "libvirt compiled without Xen support\n");
return(0);
}
#endif /* WITH_XEN */

View File

@ -1,6 +1,5 @@
#include <config.h> #include <config.h>
#ifdef WITH_XEN
#include <sys/utsname.h> #include <sys/utsname.h>
#include <stdlib.h> #include <stdlib.h>
@ -52,4 +51,3 @@ cleanup:
virCapabilitiesFree(caps); virCapabilitiesFree(caps);
return NULL; return NULL;
} }
#endif

View File

@ -5,8 +5,6 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#ifdef WITH_XEN
#include "internal.h" #include "internal.h"
#include "xml.h" #include "xml.h"
#include "testutils.h" #include "testutils.h"
@ -225,12 +223,3 @@ mymain(int argc, char **argv)
VIRT_TEST_MAIN(mymain) VIRT_TEST_MAIN(mymain)
#else /* !WITH_XEN */
int
main (void)
{
exit (EXIT_SUCCESS);
}
#endif /* !WITH_XEN */

View File

@ -27,8 +27,6 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#ifdef WITH_XEN
#include "internal.h" #include "internal.h"
#include "datatypes.h" #include "datatypes.h"
#include "xen_unified.h" #include "xen_unified.h"
@ -239,11 +237,3 @@ mymain(int argc, char **argv)
VIRT_TEST_MAIN(mymain) VIRT_TEST_MAIN(mymain)
#else /* WITHOUT_XEN */
int
main(void)
{
fprintf(stderr, "libvirt compiled without Xen support\n");
return(0);
}
#endif /* WITH_XEN */

View File

@ -8,8 +8,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#if WITH_XEN
#include "internal.h" #include "internal.h"
#include "xend_internal.h" #include "xend_internal.h"
#include "testutils.h" #include "testutils.h"
@ -155,8 +153,3 @@ mymain(int argc, char **argv)
VIRT_TEST_MAIN(mymain) VIRT_TEST_MAIN(mymain)
#else /* WITH_XEN */
int main (void) { exit (77); /* means 'test skipped' for automake */ }
#endif /* ! WITH_XEN */