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

3 4
SHELL = $(PREFERABLY_POSIX_SHELL)

K
Karel Zak 已提交
5
INCLUDES = \
6
	-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
K
Karel Zak 已提交
7
	-I$(top_builddir)/include \
8 9
	-I$(top_srcdir)/include \
	-I$(top_srcdir)/src \
10
	-I$(top_srcdir)/src/util \
E
Eric Blake 已提交
11 12 13
	-I$(top_srcdir)/src/conf

AM_CFLAGS = \
14 15
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
16
	$(SASL_CFLAGS) \
17
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
18
	$(APPARMOR_CFLAGS) \
19
	$(YAJL_CFLAGS) \
E
Eric Blake 已提交
20 21
	$(COVERAGE_CFLAGS) \
	$(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
        $(YAJL_LIBS) \
36
        $(WARN_CFLAGS) \
37
	../src/libvirt_test.la \
38
	../gnulib/lib/libgnu.la \
J
John Levon 已提交
39
	$(LIBSOCKET) \
40
        $(COVERAGE_LDFLAGS)
K
Karel Zak 已提交
41

42
EXTRA_DIST =		\
43
	capabilityschemadata \
E
Eric Blake 已提交
44 45 46 47
	capabilityschematest \
	commanddata \
	confdata \
	cputestdata \
48
	domainschemadata \
E
Eric Blake 已提交
49 50 51 52
	domainschematest \
	domainsnapshotschematest \
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
53
	interfaceschemadata \
E
Eric Blake 已提交
54 55 56
	networkschematest \
	networkxml2xmlin \
	networkxml2xmlout \
57
	networkxml2argvdata \
E
Eric Blake 已提交
58 59 60 61 62 63 64 65 66 67 68 69
	nodedevschemadata \
	nodedevschematest \
	nodeinfodata     \
	nwfilterschematest \
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
	qemuhelpdata \
	qemuxml2argvdata \
	qemuxml2xmloutdata \
	schematestutils.sh \
	sexpr2xmldata \
70
	storagepoolschematest \
71
	storagepoolxml2xmlin \
E
Eric Blake 已提交
72
	storagepoolxml2xmlout \
73
	storagevolschematest \
74
	storagevolxml2xmlin \
E
Eric Blake 已提交
75 76
	storagevolxml2xmlout \
	test-lib.sh	\
77
	vmx2xmldata \
E
Eric Blake 已提交
78 79 80
	xencapsdata \
	xmconfigdata \
	xml2sexprdata \
81 82
	xml2vmxdata \
	.valgrind.supp
K
Karel Zak 已提交
83

84
check_PROGRAMS = virshtest conftest sockettest \
85
	nodeinfotest qparamtest virbuftest \
86
	commandtest commandhelper seclabeltest \
M
Matthias Bolte 已提交
87 88
	hashtest virnetmessagetest virnetsockettest ssh \
	utiltest
89 90 91 92

# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
93

94
if WITH_XEN
95
check_PROGRAMS += xml2sexprtest sexpr2xmltest \
96 97 98 99
	xmconfigtest xencapstest
if ENABLE_XEN_TESTS
check_PROGRAMS += statstest reconnect
endif
100
endif
101
if WITH_QEMU
102
check_PROGRAMS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
103 104
endif

105 106 107 108
if WITH_OPENVZ
check_PROGRAMS += openvzutilstest
endif

109
if WITH_ESX
110 111 112 113 114
check_PROGRAMS += esxutilstest
endif

if WITH_VMX
check_PROGRAMS += vmx2xmltest xml2vmxtest
115 116
endif

117
if WITH_CIL
118
check_PROGRAMS += object-locking
119 120
endif

121 122 123 124
if HAVE_YAJL
check_PROGRAMS += jsontest
endif

125
check_PROGRAMS += networkxml2xmltest
126

127
if WITH_NETWORK
128
check_PROGRAMS += networkxml2argvtest
129
endif
130

131
check_PROGRAMS += nwfilterxml2xmltest
132

133
check_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest
134

135
check_PROGRAMS += nodedevxml2xmltest
M
Mark McLoughlin 已提交
136

137
check_PROGRAMS += interfacexml2xmltest
138

139 140
check_PROGRAMS += cputest

141 142
test_scripts = \
	capabilityschematest \
143
	interfaceschematest \
144 145 146 147
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
148
	nodedevschematest \
149 150
	nwfilterschematest \
	domainsnapshotschematest
151

A
Atsushi SAKAI 已提交
152
if WITH_LIBVIRTD
153 154 155 156 157 158
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	daemon-conf			\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
159 160
	libvirtd-fail			\
	libvirtd-pool			\
161 162 163 164 165 166
	read-bufsiz			\
	read-non-seekable		\
	start				\
	undefine			\
	vcpupin				\
	virsh-all			\
167
	virsh-optparse			\
168
	virsh-schedinfo			\
J
Jim Meyering 已提交
169
	virsh-synopsis
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
else
EXTRA_DIST += 				\
	test_conf.sh			\
	cpuset				\
	daemon-conf			\
	define-dev-segfault		\
	int-overflow			\
	libvirtd-fail			\
	libvirtd-pool			\
	read-bufsiz			\
	read-non-seekable		\
	start				\
	undefine			\
	vcpupin				\
	virsh-all			\
	virsh-optparse			\
	virsh-schedinfo			\
	virsh-synopsis
A
Atsushi SAKAI 已提交
188
endif
189

J
Jamie Strandboge 已提交
190 191
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
192 193
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
194
endif
195

196 197
EXTRA_DIST += $(test_scripts)

198 199 200
TESTS = virshtest \
        nodeinfotest \
	qparamtest \
201
	virbuftest \
202
	sockettest \
203
	commandtest \
204
	seclabeltest \
205
	hashtest \
206
	virnetmessagetest \
207
	virnetsockettest \
M
Matthias Bolte 已提交
208
	utiltest \
209 210
	$(test_scripts)

211 212 213 214
if HAVE_YAJL
TESTS += jsontest
endif

215 216 217 218 219
if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
	xencapstest
220
if ENABLE_XEN_TESTS
221
TESTS += reconnect statstest
222
endif
223
endif
224

225
if WITH_QEMU
226
TESTS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
227
TESTS += nwfilterxml2xmltest
228
endif
K
Karel Zak 已提交
229

230 231 232 233
if WITH_OPENVZ
TESTS += openvzutilstest
endif

234
if WITH_ESX
235 236 237 238 239
TESTS += esxutilstest
endif

if WITH_VMX
TESTS += vmx2xmltest xml2vmxtest
240 241
endif

242
if WITH_LIBVIRTD
243
check_PROGRAMS += eventtest
244 245 246
TESTS += eventtest
endif

247 248
TESTS += networkxml2xmltest

249
if WITH_NETWORK
250
TESTS += networkxml2argvtest
251
endif
252

253
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
254

M
Mark McLoughlin 已提交
255 256
TESTS += nodedevxml2xmltest

257 258
TESTS += interfacexml2xmltest

259 260
TESTS += cputest

261
path_add = $$abs_top_builddir/daemon$(PATH_SEPARATOR)$$abs_top_builddir/tools$(PATH_SEPARATOR)$$abs_top_builddir/tests
J
Jim Meyering 已提交
262

263
# NB, automake < 1.10 does not provide the real
264
# abs_top_{src/build}dir or builddir variables, so don't rely
265
# on them here. Fake them with 'pwd'
266
TESTS_ENVIRONMENT =				\
J
Jim Meyering 已提交
267 268
  abs_top_builddir=`cd '$(top_builddir)'; pwd`	\
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
269
  abs_builddir=`pwd`				\
270
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
271
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
272
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
273
  SHELL="$(SHELL)"				\
274
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
275
  LC_ALL=C					\
276 277
  $(VG)

278
valgrind:
279
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
280

281 282 283 284 285
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
sockettest_LDADD = ../src/libvirt_util.la $(LDADDS)

286
if WITH_XEN
287
xml2sexprtest_SOURCES = \
288
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
289
	testutils.c testutils.h
290
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
291 292

sexpr2xmltest_SOURCES = \
293
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
294
	testutils.c testutils.h
295
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
296

297
xmconfigtest_SOURCES = \
298
	xmconfigtest.c testutilsxen.c testutilsxen.h \
299
	testutils.c testutils.h
300
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
301

302 303 304 305 306 307 308 309
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

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

310 311 312 313
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

314 315 316 317 318 319
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

320
if WITH_QEMU
321
qemuxml2argvtest_SOURCES = \
322
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
323
	testutils.c testutils.h
324
qemuxml2argvtest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
325 326

qemuxml2xmltest_SOURCES = \
327
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
328
	testutils.c testutils.h
329
qemuxml2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
330 331 332 333 334

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemuargv2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
335 336 337

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
qemuhelptest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
338
else
339
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h
340
endif
341

342 343 344 345 346 347 348 349 350 351
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
openvzutilstest_LDADD = ../src/libvirt_driver_openvz.la $(LDADDS)
else
EXTRA_DIST += openvzutilstest.c
endif
EXTRA_DIST += openvzutilstest.conf

352 353 354 355 356
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
esxutilstest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)
357 358 359
else
EXTRA_DIST += esxutilstest.c
endif
360

361
if WITH_VMX
362 363 364
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
365
vmx2xmltest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
366 367 368 369

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
370
xml2vmxtest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
371
else
372
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
373 374
endif

375 376 377 378 379
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

380
if WITH_NETWORK
381 382 383 384
networkxml2argvtest_SOURCES = \
	networkxml2argvtest.c \
	testutils.c testutils.h
networkxml2argvtest_LDADD = ../src/libvirt_driver_network.la $(LDADDS)
385 386 387
else
EXTRA_DIST += networkxml2argvtest.c
endif
388

389 390 391 392 393
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)

394 395 396 397 398
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

399 400 401 402 403
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
404 405 406
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
407
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
408

409 410 411 412 413
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

414 415 416 417 418
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

419 420 421 422 423
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
424 425 426 427
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

428 429 430 431
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

432 433
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
E
Eric Blake 已提交
434
commandtest_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
435 436 437 438
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
E
Eric Blake 已提交
439
commandhelper_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
440 441
commandhelper_LDADD = $(LDADDS)

442 443
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
E
Eric Blake 已提交
444
virnetmessagetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
445 446
virnetmessagetest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

447 448
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
E
Eric Blake 已提交
449
virnetsockettest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
450 451
virnetsockettest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

452

453 454 455
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
J
Jamie Strandboge 已提交
456

457 458 459 460
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

461 462 463 464
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

465 466 467 468
hashtest_SOURCES = \
	hashtest.c hashdata.h testutils.h testutils.c
hashtest_LDADD = $(LDADDS)

469
jsontest_SOURCES = \
470
	jsontest.c testutils.h testutils.c
471 472
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
473 474 475 476
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

477 478
if WITH_LIBVIRTD
eventtest_SOURCES = \
479
	eventtest.c testutils.h testutils.c
480 481 482
eventtest_LDADD = -lrt $(LDADDS)
endif

483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503
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

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