Makefile.am 7.3 KB
Newer Older
K
Karel Zak 已提交
1 2
## Process this file with automake to produce Makefile.in

3 4
SHELL = $(PREFERABLY_POSIX_SHELL)

5
SUBDIRS = confdata sexpr2xmldata \
6
  xml2sexprdata xmconfigdata xencapsdata
7

K
Karel Zak 已提交
8
INCLUDES = \
9
	-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
K
Karel Zak 已提交
10
	-I$(top_builddir)/include \
11 12
	-I$(top_srcdir)/include \
	-I$(top_srcdir)/src \
13
	-I$(top_srcdir)/src/util \
14
	-I$(top_srcdir)/src/conf \
15 16
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
17
	$(SASL_CFLAGS) \
18
	$(SELINUX_CFLAGS) \
19
        -DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
20
         $(COVERAGE_CFLAGS) \
21
         $(WARN_CFLAGS)
22

23 24 25 26 27
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
endif

K
Karel Zak 已提交
28 29
LDADDS = \
	@STATIC_BINARIES@ \
30 31
	$(LIBXML_LIBS) \
        $(GNUTLS_LIBS) \
32
        $(SASL_LIBS) \
33
        $(SELINUX_LIBS) \
34
        $(WARN_CFLAGS) \
35
	../src/libvirt_test.la \
36
	../gnulib/lib/libgnu.la \
J
John Levon 已提交
37
	$(LIBSOCKET) \
38
        $(COVERAGE_LDFLAGS)
K
Karel Zak 已提交
39

40 41 42 43 44
qemuhelpdata = \
	kvm-74 \
	kvm-86 \
	qemu-0.10.5 \
	qemu-0.9.1 \
45 46
	qemu-kvm-0.10.5 \
	qemu-kvm-0.11.0-rc2
47

48
EXTRA_DIST =		\
49
        oomtrace.pl     \
50
	test-lib.sh	\
51
	qemuxml2argvdata \
52
	nodeinfodata     \
53 54 55
	capabilityschematest \
	capabilityschemadata \
	networkschematest \
56
	networkschemadata \
J
Jim Meyering 已提交
57
	domainschematest \
58
	domainschemadata \
59
	interfaceschemadata \
60 61 62 63 64
	storagepoolschematest \
	storagepoolschemadata \
	storagevolschematest \
	storagevolschemadata \
	nodedevschematest \
65 66
	nodedevschemadata \
	$(patsubst %,qemuhelpdata/%,$(qemuhelpdata))
K
Karel Zak 已提交
67

J
Jim Meyering 已提交
68
noinst_PROGRAMS = virshtest conftest \
69
        nodeinfotest statstest qparamtest
70

71 72 73 74
if WITH_XEN
noinst_PROGRAMS += xml2sexprtest sexpr2xmltest \
	reconnect xmconfigtest xencapstest
endif
75
if WITH_QEMU
76
noinst_PROGRAMS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
77 78
endif

79 80 81 82
if WITH_ESX
noinst_PROGRAMS += esxutilstest vmx2xmltest xml2vmxtest
endif

83 84 85 86
if WITH_SECDRIVER_SELINUX
noinst_PROGRAMS += seclabeltest
endif

87 88 89 90
if WITH_CIL
noinst_PROGRAMS += object-locking
endif

M
Mark McLoughlin 已提交
91 92
noinst_PROGRAMS += nodedevxml2xmltest

93 94
noinst_PROGRAMS += interfacexml2xmltest

95 96
test_scripts = \
	capabilityschematest \
97
	interfaceschematest \
98 99 100 101 102 103
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
	nodedevschematest

A
Atsushi SAKAI 已提交
104
if WITH_LIBVIRTD
105 106 107 108 109 110
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	daemon-conf			\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
111 112
	libvirtd-fail			\
	libvirtd-pool			\
113 114 115 116 117 118
	read-bufsiz			\
	read-non-seekable		\
	start				\
	undefine			\
	vcpupin				\
	virsh-all			\
J
Jim Meyering 已提交
119
	virsh-synopsis
A
Atsushi SAKAI 已提交
120
endif
121

122 123
EXTRA_DIST += $(test_scripts)

124 125 126 127 128 129 130 131 132 133 134
TESTS = virshtest \
        nodeinfotest \
	statstest \
	qparamtest \
	$(test_scripts)

if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
	xencapstest
135
if ENABLE_XEN_TESTS
136 137
TESTS += reconnect
endif
138
endif
139

140
if WITH_QEMU
141
TESTS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
142
endif
K
Karel Zak 已提交
143

144 145 146 147
if WITH_ESX
TESTS += esxutilstest vmx2xmltest xml2vmxtest
endif

148 149 150 151
if WITH_SECDRIVER_SELINUX
TESTS += seclabeltest
endif

152 153 154 155 156
if WITH_LIBVIRTD
noinst_PROGRAMS += eventtest
TESTS += eventtest
endif

M
Mark McLoughlin 已提交
157 158
TESTS += nodedevxml2xmltest

159 160
TESTS += interfacexml2xmltest

C
Chris Lalancette 已提交
161
path_add = $$abs_top_builddir/src$(PATH_SEPARATOR)$$abs_top_builddir/daemon$(PATH_SEPARATOR)$$abs_top_builddir/tools
J
Jim Meyering 已提交
162

163 164 165
# NB, automake < 1.10 does not provide the real
# abs_top_{src/build}dir variables, so don't rely
# on them here. Fake them with 'pwd'
166
TESTS_ENVIRONMENT =				\
J
Jim Meyering 已提交
167 168
  abs_top_builddir=`cd '$(top_builddir)'; pwd`	\
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
169 170
  abs_builddir=`cd '$(builddir)'; pwd`		\
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
171
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
172
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
173
  SHELL="$(SHELL)"				\
174
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
175
  LIBVIRT_DEBUG="error"				\
176
  LC_ALL=C					\
177 178
  $(VG)

179
valgrind:
180
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
181

182
if WITH_XEN
183
xml2sexprtest_SOURCES = \
184
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
185
	testutils.c testutils.h
186
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
187 188

sexpr2xmltest_SOURCES = \
189
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
190
	testutils.c testutils.h
191
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
192

193
xmconfigtest_SOURCES = \
194
	xmconfigtest.c testutilsxen.c testutilsxen.h \
195
	testutils.c testutils.h
196
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
197

198 199 200 201 202 203 204 205 206 207 208 209 210 211
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

212
if WITH_QEMU
213
qemuxml2argvtest_SOURCES = \
214
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
215
	testutils.c testutils.h
216
qemuxml2argvtest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
217 218

qemuxml2xmltest_SOURCES = \
219
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
220
	testutils.c testutils.h
221
qemuxml2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
222 223 224 225 226

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemuargv2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
227 228 229

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
qemuhelptest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
230
else
231
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h
232
endif
233

234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
esxutilstest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)

vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
vmx2xmltest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
xml2vmxtest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)
else
EXTRA_DIST += esxutilstest.c vmx2xmltest.c xml2vmxtest.c
endif

M
Mark McLoughlin 已提交
253 254 255
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
256
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
257

258 259 260 261 262
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

263 264 265 266 267
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
268 269 270 271
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

272 273 274 275
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

276 277 278 279
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = $(LDADDS)

280 281 282 283 284 285 286 287
if WITH_SECDRIVER_SELINUX
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
else
EXTRA_DIST += seclabeltest.c
endif

288 289 290 291
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

292 293
if WITH_LIBVIRTD
eventtest_SOURCES = \
294
	eventtest.c testutils.h testutils.c ../daemon/event.c
295 296 297
eventtest_LDADD = -lrt $(LDADDS)
endif

298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

object_locking_SOURCES = object-locking.ml

%.cmx: %.ml
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) -c $<

object-locking: object-locking.cmx object-locking-files.txt
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) $(CILOPTLIBS) $< -o $@

object-locking-files.txt:
	find $(top_builddir)/src/ -name '*.i' > $@

else
EXTRA_DIST += object-locking.ml
endif

319
CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx object-locking-files.txt