Makefile.am 11.5 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
	hashtest virnetmessagetest virnetsockettest ssh \
88
	utiltest virnettlscontexttest
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
	xmconfigtest xencapstest statstest reconnect
97
endif
98
if WITH_QEMU
99
check_PROGRAMS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
100 101
endif

102 103 104 105
if WITH_OPENVZ
check_PROGRAMS += openvzutilstest
endif

106
if WITH_ESX
107 108 109 110 111
check_PROGRAMS += esxutilstest
endif

if WITH_VMX
check_PROGRAMS += vmx2xmltest xml2vmxtest
112 113
endif

114
if WITH_CIL
115
check_PROGRAMS += object-locking
116 117
endif

118 119 120 121
if HAVE_YAJL
check_PROGRAMS += jsontest
endif

122
check_PROGRAMS += networkxml2xmltest
123

124
if WITH_NETWORK
125
check_PROGRAMS += networkxml2argvtest
126
endif
127

128
check_PROGRAMS += nwfilterxml2xmltest
129

130
check_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest
131

132
check_PROGRAMS += nodedevxml2xmltest
M
Mark McLoughlin 已提交
133

134
check_PROGRAMS += interfacexml2xmltest
135

136 137
check_PROGRAMS += cputest

138 139
test_scripts = \
	capabilityschematest \
140
	interfaceschematest \
141 142 143 144
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
145
	nodedevschematest \
146 147
	nwfilterschematest \
	domainsnapshotschematest
148

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

J
Jamie Strandboge 已提交
187 188
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
189 190
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
191
endif
192

193 194
EXTRA_DIST += $(test_scripts)

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

209 210 211 212
if HAVE_YAJL
TESTS += jsontest
endif

213 214 215 216
if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
217 218 219
	xencapstest \
	reconnect \
	statstest
220
endif
221

222
if WITH_QEMU
223
TESTS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
224
TESTS += nwfilterxml2xmltest
225
endif
K
Karel Zak 已提交
226

227 228 229 230
if WITH_OPENVZ
TESTS += openvzutilstest
endif

231
if WITH_ESX
232 233 234 235 236
TESTS += esxutilstest
endif

if WITH_VMX
TESTS += vmx2xmltest xml2vmxtest
237 238
endif

239
if WITH_LIBVIRTD
240
check_PROGRAMS += eventtest
241 242 243
TESTS += eventtest
endif

244 245
TESTS += networkxml2xmltest

246
if WITH_NETWORK
247
TESTS += networkxml2argvtest
248
endif
249

250
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
251

M
Mark McLoughlin 已提交
252 253
TESTS += nodedevxml2xmltest

254 255
TESTS += interfacexml2xmltest

256 257
TESTS += cputest

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

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

275
valgrind:
276
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
277

278 279 280 281 282
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
sockettest_LDADD = ../src/libvirt_util.la $(LDADDS)

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

sexpr2xmltest_SOURCES = \
290
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
291
	testutils.c testutils.h
292
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
293

294
xmconfigtest_SOURCES = \
295
	xmconfigtest.c testutilsxen.c testutilsxen.h \
296
	testutils.c testutils.h
297
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
298

299 300 301 302 303
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

reconnect_SOURCES = \
304
	reconnect.c testutils.h testutils.c
305 306
reconnect_LDADD = $(LDADDS)

307 308 309 310
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

311 312 313 314 315 316
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

317
if WITH_QEMU
318 319 320 321 322 323 324

qemu_LDADDS = ../src/libvirt_driver_qemu.la

if WITH_NETWORK
qemu_LDADDS += ../src/libvirt_driver_network.la
endif

325
qemuxml2argvtest_SOURCES = \
326
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
327
	testutils.c testutils.h
328
qemuxml2argvtest_LDADD = $(qemu_LDADDS)  $(LDADDS)
329 330

qemuxml2xmltest_SOURCES = \
331
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
332
	testutils.c testutils.h
333
qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
334 335 336 337

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
338
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
339 340

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
341
qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
342
else
343
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h
344
endif
345

346 347 348 349 350 351 352 353 354 355
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

356 357 358 359 360
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
esxutilstest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)
361 362 363
else
EXTRA_DIST += esxutilstest.c
endif
364

365
if WITH_VMX
366 367 368
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
369
vmx2xmltest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
370 371 372 373

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
374
xml2vmxtest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
375
else
376
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
377 378
endif

379 380 381 382 383
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

384
if WITH_NETWORK
385 386 387 388
networkxml2argvtest_SOURCES = \
	networkxml2argvtest.c \
	testutils.c testutils.h
networkxml2argvtest_LDADD = ../src/libvirt_driver_network.la $(LDADDS)
389 390 391
else
EXTRA_DIST += networkxml2argvtest.c
endif
392

393 394 395 396 397
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)

398 399 400 401 402
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

403 404 405 406 407
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
408 409 410
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
411
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
412

413 414 415 416 417
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

418 419 420 421 422
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

423 424 425 426 427
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
428 429 430 431
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

432 433 434 435
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

436 437
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
E
Eric Blake 已提交
438
commandtest_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
439 440 441 442
commandtest_LDADD = $(LDADDS)

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

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

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

456
virnettlscontexttest_SOURCES = \
E
Eric Blake 已提交
457
	virnettlscontexttest.c testutils.h testutils.c
458
virnettlscontexttest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
E
Eric Blake 已提交
459 460 461 462 463 464 465
virnettlscontexttest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
else
EXTRA_DIST += pkix_asn1_tab.c
endif
466

467

468 469 470
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
J
Jamie Strandboge 已提交
471

472 473 474 475
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

476 477 478 479
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

480 481 482 483
hashtest_SOURCES = \
	hashtest.c hashdata.h testutils.h testutils.c
hashtest_LDADD = $(LDADDS)

484
jsontest_SOURCES = \
485
	jsontest.c testutils.h testutils.c
486 487
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
488 489 490 491
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

492 493
if WITH_LIBVIRTD
eventtest_SOURCES = \
494
	eventtest.c testutils.h testutils.c
495 496 497
eventtest_LDADD = -lrt $(LDADDS)
endif

498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518
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

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