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

3
## Copyright (C) 2005-2019 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)

21
AM_CPPFLAGS = \
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
	-I$(top_srcdir)/src/conf \
28
	$(NULL)
E
Eric Blake 已提交
29

30 31
WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)

E
Eric Blake 已提交
32
AM_CFLAGS = \
33
	-Dabs_builddir="\"$(abs_builddir)\"" \
34
	-Dabs_top_builddir="\"$(abs_top_builddir)\"" \
35
	-Dabs_srcdir="\"$(abs_srcdir)\"" \
36
	-Dabs_top_srcdir="\"$(abs_top_srcdir)\"" \
37
	$(LIBXML_CFLAGS) \
38
	$(LIBNL_CFLAGS) \
39
	$(GNUTLS_CFLAGS) \
40
	$(SASL_CFLAGS) \
41
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
42
	$(APPARMOR_CFLAGS) \
43
	$(YAJL_CFLAGS) \
44
	$(XDR_CFLAGS) \
E
Eric Blake 已提交
45
	$(WARN_CFLAGS)
46

47 48 49
AM_LDFLAGS = \
	-export-dynamic

50 51 52 53
MOCKLIBS_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
	$(MINGW_EXTRA_LDFLAGS)

54
DRIVERLIB_LDFLAGS = \
55 56 57 58
	-avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
	$(MINGW_EXTRA_LDFLAGS)

59
PROBES_O =
60
if WITH_DTRACE_PROBES
61
PROBES_O += ../src/libvirt_probes.lo
62
endif WITH_DTRACE_PROBES
63

64 65 66
GNULIB_LIBS = \
       ../gnulib/lib/libgnu.la

K
Karel Zak 已提交
67
LDADDS = \
68
	$(NO_INDIRECT_LDFLAGS) \
69
	$(PROBES_O) \
70 71
	$(GNULIB_LIBS) \
	../src/libvirt.la
K
Karel Zak 已提交
72

73
MOCKLIBS_LIBS = \
74 75
	$(GNULIB_LIBS) \
	../src/libvirt.la
76

77
EXTRA_DIST = \
78
	.valgrind.supp \
R
Roman Bogorodskiy 已提交
79
	bhyvexml2argvdata \
80
	bhyveargv2xmldata \
81
	bhyvexml2xmloutdata \
82
	capabilityschemadata \
E
Eric Blake 已提交
83 84
	commanddata \
	cputestdata \
M
Michal Privoznik 已提交
85
	domaincapsschemadata \
86
	domainconfdata \
87
	domainschemadata \
E
Eric Blake 已提交
88 89
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
O
Osier Yang 已提交
90
	fchostdata \
C
Cole Robinson 已提交
91 92
	genericxml2xmlindata \
	genericxml2xmloutdata \
93
	interfaceschemadata \
94
	libxlxml2domconfigdata \
95
	lxcconf2xmldata \
96
	lxcxml2xmldata \
97
	lxcxml2xmloutdata \
98 99
	networkxml2confdata \
	networkxml2firewalldata \
E
Eric Blake 已提交
100 101
	networkxml2xmlin \
	networkxml2xmlout \
J
Ján Tomko 已提交
102 103
	networkxml2xmlupdatein \
	networkxml2xmlupdateout \
E
Eric Blake 已提交
104
	nodedevschemadata \
105
	virhostcpudata \
M
Michal Privoznik 已提交
106
	nssdata \
107
	nwfilterxml2firewalldata \
E
Eric Blake 已提交
108 109 110
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
111
	qemuagentdata \
112
	qemuargv2xmldata \
113
	qemublocktestdata \
114
	qemucapabilitiesdata \
115
	qemucaps2xmloutdata \
116
	qemuhotplugtestcpus \
117 118
	qemuhotplugtestdevices \
	qemuhotplugtestdomains \
119
	qemumigparamsdata \
120
	qemumonitorjsondata \
E
Eric Blake 已提交
121 122
	qemuxml2argvdata \
	qemuxml2xmloutdata \
123
	qemustatusxml2xmldata \
124
	qemumemlockdata \
125
	qemufirmwaredata \
J
Ján Tomko 已提交
126
	secretxml2xmlin \
127
	securityselinuxhelperdata \
128
	securityselinuxlabeldata \
E
Eric Blake 已提交
129
	sexpr2xmldata \
130
	storagepoolcapsschemadata \
131
	storagepoolschemadata \
132
	storagepoolxml2xmlin \
E
Eric Blake 已提交
133
	storagepoolxml2xmlout \
134
	storagepoolxml2argvdata \
135
	storagevolschemadata \
136
	storagevolxml2argvdata \
137
	storagevolxml2xmlin \
E
Eric Blake 已提交
138
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
139
	sysinfodata \
140
	test-lib.sh \
Y
Yohan BELLEGUIC 已提交
141
	vboxsnapshotxmldata \
142
	vircaps2xmldata \
143
	vircgroupdata \
144
	virconfdata \
145
	virfiledata \
146
	virjsondata \
147
	virmacmaptestdata \
148
	virmock.h \
149
	virmockstathelpers.c \
150
	virnetdaemondata \
151
	virnetdevtestdata \
152
	virnwfilterbindingxml2xmldata \
153
	virpcitestdata \
O
Osier Yang 已提交
154
	virscsidata \
155
	virsh-uriprecedence \
156
	virusbtestdata \
157
	vmwareverdata \
158
	vmx2xmldata \
159
	xlconfigdata \
160
	xmconfigdata \
E
Eric Blake 已提交
161
	xml2sexprdata \
162 163
	xml2vmxdata \
	virstorageutildata \
164
	virfilecachedata \
M
Martin Kletzander 已提交
165
	virresctrldata \
166
	$(NULL)
K
Karel Zak 已提交
167

168
test_helpers = commandhelper ssh
169
test_programs = virshtest sockettest \
170
	virhostcputest virbuftest \
171
	commandtest seclabeltest \
172
	virhashtest virconftest \
E
Eric Blake 已提交
173
	viratomictest \
174
	utiltest shunloadtest \
175
	virtimetest viruritest virkeyfiletest \
176
	viralloctest \
H
Hu Tao 已提交
177
	virauthconfigtest \
178 179
	virbitmaptest \
	vircgrouptest \
180
	vircryptotest \
M
Michal Privoznik 已提交
181
	virpcitest \
182
	virendiantest \
183
	virfiletest \
P
Pavel Hrdina 已提交
184
	virfilecachetest \
185
	virfirewalltest \
J
Ján Tomko 已提交
186
	viriscsitest \
187
	virkeycodetest \
188
	virlockspacetest \
189
	virlogtest \
190
	virrotatingfiletest \
J
Ján Tomko 已提交
191
	virschematest \
192
	virstringtest \
193
	virportallocatortest \
V
Viktor Mihajlovski 已提交
194
	sysinfotest \
195
	virkmodtest \
196
	vircapstest \
M
Michal Privoznik 已提交
197
	domaincapstest \
198
	domainconftest \
199
	virhostdevtest \
M
Michal Privoznik 已提交
200
	virnetdevtest \
201
	virtypedparamtest \
S
Simon Kobyda 已提交
202
	vshtabletest \
203
	virerrortest \
204
	$(NULL)
205

206 207 208 209 210 211 212 213 214 215
test_libraries = libshunload.la \
	virportallocatormock.la \
	virnetdaemonmock.la \
	virnetserverclientmock.la \
	vircgroupmock.la \
	virpcimock.la \
	virnetdevmock.la \
	virrandommock.la \
	virhostcpumock.la \
	domaincapsmock.la \
P
Pavel Hrdina 已提交
216
	virfilecachemock.la \
217 218
	$(NULL)

E
Eric Blake 已提交
219 220 221 222
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
223
	virnetdaemontest \
E
Eric Blake 已提交
224
	virnetserverclienttest \
225 226
	virnettlscontexttest \
	virnettlssessiontest \
E
Eric Blake 已提交
227 228 229
	$(NULL)
endif WITH_REMOTE

230 231
if WITH_LINUX
test_programs += fchosttest
232
test_programs += scsihosttest
233
test_programs += vircaps2xmltest
M
Martin Kletzander 已提交
234
test_programs += virresctrltest
235 236
test_libraries += virusbmock.la \
	virnetdevbandwidthmock.la \
237
	virnumamock.la \
238
	virtestmock.la \
239
	virfilemock.la \
240
	$(NULL)
241 242
endif WITH_LINUX

243 244 245 246
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

247
if WITH_DBUS
248
test_programs += virdbustest \
249 250
                 virsystemdtest \
                 $(NULL)
251
test_libraries += virdbusmock.la
J
Ján Tomko 已提交
252
if WITH_POLKIT
253
test_programs += virpolkittest
J
Ján Tomko 已提交
254
endif WITH_POLKIT
255
endif WITH_DBUS
256

257
if WITH_SECDRIVER_SELINUX
258
if WITH_ATTR
259 260
test_programs += securityselinuxtest \
                 viridentitytest
261
if WITH_QEMU
262
test_programs += securityselinuxlabeltest
263 264 265
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
266

267 268
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
269

270
if WITH_LIBXL
271
test_programs += xlconfigtest xml2sexprtest sexpr2xmltest \
272
	xmconfigtest libxlxml2domconfigtest
273
test_libraries += libxltestdriver.la libxlmock.la
274 275
endif WITH_LIBXL

276
if WITH_QEMU
277
test_programs += qemuxml2argvtest qemuxml2xmltest \
J
Ján Tomko 已提交
278
	qemuargv2xmltest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
279
	qemumonitorjsontest qemuhotplugtest \
280
	qemuagenttest qemucapabilitiestest qemucaps2xmltest \
281
	qemumemlocktest \
282 283
	qemucommandutiltest \
	qemublocktest \
284
	qemumigparamstest \
285
	qemusecuritytest \
286
	qemufirmwaretest \
287
	$(NULL)
J
Jiri Denemark 已提交
288
test_helpers += qemucapsprobe
289 290 291 292 293
test_libraries += libqemumonitortestutils.la \
		libqemutestdriver.la \
		qemuxml2argvmock.la \
		qemucaps2xmlmock.la \
		qemucapsprobemock.la \
294
		qemucpumock.la \
295
		$(NULL)
296
endif WITH_QEMU
297

298
if WITH_LXC
299
test_programs += lxcxml2xmltest lxcconf2xmltest
300
endif WITH_LXC
301

302
if WITH_OPENVZ
303
test_programs += openvzutilstest
304
endif WITH_OPENVZ
305

306
if WITH_ESX
307
test_programs += esxutilstest
308
endif WITH_ESX
309

Y
Yohan BELLEGUIC 已提交
310 311 312 313
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

314
if WITH_VMX
315
test_programs += vmx2xmltest xml2vmxtest
316
endif WITH_VMX
317

318 319 320 321
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
322
if WITH_BHYVE
323
test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest
324
test_libraries += bhyvexml2argvmock.la bhyveargv2xmlmock.la
R
Roman Bogorodskiy 已提交
325 326
endif WITH_BHYVE

327
if WITH_CIL
328
test_programs += objectlocking
329
endif WITH_CIL
330

331
if WITH_YAJL
332
test_programs += virjsontest
333
endif WITH_YAJL
334

335 336 337 338
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
		$(NULL)
339

340
if WITH_NETWORK
341 342 343 344
test_programs += \
		networkxml2conftest \
		networkxml2firewalltest \
		$(NULL)
345
endif WITH_NETWORK
346

347 348
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
349
endif WITH_STORAGE_SHEEPDOG
350

351
test_programs += nwfilterxml2xmltest
352
test_programs += virnwfilterbindingxml2xmltest
353

354 355
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
356
test_programs += nwfilterxml2firewalltest
357 358
endif WITH_NWFILTER

359
if WITH_STORAGE
360
test_programs += storagevolxml2argvtest
361
test_programs += storagepoolxml2argvtest
362
test_programs += virstorageutiltest
363
test_programs += storagepoolxml2xmltest
364
test_programs += storagepoolcapstest
365
endif WITH_STORAGE
366

367 368
if WITH_STORAGE_FS
test_programs += virstoragetest
369
endif WITH_STORAGE_FS
370

O
Osier Yang 已提交
371 372 373 374
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

375
if WITH_NSS
376 377
test_helpers += nsslinktest nssguestlinktest
test_programs += nsstest nssguesttest
378
test_libraries += nssmock.la
379 380
endif WITH_NSS

381
test_programs += storagevolxml2xmltest
382

383
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
384

385
test_programs += interfacexml2xmltest
386

387
test_programs += cputest
388

P
Peter Krempa 已提交
389 390
test_programs += metadatatest

J
Ján Tomko 已提交
391 392
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
393 394
test_programs += genericxml2xmltest

395
if WITH_LINUX
396 397 398
test_programs += virusbtest \
	virnetdevbandwidthtest \
	$(NULL)
399 400
endif WITH_LINUX

J
Ján Tomko 已提交
401
test_scripts =
402 403 404 405 406 407 408 409 410 411 412 413
libvirtd_test_scripts = \
	libvirtd-fail \
	libvirtd-pool \
	virsh-cpuset \
	virsh-define-dev-segfault \
	virsh-int-overflow \
	virsh-optparse \
	virsh-read-bufsiz \
	virsh-read-non-seekable \
	virsh-schedinfo \
	virsh-self-test \
	virt-admin-self-test \
414
	virsh-snapshot \
415 416 417 418
	virsh-start \
	virsh-undefine \
	virsh-uriprecedence \
	virsh-vcpupin \
419
	$(NULL)
420

421 422 423
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

424
test_programs += \
425 426
	eventtest \
	virdrivermoduletest
427
else ! WITH_LIBVIRTD
428
EXTRA_DIST += $(libvirtd_test_scripts)
429
endif ! WITH_LIBVIRTD
430

431 432
test_programs += objecteventtest

J
Jamie Strandboge 已提交
433
if WITH_SECDRIVER_APPARMOR
434
if WITH_LIBVIRTD
J
Jamie Strandboge 已提交
435
test_scripts += virt-aa-helper-test
436 437
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
438 439
EXTRA_DIST += virt-aa-helper-test

440 441
EXTRA_DIST += $(test_scripts)

442 443 444 445 446 447 448 449 450 451 452 453 454
if WITH_LINUX
check-access: file-access-clean
	VIR_TEST_FILE_ACCESS=1 $(MAKE) $(AM_MAKEFLAGS) check
	$(PERL) check-file-access.pl | sort -u

file-access-clean:
	> test_file_access.txt
endif WITH_LINUX

EXTRA_DIST += \
	check-file-access.pl \
	file_access_whitelist.txt

455 456
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
457
noinst_LTLIBRARIES = $(test_libraries)
458
else ! WITH_TESTS
459
check_PROGRAMS = $(test_programs) $(test_helpers)
460
check_LTLIBRARIES = $(test_libraries)
461
endif ! WITH_TESTS
462

463 464
TESTS = $(test_programs) \
	$(test_scripts)
465

466
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
467
TESTS_ENVIRONMENT = \
468 469 470 471
  abs_top_builddir="$(abs_top_builddir)" \
  abs_top_srcdir="$(abs_top_srcdir)" \
  abs_builddir="$(abs_builddir)" \
  abs_srcdir="$(abs_srcdir)" \
472 473 474 475
  SHELL="$(SHELL)" \
  LIBVIRT_AUTOSTART=0 \
  LC_ALL=C \
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \
476 477
  $(VG)

478

479 480
VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \
	--trace-children-skip="*/tools/virsh","*/tests/commandhelper" \
481
	--suppressions=$(abs_srcdir)/.valgrind.supp
482
valgrind:
483
	$(MAKE) check VG="$(LIBTOOL) --mode=execute $(VALGRIND)"
484

485 486 487
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
488
sockettest_LDADD = $(LDADDS)
489

490 491
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
492 493 494
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
495 496
libxl_LDADDS += $(LDADDS)

497 498 499 500
libxltestdriver_la_SOURCES =
libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
libxltestdriver_la_LIBADD = $(libxl_LDADDS)

501 502 503 504
xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
505

506 507 508 509 510
xml2sexprtest_SOURCES = \
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xml2sexprtest_LDADD = $(libxl_LDADDS)

511 512 513 514 515
sexpr2xmltest_SOURCES = \
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
sexpr2xmltest_LDADD = $(libxl_LDADDS)

516 517 518 519 520
xmconfigtest_SOURCES = \
	xmconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xmconfigtest_LDADD = $(libxl_LDADDS)

521 522 523 524 525
libxlxml2domconfigtest_SOURCES = \
	libxlxml2domconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
libxlxml2domconfigtest_LDADD = $(libxl_LDADDS) $(LIBXML_LIBS)

526 527 528 529 530
libxlmock_la_SOURCES = \
	libxlmock.c
libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS)
libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libxlmock_la_LIBADD = $(MOCKLIBS_LIBS)
531

532
else ! WITH_LIBXL
533
EXTRA_DIST += xlconfigtest.c xml2sexprtest.c sexpr2xmltest.c \
534
	xmconfigtest.c libxlxml2domconfigtest.c
535 536
endif ! WITH_LIBXL

537 538 539
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
540
	testutilsqemuschema.h testutilsqemuschema.c \
541 542
	$(NULL)

543
if WITH_QEMU
544

545 546
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

547
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
548
if WITH_NETWORK
E
Eric Blake 已提交
549
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
550
endif WITH_NETWORK
551 552 553
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
554
if WITH_DTRACE_PROBES
555
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
556
endif WITH_DTRACE_PROBES
557

558
libqemutestdriver_la_SOURCES =
559
libqemutestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
560 561
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)

562
qemucpumock_la_SOURCES = \
563
	qemucpumock.c testutilshostcpus.h
564 565 566
qemucpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
qemucpumock_la_LIBADD = $(MOCKLIBS_LIBS)

567
qemuxml2argvtest_SOURCES = \
568
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
569 570 571
	testutils.c testutils.h \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
572 573
qemuxml2argvtest_LDADD = libqemutestdriver.la \
	$(LDADDS) $(LIBXML_LIBS)
574

575 576
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
577
qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
578
qemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
579

580
qemuxml2xmltest_SOURCES = \
581
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
582
	testutils.c testutils.h
583
qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
584 585 586 587

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
588
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
589

590 591 592 593 594
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
595 596
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
597

598 599 600 601 602
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
603 604
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
605

J
Jiri Denemark 已提交
606 607 608 609 610 611 612 613 614 615
qemucapsprobe_SOURCES = \
	qemucapsprobe.c
qemucapsprobe_LDADD = \
	libqemutestdriver.la $(LDADDS)

qemucapsprobemock_la_SOURCES = \
	qemucapsprobemock.c
qemucapsprobemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
qemucapsprobemock_la_LIBADD = $(MOCKLIBS_LIBS)

616 617 618 619 620 621 622 623
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)

624 625 626
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
627
	testutilsqemu.c testutilsqemu.h \
628
	$(NULL)
629
qemucaps2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
630

P
Pavel Hrdina 已提交
631 632
qemucaps2xmlmock_la_SOURCES = \
	qemucaps2xmlmock.c
633
qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
634
qemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
635

P
Peter Krempa 已提交
636 637 638 639 640
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
641
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
P
Peter Krempa 已提交
642

643 644 645 646 647
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
648
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
649

650
qemublocktest_SOURCES = \
651 652
	qemublocktest.c \
	testutils.h testutils.c \
653
	testutilsqemu.h testutilsqemu.c \
654 655
	$(NULL)
qemublocktest_LDADD = \
656
	libqemumonitortestutils.la \
657 658 659
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(qemu_LDADDS) \
660
	$(LDADDS) \
661 662
	$(NULL)

663 664 665
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
666
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
667 668 669 670 671 672

qemumemlocktest_SOURCES = \
	qemumemlocktest.c \
	testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemumemlocktest_LDADD = $(qemu_LDADDS) $(LDADDS)
673 674 675 676 677 678 679 680 681

qemumigparamstest_SOURCES = \
	qemumigparamstest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemumigparamstest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)

682 683 684 685 686 687 688
qemusecuritytest_SOURCES = \
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
	testutils.h testutils.c \
	testutilsqemu.h testutilsqemu.c
qemusecuritytest_LDADD = $(qemu_LDADDS) $(LDADDS)

689 690 691
qemufirmwaretest_SOURCES = \
	qemufirmwaretest.c \
	testutils.h testutils.c \
692
	virfilewrapper.c virfilewrapper.h \
693 694 695
	$(NULL)
qemufirmwaretest_LDADD = $(qemu_LDADDS) $(LDADDS)

696
else ! WITH_QEMU
697
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
J
Ján Tomko 已提交
698
	domainsnapshotxml2xmltest.c \
P
Peter Krempa 已提交
699
	testutilsqemu.c testutilsqemu.h \
700
	testutilsqemuschema.c testutilsqemuschema.h \
701
	qemumonitorjsontest.c qemuhotplugtest.c \
702
	qemuagenttest.c qemucapabilitiestest.c \
703
	qemucaps2xmltest.c qemucommandutiltest.c \
704
	qemumemlocktest.c qemucpumock.c testutilshostcpus.h \
705
	qemublocktest.c \
706
	qemumigparamstest.c \
707 708
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
709
	qemufirmwaretest.c \
710
	$(QEMUMONITORTESTUTILS_SOURCES)
711
endif ! WITH_QEMU
712

713 714
if WITH_LXC

E
Eric Blake 已提交
715
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
716
if WITH_NETWORK
E
Eric Blake 已提交
717
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
718
endif WITH_NETWORK
719
lxc_LDADDS += $(LDADDS)
720 721 722 723

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
724
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
725 726

lxcconf2xmltest_SOURCES = \
727
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
728 729
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
730
else ! WITH_LXC
731
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
732
endif ! WITH_LXC
733

734 735 736 737
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
738
openvzutilstest_LDADD = $(LDADDS)
739
else ! WITH_OPENVZ
740
EXTRA_DIST += openvzutilstest.c
741
endif ! WITH_OPENVZ
742 743
EXTRA_DIST += openvzutilstest.conf

744 745 746 747
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
748
esxutilstest_LDADD = $(LDADDS)
749
else ! WITH_ESX
750
EXTRA_DIST += esxutilstest.c
751
endif ! WITH_ESX
752

Y
Yohan BELLEGUIC 已提交
753 754 755 756 757 758 759 760 761 762
if WITH_VBOX
vboxsnapshotxmltest_SOURCES = \
	vboxsnapshotxmltest.c \
	testutils.c testutils.h
vbox_LDADDS = ../src/libvirt_driver_vbox_impl.la
vboxsnapshotxmltest_LDADD = $(LDADDS) $(vbox_LDADDS)
else ! WITH_VBOX
EXTRA_DIST += vboxsnapshotxmltest.c
endif ! WITH_VBOX

763
if WITH_VMX
764 765 766
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
767
vmx2xmltest_LDADD = $(LDADDS)
768 769 770 771

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
772
xml2vmxtest_LDADD = $(LDADDS)
773
else ! WITH_VMX
774
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
775
endif ! WITH_VMX
776

777 778 779 780 781 782 783 784 785
if WITH_VMWARE
vmwarevertest_SOURCES = \
    vmwarevertest.c \
    testutils.c testutils.h
vmwarevertest_LDADD = $(LDADDS)
else ! WITH_VMWARE
EXTRA_DIST += vmwarevertest.c
endif ! WITH_VMWARE

R
Roman Bogorodskiy 已提交
786 787 788
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
789
bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
790
bhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
791

792 793 794 795 796
bhyveargv2xmlmock_la_SOURCES = \
	bhyveargv2xmlmock.c
bhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
bhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)

R
Roman Bogorodskiy 已提交
797
bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
R
Roman Bogorodskiy 已提交
798 799 800
if WITH_STORAGE
bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
R
Roman Bogorodskiy 已提交
801 802 803 804 805
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
806 807 808 809 810

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
811 812 813 814 815

bhyveargv2xmltest_SOURCES = \
	bhyveargv2xmltest.c \
	testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
816
else ! WITH_BHYVE
817 818 819 820 821 822
EXTRA_DIST += \
	bhyvexml2argvtest.c \
	bhyveargv2xmltest.c \
	bhyvexml2xmltest.c \
	bhyvexml2argvmock.c \
	bhyveargv2xmlmock.c
R
Roman Bogorodskiy 已提交
823 824
endif ! WITH_BHYVE

825 826 827 828 829
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
830 831 832 833 834
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

835
if WITH_NETWORK
836 837
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
838
	testutils.c testutils.h
839
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
840 841 842 843 844 845

networkxml2firewalltest_SOURCES = \
	networkxml2firewalltest.c \
	testutils.c testutils.h
networkxml2firewalltest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)

846
else ! WITH_NETWORK
847
EXTRA_DIST += networkxml2conftest.c
848
endif !	WITH_NETWORK
849

850 851 852 853
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
854
storagebackendsheepdogtest_LDADD = \
855
	../src/libvirt_storage_backend_sheepdog_priv.la \
856
	../src/libvirt_driver_storage_impl.la \
857
	$(LDADDS)
858
else ! WITH_STORAGE_SHEEPDOG
859
EXTRA_DIST += storagebackendsheepdogtest.c
860
endif ! WITH_STORAGE_SHEEPDOG
861

862 863 864 865
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
866

867 868 869 870 871
virnwfilterbindingxml2xmltest_SOURCES = \
	virnwfilterbindingxml2xmltest.c \
	testutils.c testutils.h
virnwfilterbindingxml2xmltest_LDADD = $(LDADDS)

872 873 874 875 876
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
877 878 879 880 881 882

nwfilterxml2firewalltest_SOURCES = \
	nwfilterxml2firewalltest.c \
	testutils.c testutils.h
nwfilterxml2firewalltest_LDADD = \
	../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
883 884
endif WITH_NWFILTER

J
Ján Tomko 已提交
885 886 887 888 889
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
890 891 892 893 894
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
895

896
if WITH_STORAGE
897 898 899 900 901 902 903 904 905 906
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

907 908 909 910
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
911
	$(LIBXML_LIBS) \
912 913 914 915
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(LDADDS)
J
Ján Tomko 已提交
916

917 918 919 920 921 922 923 924 925 926
storagepoolxml2argvtest_SOURCES = \
    storagepoolxml2argvtest.c \
    testutils.c testutils.h
storagepoolxml2argvtest_LDADD = \
	$(LIBXML_LIBS) \
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(LDADDS)

927 928 929 930 931 932 933
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS) \
	../src/libvirt_driver_storage_impl.la \
	$(GNULIB_LIBS)

934 935 936 937
storagepoolcapstest_SOURCES = \
        storagepoolcapstest.c testutils.h testutils.c
storagepoolcapstest_LDADD = $(LDADDS)

938
else ! WITH_STORAGE
939
EXTRA_DIST += storagevolxml2argvtest.c
940
EXTRA_DIST += virstorageutiltest.c
941
EXTRA_DIST += storagepoolxml2argvtest.c
942
EXTRA_DIST += storagepoolxml2xmltest.c
943
EXTRA_DIST += storagepoolcapstest.c
944
endif ! WITH_STORAGE
945

946 947 948 949 950
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
951 952 953
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
954
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
955

956 957 958 959 960
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

961 962 963
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
964
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Jiri Denemark 已提交
965 966 967 968
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS) $(GNULIB_LIBS)
endif WITH_QEMU
969

P
Peter Krempa 已提交
970 971 972 973 974
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

975 976 977 978 979
virerrortest_SOURCES = \
	virerrortest.c \
	testutils.c testutils.h
virerrortest_LDADD = $(LDADDS)

S
Simon Kobyda 已提交
980 981 982 983 984 985 986
vshtabletest_SOURCES = \
	vshtabletest.c \
	testutils.c testutils.h
vshtabletest_LDADD = \
	$(LDADDS) \
	../tools/libvirt_shell.la

987 988 989 990 991
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

992
virconftest_SOURCES = \
993
	virconftest.c testutils.h testutils.c
994
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
995

996
virhostcputest_SOURCES = \
997
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
998
virhostcputest_LDADD = $(LDADDS)
999

1000 1001 1002 1003
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

1004 1005 1006 1007
# Must not link to any libvirt modules - libc / gnulib only
# otherwise external libraries might unexpectedly leak
# file descriptors into commandhelper invalidating the
# test logic assumptions
1008 1009
commandhelper_SOURCES = \
	commandhelper.c
1010 1011 1012 1013
commandhelper_LDADD = \
	$(NO_INDIRECT_LDFLAGS) \
	$(GNULIB_LIBS)

1014
commandhelper_LDFLAGS = -static
1015

1016

1017 1018 1019 1020
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

1021
vircapstest_SOURCES = \
1022 1023 1024 1025 1026 1027 1028
	vircapstest.c testutils.h testutils.c
if WITH_LXC
vircapstest_SOURCES += testutilslxc.c testutilslxc.h
endif WITH_LXC
if WITH_QEMU
vircapstest_SOURCES += testutilsqemu.c testutilsqemu.h
endif WITH_QEMU
1029
vircapstest_LDADD = $(qemu_LDADDS) $(LDADDS)
1030

1031 1032 1033 1034
domaincapsmock_la_SOURCES = domaincapsmock.c
domaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
domaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1035
domaincapstest_SOURCES = \
1036 1037 1038
	domaincapstest.c testutils.h testutils.c \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
M
Michal Privoznik 已提交
1039 1040
domaincapstest_LDADD = $(LDADDS)

1041 1042
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
1043
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
1044 1045
endif WITH_QEMU

1046 1047
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
1048
domaincapstest_LDADD += libxltestdriver.la $(GNULIB_LIBS)
1049 1050
endif WITH_LIBXL

1051 1052 1053 1054
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

1055 1056
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1057
virnetmessagetest_LDADD = $(LDADDS)
1058

1059 1060
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1061
virnetsockettest_LDADD = $(LDADDS)
1062

1063 1064
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1065
	testutils.h testutils.c
1066
virnetdaemontest_LDADD = $(LDADDS)
1067

1068 1069 1070 1071 1072
virnetdaemonmock_la_SOURCES = \
	virnetdaemonmock.c
virnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)

1073 1074 1075 1076 1077 1078 1079
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
1080
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1081
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1082

1083
virnettlscontexttest_SOURCES = \
1084 1085 1086
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1087
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
1088 1089 1090 1091
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1092
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
1093 1094 1095
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
1096 1097
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
1098
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
1099
EXTRA_DIST += pkix_asn1_tab.c
1100
endif ! HAVE_LIBTASN1
1101

1102 1103
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1104
virtimetest_LDADD = $(LDADDS)
1105

J
Ján Tomko 已提交
1106 1107
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1108
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1109

1110 1111 1112 1113
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1114 1115
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1116 1117 1118 1119 1120 1121 1122
virstoragetest_LDADD = $(LDADDS) \
	../src/libvirt.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	../src/libvirt_driver_storage_impl.la \
	../gnulib/lib/libgnu.la \
	$(NULL)
1123

1124 1125 1126
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1127
if WITH_SELINUX
1128
viridentitytest_LDADD += $(SELINUX_LIBS)
1129 1130 1131
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1132

J
Ján Tomko 已提交
1133 1134 1135 1136
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1137 1138 1139 1140
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1141 1142 1143 1144
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1145 1146 1147 1148
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1149 1150 1151 1152
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1153
virportallocatormock_la_SOURCES = \
1154
	virportallocatormock.c
1155 1156
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1157

1158 1159 1160 1161 1162 1163
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
1164
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1165
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1166

1167 1168 1169 1170
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1171 1172 1173 1174
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1175 1176 1177 1178 1179 1180
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
1181
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1182
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1183

J
John Ferlan 已提交
1184 1185 1186 1187 1188
virrandommock_la_SOURCES = \
	virrandommock.c
virrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virrandommock_la_LIBADD = $(MOCKLIBS_LIBS)

1189 1190 1191 1192
virhostcpumock_la_SOURCES = \
	virhostcpumock.c
virhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1193

P
Pavel Hrdina 已提交
1194 1195 1196 1197 1198
virfilecachemock_la_SOURCES = \
	virfilecachemock.c
virfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)

1199 1200
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1201
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1202 1203
vircaps2xmltest_LDADD = $(LDADDS)

M
Martin Kletzander 已提交
1204 1205 1206 1207
virnumamock_la_SOURCES = \
	virnumamock.c
virnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1208

M
Martin Kletzander 已提交
1209 1210 1211 1212
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

1213 1214 1215 1216
virfilemock_la_SOURCES = \
	virfilemock.c
virfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilemock_la_LIBADD = $(MOCKLIBS_LIBS)
1217
else ! WITH_LINUX
M
Martin Kletzander 已提交
1218
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \
1219
			  virfilewrapper.h virresctrltest.c virfilemock.c
1220
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1221

1222
if WITH_NSS
M
Michal Privoznik 已提交
1223 1224 1225
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
1226
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1227 1228
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
1229
	$(LDADDS) \
M
Michal Privoznik 已提交
1230 1231
	../tools/nss/libnss_libvirt_impl.la

1232 1233 1234
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
1235 1236
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1237 1238
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
1239
	$(LDADDS) \
1240 1241
	../tools/nss/libnss_libvirt_guest_impl.la

M
Michal Privoznik 已提交
1242 1243 1244 1245 1246
nssmock_la_SOURCES = \
	nssmock.c
nssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
nssmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1247 1248 1249
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
1250 1251
nsslinktest_CFLAGS = \
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1252 1253 1254 1255
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

1256
nssguestlinktest_SOURCES = nsslinktest.c
1257 1258 1259
nssguestlinktest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1260 1261 1262
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1263 1264 1265
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1266

1267 1268 1269 1270 1271 1272
virdeterministichashmock_la_SOURCES = \
	virdeterministichashmock.c
virdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)

test_libraries += virdeterministichashmock.la
1273

1274
if WITH_YAJL
1275 1276 1277 1278
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

1279
test_programs += virmacmaptest
1280
else ! WITH_YAJL
1281
EXTRA_DIST +=  virmacmaptest.c
1282
endif ! WITH_YAJL
1283

M
Michal Privoznik 已提交
1284 1285 1286 1287 1288 1289 1290 1291
virnetdevtest_SOURCES = \
	virnetdevtest.c testutils.h testutils.c
virnetdevtest_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
virnetdevtest_LDADD = $(LDADDS)

virnetdevmock_la_SOURCES = \
	virnetdevmock.c
virnetdevmock_la_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
1292
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1293
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1294

1295 1296 1297 1298
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

1299 1300 1301 1302 1303
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1304 1305 1306 1307
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1308
virusbmock_la_SOURCES = virusbmock.c
1309
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1310
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1311
	$(PROBES_O) \
1312
	../src/libvirt_util.la
1313 1314 1315

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
1316
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1317
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1318

1319 1320 1321
virtestmock_la_SOURCES = \
	virtestmock.c
virtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1322 1323
virtestmock_la_LIBADD = \
	$(MOCKLIBS_LIBS) \
1324
	$(PROBES_O) \
1325
	../src/libvirt_util.la
1326
else ! WITH_LINUX
1327
	EXTRA_DIST += virusbtest.c virusbmock.c \
1328 1329
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1330 1331
endif ! WITH_LINUX

1332 1333 1334 1335
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1336
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1337

1338 1339 1340 1341 1342
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1343

1344 1345 1346 1347 1348
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1349 1350
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1351
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1352
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1353

1354
else ! WITH_DBUS
1355
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1356
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1357

1358 1359
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1360
viruritest_LDADD = $(LDADDS)
1361

1362 1363
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1364
virkeyfiletest_LDADD = $(LDADDS)
1365

1366 1367 1368 1369
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1370 1371
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1372
virauthconfigtest_LDADD = $(LDADDS)
1373

1374
seclabeltest_SOURCES = \
1375
	seclabeltest.c testutils.h testutils.c
1376
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1377

1378
if WITH_SECDRIVER_SELINUX
1379
if WITH_ATTR
1380 1381
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1382
else ! WITH_TESTS
1383
check_LTLIBRARIES += libsecurityselinuxhelper.la
1384
endif ! WITH_TESTS
1385 1386 1387

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1388
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1389 1390 1391

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1392
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1393 1394
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1395 1396 1397 1398 1399

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1400
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(LDADDS) $(SELINUX_LIBS)
1401 1402
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1403 1404 1405
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1406 1407
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1408

1409 1410 1411 1412
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1413 1414 1415
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1416

1417
viratomictest_SOURCES = \
L
Laine Stump 已提交
1418
	viratomictest.c testutils.h testutils.c
1419 1420
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1421 1422 1423 1424
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1425 1426 1427 1428
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1429 1430 1431 1432
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1433 1434 1435 1436
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1437 1438
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1439
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1440 1441
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1442 1443 1444
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1445

M
Matthias Bolte 已提交
1446 1447 1448 1449
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1450
if WITH_LIBVIRTD
1451 1452 1453
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1454
endif WITH_LIBVIRTD
1455

1456 1457
if WITH_LIBVIRTD
eventtest_SOURCES = \
1458
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1459
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1460
endif WITH_LIBVIRTD
1461

1462 1463
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1464
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1465 1466 1467

shunloadtest_SOURCES = \
	shunloadtest.c
1468
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1469 1470
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1471 1472 1473 1474
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1475 1476 1477 1478
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1479 1480 1481 1482
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1483 1484 1485 1486 1487
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1488 1489 1490 1491 1492
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1493
if WITH_LINUX
O
Osier Yang 已提交
1494 1495 1496 1497
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1498 1499 1500 1501
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1502 1503
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1504
EXTRA_DIST += scsihosttest.c
1505 1506
endif  ! WITH_LINUX

O
Osier Yang 已提交
1507 1508 1509 1510 1511 1512 1513 1514 1515
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

else ! WITH_LINUX
EXTRA_DIST += virscsitest.c
endif  ! WITH_LINUX

1516 1517 1518 1519 1520 1521
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1522
objectlocking_SOURCES = objectlocking.ml
1523 1524 1525 1526

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

1527
objectlocking: objectlocking.cmx objectlocking-files.txt
1528 1529
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1530

1531
objectlocking-files.txt:
1532 1533
	find $(top_builddir)/src/ -name '*.i' > $@

1534
else ! WITH_CIL
1535
EXTRA_DIST += objectlocking.ml
1536
endif ! WITH_CIL
1537

1538
CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx \
1539
	objectlocking-files.txt