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

E
Eric Blake 已提交
3
## Copyright (C) 2005-2013 Red Hat, Inc.
E
Eric Blake 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library.  If not, see
## <http://www.gnu.org/licenses/>.
18

19 20
SHELL = $(PREFERABLY_POSIX_SHELL)

K
Karel Zak 已提交
21
INCLUDES = \
22
	-I$(top_builddir) -I$(top_srcdir) \
23 24 25
	-I$(top_builddir)/gnulib/lib -I$(top_srcdir)/gnulib/lib \
	-I$(top_builddir)/include -I$(top_srcdir)/include \
	-I$(top_builddir)/src -I$(top_srcdir)/src \
26
	-I$(top_srcdir)/src/util \
27 28
	-I$(top_srcdir)/src/conf \
	$(GETTEXT_CPPFLAGS)
E
Eric Blake 已提交
29 30

AM_CFLAGS = \
31
	-Dabs_builddir="\"`pwd`\"" \
32 33
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
34
	$(SASL_CFLAGS) \
35
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
36
	$(APPARMOR_CFLAGS) \
37
	$(YAJL_CFLAGS) \
E
Eric Blake 已提交
38 39
	$(COVERAGE_CFLAGS) \
	$(WARN_CFLAGS)
40

41 42 43
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
44
endif WITH_DRIVER_MODULES
45

46
PROBES_O =
47
if WITH_DTRACE_PROBES
48
PROBES_O += ../src/libvirt_probes.lo
49
endif WITH_DTRACE_PROBES
50

K
Karel Zak 已提交
51
LDADDS = \
52
        $(WARN_CFLAGS) \
53
	$(NO_INDIRECT_LDFLAGS) \
54
	$(PROBES_O) \
55 56
	../src/libvirt.la \
	../gnulib/lib/libgnu.la
K
Karel Zak 已提交
57

58
EXTRA_DIST =		\
59
	capabilityschemadata \
E
Eric Blake 已提交
60 61 62 63
	capabilityschematest \
	commanddata \
	confdata \
	cputestdata \
64
	domainschemadata \
E
Eric Blake 已提交
65 66 67 68
	domainschematest \
	domainsnapshotschematest \
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
O
Osier Yang 已提交
69
	fchostdata \
70
	interfaceschemadata \
71
	lxcxml2xmldata \
E
Eric Blake 已提交
72 73 74
	networkschematest \
	networkxml2xmlin \
	networkxml2xmlout \
75
	networkxml2confdata \
J
Ján Tomko 已提交
76 77
	networkxml2xmlupdatein \
	networkxml2xmlupdateout \
E
Eric Blake 已提交
78 79 80 81 82 83 84 85
	nodedevschemadata \
	nodedevschematest \
	nodeinfodata     \
	nwfilterschematest \
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
	qemuhelpdata \
86
	qemuhotplugtestdata \
E
Eric Blake 已提交
87 88
	qemuxml2argvdata \
	qemuxml2xmloutdata \
P
Philipp Hahn 已提交
89
	qemuxmlnsdata \
90
	securityselinuxlabeldata \
E
Eric Blake 已提交
91 92
	schematestutils.sh \
	sexpr2xmldata \
93
	storagepoolschemadata \
94
	storagepoolschematest \
95
	storagepoolxml2xmlin \
E
Eric Blake 已提交
96
	storagepoolxml2xmlout \
97
	storagevolxml2argvdata \
98
	storagevolschemadata \
99
	storagevolschematest \
100
	storagevolxml2xmlin \
E
Eric Blake 已提交
101
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
102
	sysinfodata \
E
Eric Blake 已提交
103
	test-lib.sh	\
104
	virsh-uriprecedence \
105
	vmx2xmldata \
E
Eric Blake 已提交
106 107 108
	xencapsdata \
	xmconfigdata \
	xml2sexprdata \
109
	xml2vmxdata \
110
	vmwareverdata \
O
Osier Yang 已提交
111
	.valgrind.supp
K
Karel Zak 已提交
112

G
Gene Czarcinski 已提交
113
test_helpers = commandhelper ssh test_conf
114
test_programs = virshtest sockettest \
E
Eric Blake 已提交
115
	nodeinfotest virbuftest \
116 117
	commandtest seclabeltest \
	virhashtest virnetmessagetest virnetsockettest \
118
	viratomictest \
119
	utiltest shunloadtest \
120
	virtimetest viruritest virkeyfiletest \
H
Hu Tao 已提交
121
	virauthconfigtest \
122 123 124
	virbitmaptest \
	vircgrouptest \
	virendiantest \
125
	viridentitytest \
126
	virkeycodetest \
127
	virlockspacetest \
128
	virstringtest \
D
Daniel P. Berrange 已提交
129
        virportallocatortest \
V
Viktor Mihajlovski 已提交
130
	sysinfotest \
131
	virstoragetest \
O
Osier Yang 已提交
132
        fchosttest \
133
	$(NULL)
134

135 136 137 138
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

139
if WITH_DBUS
140 141
test_programs += virdbustest \
                 virsystemdtest
142
endif WITH_DBUS
143

144
if WITH_GNUTLS
145
test_programs += virnettlscontexttest virnettlssessiontest
146
endif WITH_GNUTLS
147

148
if WITH_SECDRIVER_SELINUX
149
if WITH_ATTR
150
test_programs += securityselinuxtest
151
if WITH_QEMU
152
test_programs += securityselinuxlabeltest
153 154 155
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
156

157 158
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
159
endif WITH_DRIVER_MODULES
160

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

165
if WITH_XEN
166
test_programs += xml2sexprtest sexpr2xmltest \
167
	xmconfigtest xencapstest statstest reconnect
168
endif WITH_XEN
169
if WITH_QEMU
170
test_programs += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
171
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
172 173
	qemumonitortest qemumonitorjsontest qemuhotplugtest \
	qemuagenttest
174
endif WITH_QEMU
175

176
if WITH_LXC
177
test_programs += lxcxml2xmltest
178
endif WITH_LXC
179

180
if WITH_OPENVZ
181
test_programs += openvzutilstest
182
endif WITH_OPENVZ
183

184
if WITH_ESX
185
test_programs += esxutilstest
186
endif WITH_ESX
187 188

if WITH_VMX
189
test_programs += vmx2xmltest xml2vmxtest
190
endif WITH_VMX
191

192 193 194 195
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

196
if WITH_CIL
197
test_programs += object-locking
198
endif WITH_CIL
199

200
if WITH_YAJL
201
test_programs += jsontest
202
endif WITH_YAJL
203

J
Ján Tomko 已提交
204
test_programs += networkxml2xmltest networkxml2xmlupdatetest
205

206
if WITH_NETWORK
207
test_programs += networkxml2conftest
208
endif WITH_NETWORK
209

210 211
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
212
endif WITH_STORAGE_SHEEPDOG
213

214
test_programs += nwfilterxml2xmltest
215

216
if WITH_STORAGE
217
test_programs += storagevolxml2argvtest
218
endif WITH_STORAGE
219

220
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
221

222
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
223

224
test_programs += interfacexml2xmltest
225

226
test_programs += cputest
227

P
Peter Krempa 已提交
228 229
test_programs += metadatatest

230 231
test_scripts = \
	capabilityschematest \
232
	interfaceschematest \
233 234 235 236
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
237
	nodedevschematest \
238 239
	nwfilterschematest \
	domainsnapshotschematest
240

A
Atsushi SAKAI 已提交
241
if WITH_LIBVIRTD
242 243 244 245 246
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
247 248
	libvirtd-fail			\
	libvirtd-pool			\
249 250 251
	read-bufsiz			\
	read-non-seekable		\
	start				\
252
	virsh-uriprecedence		\
253 254
	vcpupin				\
	virsh-all			\
255
	virsh-optparse			\
256
	virsh-schedinfo			\
257 258 259
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
260

261 262 263
test_programs += 			\
	eventtest			\
	libvirtdconftest
264
else ! WITH_LIBVIRTD
265 266 267 268 269 270 271 272 273 274 275 276 277 278
EXTRA_DIST += 				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
	libvirtd-fail			\
	libvirtd-pool			\
	read-bufsiz			\
	read-non-seekable		\
	start				\
	vcpupin				\
	virsh-all			\
	virsh-optparse			\
	virsh-schedinfo			\
279 280 281
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
282
endif ! WITH_LIBVIRTD
283

J
Jamie Strandboge 已提交
284 285
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
286
else ! WITH_SECDRIVER_APPARMOR
287
EXTRA_DIST += virt-aa-helper-test
288
endif ! WITH_SECDRIVER_APPARMOR
289

290 291
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
292 293
test_libraries = libshunload.la \
		libvirportallocatormock.la \
294
		vircgroupmock.la \
D
Daniel P. Berrange 已提交
295
		$(NULL)
296 297
if WITH_QEMU
test_libraries += libqemumonitortestutils.la
298
endif WITH_QEMU
299

300 301
if WITH_DBUS
test_libraries += virsystemdmock.la
302
endif WITH_DBUS
303

304 305
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
306
noinst_LTLIBRARIES = $(test_libraries)
307
else ! WITH_TESTS
308
check_PROGRAMS = $(test_programs) $(test_helpers)
309
check_LTLIBRARIES = $(test_libraries)
310
endif ! WITH_TESTS
311

312 313
TESTS = $(test_programs) \
	$(test_scripts)
314

315
# NB, automake < 1.10 does not provide the real
316
# abs_top_{src/build}dir or builddir variables, so don't rely
317
# on them here. Fake them with 'pwd'
318 319 320 321
# Also, BSD sh doesn't like 'a=b b=$$a', so we can't use an
# intermediate shell variable, but must do all the expansion in make

lv_abs_top_builddir=`cd '$(top_builddir)'; pwd`
322 323
path_add = $(subst :,$(PATH_SEPARATOR),\
	$(subst !,$(lv_abs_top_builddir)/,!daemon:!tools:!tests))
324

325
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
326
TESTS_ENVIRONMENT =				\
327
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
328
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
329
  abs_builddir=`pwd`				\
330
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
331
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
332
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
333
  SHELL="$(SHELL)"				\
334
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
335
  LIBVIRT_AUTOSTART=0				\
336
  LC_ALL=C					\
337
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE)	\
338 339
  $(VG)

340

341 342
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(srcdir)/.valgrind.supp
343
valgrind:
344
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
345

346 347 348
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
349
sockettest_LDADD = $(LDADDS)
350

351
if WITH_XEN
E
Eric Blake 已提交
352
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
353 354
xen_LDADDS += $(LDADDS)

355
xml2sexprtest_SOURCES = \
356
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
357
	testutils.c testutils.h
358
xml2sexprtest_LDADD = $(xen_LDADDS)
359 360

sexpr2xmltest_SOURCES = \
361
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
362
	testutils.c testutils.h
363
sexpr2xmltest_LDADD = $(xen_LDADDS)
364

365
xmconfigtest_SOURCES = \
366
	xmconfigtest.c testutilsxen.c testutilsxen.h \
367
	testutils.c testutils.h
368
xmconfigtest_LDADD = $(xen_LDADDS)
369

370 371
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
372
xencapstest_LDADD = $(xen_LDADDS)
373 374

reconnect_SOURCES = \
375
	reconnect.c testutils.h testutils.c
376 377
reconnect_LDADD = $(LDADDS)

378 379
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
380
statstest_LDADD = $(xen_LDADDS)
381

382
else ! WITH_XEN
383 384 385
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
386
endif ! WITH_XEN
387

388 389 390 391 392
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

393
if WITH_QEMU
394

395 396
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

397
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
398
if WITH_NETWORK
E
Eric Blake 已提交
399
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
400
endif WITH_NETWORK
401
if WITH_DTRACE_PROBES
402
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
403
endif WITH_DTRACE_PROBES
404
qemu_LDADDS += $(LDADDS)
405

406
qemuxml2argvtest_SOURCES = \
407
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
408
	testutils.c testutils.h
409
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LIBXML_LIBS)
410 411

qemuxml2xmltest_SOURCES = \
412
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
413
	testutils.c testutils.h
414
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
415

P
Philipp Hahn 已提交
416 417 418
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
419
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
420

421 422 423
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
424
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
425 426

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
427
qemuhelptest_LDADD = $(qemu_LDADDS)
428

429
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
430
qemumonitortest_LDADD = $(qemu_LDADDS)
431

432 433 434 435 436
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
437
qemumonitorjsontest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
438

P
Peter Krempa 已提交
439 440 441 442 443
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
444
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
P
Peter Krempa 已提交
445

446 447 448 449 450
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
451
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
452

453 454 455
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
456
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
457
else ! WITH_QEMU
458 459
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
460
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
461
	qemumonitorjsontest.c qemuhotplugtest.c \
P
Peter Krempa 已提交
462
	qemuagenttest.c \
463
	$(QEMUMONITORTESTUTILS_SOURCES)
464
endif ! WITH_QEMU
465

466 467
if WITH_LXC

E
Eric Blake 已提交
468
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
469
if WITH_NETWORK
E
Eric Blake 已提交
470
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
471
endif WITH_NETWORK
472
lxc_LDADDS += $(LDADDS)
473 474 475 476

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
477
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
478
else ! WITH_LXC
479
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
480
endif ! WITH_LXC
481

482 483 484 485
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
486
openvzutilstest_LDADD = $(LDADDS)
487
else ! WITH_OPENVZ
488
EXTRA_DIST += openvzutilstest.c
489
endif ! WITH_OPENVZ
490 491
EXTRA_DIST += openvzutilstest.conf

492 493 494 495
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
496
esxutilstest_LDADD = $(LDADDS)
497
else ! WITH_ESX
498
EXTRA_DIST += esxutilstest.c
499
endif ! WITH_ESX
500

501
if WITH_VMX
502 503 504
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
505
vmx2xmltest_LDADD = $(LDADDS)
506 507 508 509

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
510
xml2vmxtest_LDADD = $(LDADDS)
511
else ! WITH_VMX
512
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
513
endif ! WITH_VMX
514

515 516 517 518 519 520 521 522 523
if WITH_VMWARE
vmwarevertest_SOURCES = \
    vmwarevertest.c \
    testutils.c testutils.h
vmwarevertest_LDADD = $(LDADDS)
else ! WITH_VMWARE
EXTRA_DIST += vmwarevertest.c
endif ! WITH_VMWARE

524 525 526 527 528
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
529 530 531 532 533
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

534
if WITH_NETWORK
535 536
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
537
	testutils.c testutils.h
538
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
539
else ! WITH_NETWORK
540
EXTRA_DIST += networkxml2conftest.c
541
endif !	WITH_NETWORK
542

543 544 545 546
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
547 548
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
549
else ! WITH_STORAGE_SHEEPDOG
550
EXTRA_DIST += storagebackendsheepdogtest.c
551
endif ! WITH_STORAGE_SHEEPDOG
552

553 554 555 556
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
557

558
if WITH_STORAGE
559 560 561 562 563
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
564
else ! WITH_STORAGE
565
EXTRA_DIST += storagevolxml2argvtest.c
566
endif ! WITH_STORAGE
567

568 569 570 571 572
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

573 574 575 576 577
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
578 579 580
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
581
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
582

583 584 585 586 587
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

588 589 590
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
591
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
592

P
Peter Krempa 已提交
593 594 595 596 597
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

598 599 600 601 602
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
603 604 605
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
606

607 608 609 610
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

611 612 613 614 615 616 617
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
618
commandhelper_LDFLAGS = -static
619

620 621 622
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
623 624
	$(NULL)
libvirtdconftest_LDADD = ../daemon/libvirtd_conf.la $(LDADDS)
625
else ! WITH_LIBVIRTD
626
EXTRA_DIST += libvirtdconftest.c
627
endif ! WITH_LIBVIRTD
628

629 630
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
631
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
632
virnetmessagetest_LDADD = $(LDADDS)
633

634 635
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
636
virnetsockettest_LDADD = $(LDADDS)
637

638
if WITH_GNUTLS
639
virnettlscontexttest_SOURCES = \
640 641 642
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
643
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
644 645 646 647
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
648
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
649 650 651
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
652 653
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
654
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
655
EXTRA_DIST += pkix_asn1_tab.c
656 657
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
658
EXTRA_DIST += \
659 660 661
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
662
endif ! WITH_GNUTLS
663

664 665
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
666
virtimetest_LDADD = $(LDADDS)
667

668 669 670 671
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

672 673 674 675
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

676 677 678 679
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

680 681 682 683
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

684 685 686 687
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
688 689 690 691 692 693 694 695 696 697
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

libvirportallocatormock_la_SOURCES = \
	virportallocatortest.c
libvirportallocatormock_la_CFLAGS = $(AM_CFLAGS) -DMOCK_HELPER=1
libvirportallocatormock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

698 699 700 701 702 703 704 705 706 707
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
vircgroupmock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

708 709 710 711
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
712
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
713 714 715 716 717 718 719 720 721 722 723 724

virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
virsystemdtest_CFLAGS = $(AM_CFLAGS)
virsystemdtest_LDADD = $(LDADDS)

virsystemdmock_la_SOURCES = \
	virsystemdmock.c
virsystemdmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virsystemdmock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

725
else ! WITH_DBUS
726
EXTRA_DIST += virdbustest.c virsystemdtest.c virsystemdmock.c
727
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
728

729 730
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
731
viruritest_LDADD = $(LDADDS)
732

733 734
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
735
virkeyfiletest_LDADD = $(LDADDS)
736

737 738
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
739
virauthconfigtest_LDADD = $(LDADDS)
740

741 742
seclabeltest_SOURCES = \
	seclabeltest.c
743
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
744

745
if WITH_SECDRIVER_SELINUX
746
if WITH_ATTR
747 748
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
749
else ! WITH_TESTS
750
check_LTLIBRARIES += libsecurityselinuxhelper.la
751
endif ! WITH_TESTS
752 753 754 755 756 757 758 759

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
libsecurityselinuxhelper_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
760
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
761 762
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
763 764 765 766 767

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
768
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
769 770
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
771 772 773
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
774 775
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
776

777 778 779 780
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

781 782 783
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
784

785
viratomictest_SOURCES = \
L
Laine Stump 已提交
786
	viratomictest.c testutils.h testutils.c
787 788
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
789 790 791 792
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
793 794 795 796
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

797
jsontest_SOURCES = \
798
	jsontest.c testutils.h testutils.c
799 800
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
801 802 803 804
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

805 806 807 808
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
809
endif WITH_DRIVER_MODULES
810

811 812
if WITH_LIBVIRTD
eventtest_SOURCES = \
813
	eventtest.c testutils.h testutils.c
814
eventtest_LDADD = -lrt $(LDADDS)
815
endif WITH_LIBVIRTD
816

817 818
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
819 820
libshunload_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation
821 822 823

shunloadtest_SOURCES = \
	shunloadtest.c
824
shunloadtest_LDADD = $(LIB_PTHREAD)
825 826
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
827 828 829 830
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

831 832 833 834
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

O
Osier Yang 已提交
835 836 837 838
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

839 840 841 842 843 844 845 846 847 848 849 850
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
851 852
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
853 854 855 856

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

857
else ! WITH_CIL
858
EXTRA_DIST += object-locking.ml
859
endif ! WITH_CIL
860

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