Makefile.am 9.1 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) \
J
Jamie Strandboge 已提交
19
	$(APPARMOR_CFLAGS) \
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
LDADDS = \
29
	$(STATIC_BINARIES) \
30 31
	$(LIBXML_LIBS) \
        $(GNUTLS_LIBS) \
32
        $(SASL_LIBS) \
33
        $(SELINUX_LIBS) \
J
Jamie Strandboge 已提交
34
        $(APPARMOR_LIBS) \
35
        $(WARN_CFLAGS) \
36
	../src/libvirt_test.la \
37
	../gnulib/lib/libgnu.la \
J
John Levon 已提交
38
	$(LIBSOCKET) \
39
        $(COVERAGE_LDFLAGS)
K
Karel Zak 已提交
40

41
EXTRA_DIST =		\
42
        oomtrace.pl     \
43
	test-lib.sh	\
44
	qemuxml2argvdata \
45
	qemuxml2xmloutdata \
46
	nodeinfodata     \
47
	schematestutils.sh \
48 49 50
	capabilityschematest \
	capabilityschemadata \
	networkschematest \
51 52
	networkxml2xmlout \
	networkxml2xmlin \
J
Jim Meyering 已提交
53
	domainschematest \
54
	domainschemadata \
55
	interfaceschemadata \
56
	storagepoolschematest \
57 58
	storagepoolxml2xmlout \
	storagepoolxml2xmlin \
59
	storagevolschematest \
60 61
	storagevolxml2xmlout \
	storagevolxml2xmlin \
62
	nodedevschematest \
63
	nodedevschemadata \
64 65
	vmx2xmldata \
	xml2vmxdata \
66 67
	nwfilterxml2xmlout \
	nwfilterxml2xmlin \
68
	nwfilterschematest \
69 70 71
	domainsnapshotschematest \
	domainsnapshotxml2xmlout \
	domainsnapshotxml2xmlin \
72 73
	qemuhelpdata \
	cputestdata
K
Karel Zak 已提交
74

75
check_PROGRAMS = virshtest conftest sockettest \
76
        nodeinfotest qparamtest virbuftest
77

78
if WITH_XEN
79
check_PROGRAMS += xml2sexprtest sexpr2xmltest \
80 81 82 83
	xmconfigtest xencapstest
if ENABLE_XEN_TESTS
check_PROGRAMS += statstest reconnect
endif
84
endif
85
if WITH_QEMU
86
check_PROGRAMS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
87 88
endif

89
if WITH_ESX
90
check_PROGRAMS += esxutilstest vmx2xmltest xml2vmxtest
91 92
endif

93
if WITH_SECDRIVER_SELINUX
94
check_PROGRAMS += seclabeltest
95 96
endif

J
Jamie Strandboge 已提交
97
if WITH_SECDRIVER_APPARMOR
98
check_PROGRAMS += secaatest
J
Jamie Strandboge 已提交
99 100
endif

101
if WITH_CIL
102
check_PROGRAMS += object-locking
103 104
endif

105
check_PROGRAMS += networkxml2xmltest
106

107
check_PROGRAMS += nwfilterxml2xmltest
108

109
check_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest
110

111
check_PROGRAMS += nodedevxml2xmltest
M
Mark McLoughlin 已提交
112

113
check_PROGRAMS += interfacexml2xmltest
114

115 116
check_PROGRAMS += cputest

117 118
test_scripts = \
	capabilityschematest \
119
	interfaceschematest \
120 121 122 123
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
124
	nodedevschematest \
125 126
	nwfilterschematest \
	domainsnapshotschematest
127

A
Atsushi SAKAI 已提交
128
if WITH_LIBVIRTD
129 130 131 132 133 134
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	daemon-conf			\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
135 136
	libvirtd-fail			\
	libvirtd-pool			\
137 138 139 140 141 142
	read-bufsiz			\
	read-non-seekable		\
	start				\
	undefine			\
	vcpupin				\
	virsh-all			\
143
	virsh-schedinfo			\
J
Jim Meyering 已提交
144
	virsh-synopsis
A
Atsushi SAKAI 已提交
145
endif
146

J
Jamie Strandboge 已提交
147 148
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
149 150
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
151
endif
152

153 154
EXTRA_DIST += $(test_scripts)

155 156 157
TESTS = virshtest \
        nodeinfotest \
	qparamtest \
158
	virbuftest \
159
	sockettest \
160 161 162 163 164 165 166
	$(test_scripts)

if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
	xencapstest
167
if ENABLE_XEN_TESTS
168
TESTS += reconnect statstest
169
endif
170
endif
171

172
if WITH_QEMU
173
TESTS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
174
TESTS += nwfilterxml2xmltest
175
endif
K
Karel Zak 已提交
176

177 178 179 180
if WITH_ESX
TESTS += esxutilstest vmx2xmltest xml2vmxtest
endif

181 182 183 184
if WITH_SECDRIVER_SELINUX
TESTS += seclabeltest
endif

J
Jamie Strandboge 已提交
185 186 187 188
if WITH_SECDRIVER_APPARMOR
TESTS += secaatest
endif

189
if WITH_LIBVIRTD
190
check_PROGRAMS += eventtest
191 192 193
TESTS += eventtest
endif

194 195
TESTS += networkxml2xmltest

196
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
197

M
Mark McLoughlin 已提交
198 199
TESTS += nodedevxml2xmltest

200 201
TESTS += interfacexml2xmltest

202 203
TESTS += cputest

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

206 207 208
# 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'
209
TESTS_ENVIRONMENT =				\
J
Jim Meyering 已提交
210 211
  abs_top_builddir=`cd '$(top_builddir)'; pwd`	\
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
212 213
  abs_builddir=`cd '$(builddir)'; pwd`		\
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
214
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
215
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
216
  SHELL="$(SHELL)"				\
217
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
218
  LC_ALL=C					\
219 220
  $(VG)

221
valgrind:
222
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
223

224 225 226 227 228
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
sockettest_LDADD = ../src/libvirt_util.la $(LDADDS)

229
if WITH_XEN
230
xml2sexprtest_SOURCES = \
231
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
232
	testutils.c testutils.h
233
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
234 235

sexpr2xmltest_SOURCES = \
236
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
237
	testutils.c testutils.h
238
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
239

240
xmconfigtest_SOURCES = \
241
	xmconfigtest.c testutilsxen.c testutilsxen.h \
242
	testutils.c testutils.h
243
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
244

245 246 247 248 249 250 251 252
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

reconnect_SOURCES = \
	reconnect.c
reconnect_LDADD = $(LDADDS)

253 254 255 256
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

257 258 259 260 261 262
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

263
if WITH_QEMU
264
qemuxml2argvtest_SOURCES = \
265
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
266
	testutils.c testutils.h
267
qemuxml2argvtest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
268 269

qemuxml2xmltest_SOURCES = \
270
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
271
	testutils.c testutils.h
272
qemuxml2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
273 274 275 276 277

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemuargv2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
278 279 280

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
qemuhelptest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
281
else
282
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h
283
endif
284

285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303
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

304 305 306 307 308
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

309 310 311 312 313
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)

314 315 316 317 318
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

319 320 321 322 323
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
324 325 326
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
327
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
328

329 330 331 332 333
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

334 335 336 337 338
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

339 340 341 342 343
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
344 345 346 347
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

348 349 350 351
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

352 353 354 355 356 357 358 359
if WITH_SECDRIVER_SELINUX
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
else
EXTRA_DIST += seclabeltest.c
endif

J
Jamie Strandboge 已提交
360 361 362 363 364 365 366 367
if WITH_SECDRIVER_APPARMOR
secaatest_SOURCES = \
	secaatest.c
secaatest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
else
EXTRA_DIST += secaatest.c
endif

368 369 370 371
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

372 373 374 375
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

376 377
if WITH_LIBVIRTD
eventtest_SOURCES = \
378
	eventtest.c testutils.h testutils.c ../daemon/event.c
379 380 381
eventtest_LDADD = -lrt $(LDADDS)
endif

382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402
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

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