Makefile.am 38.4 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
AM_CPPFLAGS = \
20
	-I$(top_builddir) -I$(top_srcdir) \
21 22
	-I$(top_builddir)/include -I$(top_srcdir)/include \
	-I$(top_builddir)/src -I$(top_srcdir)/src \
23
	-I$(top_srcdir)/src/util \
24
	-I$(top_srcdir)/src/conf \
25
	-I$(top_builddir)/src/rpc \
26
	$(NULL)
E
Eric Blake 已提交
27

28 29
WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)

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

47 48 49
AM_LDFLAGS = \
	-export-dynamic

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

54
DRIVERLIB_LDFLAGS = \
55 56 57
	-avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
	$(MINGW_EXTRA_LDFLAGS)
58 59 60
if WITH_MACOS
DRIVERLIB_LDFLAGS += -Wl,-flat_namespace
endif WITH_MACOS
61

62
PROBES_O =
63
if WITH_DTRACE_PROBES
64
PROBES_O += ../src/libvirt_probes.lo
65
endif WITH_DTRACE_PROBES
66

K
Karel Zak 已提交
67
LDADDS = \
68
	$(NO_INDIRECT_LDFLAGS) \
69
	$(PROBES_O) \
D
Daniel P. Berrangé 已提交
70 71 72
	../src/libvirt.la \
	$(GLIB_LIBS) \
	$(NULL)
K
Karel Zak 已提交
73

74
MOCKLIBS_LIBS = \
75
	../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 \
85
	domaincapsdata \
E
Eric Blake 已提交
86
	domainbackupxml2xmlin \
87
	domainbackupxml2xmlout \
88
	domainconfdata \
89
	domainschemadata \
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
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
110
	qemuagentdata \
111
	qemublocktestdata \
112
	qemucapabilitiesdata \
113
	qemucaps2xmloutdata \
114 115
	qemudomaincheckpointxml2xmlin \
	qemudomaincheckpointxml2xmlout \
116 117
	qemudomainsnapshotxml2xmlin \
	qemudomainsnapshotxml2xmlout \
118
	qemuhotplugtestcpus \
119 120
	qemuhotplugtestdevices \
	qemuhotplugtestdomains \
121
	qemumigparamsdata \
122
	qemumonitorjsondata \
E
Eric Blake 已提交
123 124
	qemuxml2argvdata \
	qemuxml2xmloutdata \
125
	qemustatusxml2xmldata \
126
	qemumemlockdata \
127
	qemufirmwaredata \
128
	qemuvhostuserdata \
J
Ján Tomko 已提交
129
	secretxml2xmlin \
130
	securityselinuxhelperdata \
131
	securityselinuxlabeldata \
132
	storagepoolcapsschemadata \
133
	storagepoolschemadata \
134
	storagepoolxml2xmlin \
E
Eric Blake 已提交
135
	storagepoolxml2xmlout \
136
	storagepoolxml2argvdata \
137
	storagevolschemadata \
138
	storagevolxml2argvdata \
139
	storagevolxml2xmlin \
E
Eric Blake 已提交
140
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
141
	sysinfodata \
142
	test-lib.sh \
Y
Yohan BELLEGUIC 已提交
143
	vboxsnapshotxmldata \
144
	vircaps2xmldata \
145
	vircgroupdata \
146
	virconfdata \
147
	virfiledata \
148
	virjsondata \
149
	virmacmaptestdata \
150
	virmock.h \
151
	virmockstathelpers.c \
152
	virnetdaemondata \
153
	virnetdevtestdata \
154
	virnetdevopenvswitchdata \
155
	virnetworkportxml2xmldata \
156
	virnwfilterbindingxml2xmldata \
157
	virpcitestdata \
O
Osier Yang 已提交
158
	virscsidata \
159
	virsh-uriprecedence \
160
	virusbtestdata \
161
	vmwareverdata \
162
	vmx2xmldata \
163
	xlconfigdata \
164
	xmconfigdata \
165 166
	xml2vmxdata \
	virstorageutildata \
167
	virfilecachedata \
M
Martin Kletzander 已提交
168
	virresctrldata \
169
	$(NULL)
K
Karel Zak 已提交
170

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

208
test_libraries = libshunload.la \
209 210 211 212 213 214 215
	libvirportallocatormock.la \
	libvirnetdaemonmock.la \
	libvirnetserverclientmock.la \
	libvircgroupmock.la \
	libvirpcimock.la \
	libvirnetdevmock.la \
	libvirrandommock.la \
216
	libvirprocessmock.la \
217 218 219
	libvirhostcpumock.la \
	libdomaincapsmock.la \
	libvirfilecachemock.la \
220
	libqemuhotplugmock.la \
221 222
	$(NULL)

E
Eric Blake 已提交
223 224 225 226
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
227
	virnetdaemontest \
E
Eric Blake 已提交
228
	virnetserverclienttest \
229 230
	virnettlscontexttest \
	virnettlssessiontest \
E
Eric Blake 已提交
231 232 233
	$(NULL)
endif WITH_REMOTE

234 235
if WITH_LINUX
test_programs += fchosttest
236
test_programs += scsihosttest
237
test_programs += vircaps2xmltest
M
Martin Kletzander 已提交
238
test_programs += virresctrltest
239 240 241 242 243
test_libraries += libvirusbmock.la \
	libvirnetdevbandwidthmock.la \
	libvirnumamock.la \
	libvirtestmock.la \
	libvirfilemock.la \
244
	$(NULL)
245 246
endif WITH_LINUX

247 248 249 250
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

251
if WITH_DBUS
252
test_programs += virdbustest \
253 254
                 virsystemdtest \
                 $(NULL)
255
test_libraries += libvirdbusmock.la
J
Ján Tomko 已提交
256
if WITH_POLKIT
257
test_programs += virpolkittest
J
Ján Tomko 已提交
258
endif WITH_POLKIT
259
endif WITH_DBUS
260

261
if WITH_SECDRIVER_SELINUX
262
if WITH_ATTR
263 264
test_programs += securityselinuxtest \
                 viridentitytest
265
if WITH_QEMU
266
test_programs += securityselinuxlabeltest
267 268 269
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
270

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

275
if WITH_LIBXL
P
Peter Krempa 已提交
276
test_programs += xlconfigtest \
277
	xmconfigtest libxlxml2domconfigtest
278
test_libraries += libxltestdriver.la libxlmock.la
279 280
endif WITH_LIBXL

281
if WITH_QEMU
282
test_programs += qemuxml2argvtest qemuxml2xmltest \
283
	qemudomaincheckpointxml2xmltest qemudomainsnapshotxml2xmltest \
P
Peter Krempa 已提交
284
	qemumonitorjsontest qemuhotplugtest \
285
	qemuagenttest qemucapabilitiestest qemucaps2xmltest \
286
	qemumemlocktest \
287 288
	qemucommandutiltest \
	qemublocktest \
289
	qemumigparamstest \
290
	qemusecuritytest \
291
	qemufirmwaretest \
292
	qemuvhostusertest \
293
	$(NULL)
J
Jiri Denemark 已提交
294
test_helpers += qemucapsprobe
295 296
test_libraries += libqemumonitortestutils.la \
		libqemutestdriver.la \
297 298 299 300
		libqemuxml2argvmock.la \
		libqemucaps2xmlmock.la \
		libqemucapsprobemock.la \
		libqemucpumock.la \
301
		$(NULL)
302
endif WITH_QEMU
303

304
if WITH_LXC
305
test_programs += lxcxml2xmltest lxcconf2xmltest
306
endif WITH_LXC
307

308
if WITH_OPENVZ
309
test_programs += openvzutilstest
310
endif WITH_OPENVZ
311

312
if WITH_ESX
313
test_programs += esxutilstest
314
endif WITH_ESX
315

Y
Yohan BELLEGUIC 已提交
316 317 318 319
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

320
if WITH_VMX
321
test_programs += vmx2xmltest xml2vmxtest
322
endif WITH_VMX
323

324 325 326 327
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
328
if WITH_BHYVE
329
test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest
330
test_libraries += libbhyvexml2argvmock.la libbhyveargv2xmlmock.la
R
Roman Bogorodskiy 已提交
331 332
endif WITH_BHYVE

333
if WITH_YAJL
334
test_programs += virjsontest
335
endif WITH_YAJL
336

337 338
test_programs += \
		networkxml2xmlupdatetest \
339
		virnetworkportxml2xmltest \
340
		$(NULL)
341

342
if WITH_NETWORK
343
test_programs += \
344
		networkxml2xmltest \
345 346 347
		networkxml2conftest \
		networkxml2firewalltest \
		$(NULL)
348
endif WITH_NETWORK
349

350 351
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
352
endif WITH_STORAGE_SHEEPDOG
353

354
test_programs += nwfilterxml2xmltest
355
test_programs += virnwfilterbindingxml2xmltest
356

357 358
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
359
test_programs += nwfilterxml2firewalltest
360 361
endif WITH_NWFILTER

362
if WITH_STORAGE
363
test_programs += storagevolxml2argvtest
364
test_programs += storagepoolxml2argvtest
365
test_programs += virstorageutiltest
366
test_programs += storagepoolxml2xmltest
367
test_programs += storagepoolcapstest
368
endif WITH_STORAGE
369

370 371
if WITH_STORAGE_FS
test_programs += virstoragetest
372
endif WITH_STORAGE_FS
373

O
Osier Yang 已提交
374 375 376 377
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

378
if WITH_NSS
379 380
test_helpers += nsslinktest nssguestlinktest
test_programs += nsstest nssguesttest
381
test_libraries += libnssmock.la
382 383
endif WITH_NSS

384
test_programs += storagevolxml2xmltest
385

386
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
387

388
test_programs += interfacexml2xmltest
389

390
test_programs += cputest
391

P
Peter Krempa 已提交
392 393
test_programs += metadatatest

J
Ján Tomko 已提交
394 395
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
396 397
test_programs += genericxml2xmltest

398
if WITH_LINUX
399 400 401
test_programs += virusbtest \
	virnetdevbandwidthtest \
	$(NULL)
402 403
endif WITH_LINUX

J
Ján Tomko 已提交
404
test_scripts =
405 406 407 408 409 410 411 412 413 414 415 416
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 \
E
Eric Blake 已提交
417
	virsh-checkpoint \
418
	virsh-snapshot \
419 420 421 422
	virsh-start \
	virsh-undefine \
	virsh-uriprecedence \
	virsh-vcpupin \
423
	$(NULL)
424

425 426 427
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

428
test_programs += \
429
	eventtest \
430 431
	virdrivermoduletest \
	virdriverconnvalidatetest
432
else ! WITH_LIBVIRTD
433
EXTRA_DIST += $(libvirtd_test_scripts)
434
endif ! WITH_LIBVIRTD
435

436 437
test_programs += objecteventtest

J
Jamie Strandboge 已提交
438
if WITH_SECDRIVER_APPARMOR
439
if WITH_LIBVIRTD
J
Jamie Strandboge 已提交
440
test_scripts += virt-aa-helper-test
441 442
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
443 444
EXTRA_DIST += virt-aa-helper-test

445 446
EXTRA_DIST += $(test_scripts)

447 448 449
if WITH_LINUX
check-access: file-access-clean
	VIR_TEST_FILE_ACCESS=1 $(MAKE) $(AM_MAKEFLAGS) check
450
	$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-file-access.py \
451 452
		$(abs_builddir)/test_file_access.txt \
		$(abs_srcdir)/file_access_whitelist.txt | sort -u
453 454 455 456 457 458 459 460

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

EXTRA_DIST += \
	file_access_whitelist.txt

461 462
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
463
noinst_LTLIBRARIES = $(test_libraries)
464
else ! WITH_TESTS
465
check_PROGRAMS = $(test_programs) $(test_helpers)
466
check_LTLIBRARIES = $(test_libraries)
467
endif ! WITH_TESTS
468

469 470
TESTS = $(test_programs) \
	$(test_scripts)
471

472
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
473
TESTS_ENVIRONMENT = \
474 475 476 477
  abs_top_builddir="$(abs_top_builddir)" \
  abs_top_srcdir="$(abs_top_srcdir)" \
  abs_builddir="$(abs_builddir)" \
  abs_srcdir="$(abs_srcdir)" \
478 479 480
  LIBVIRT_AUTOSTART=0 \
  LC_ALL=C \
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \
481 482
  $(VG)

483

484 485
VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \
	--trace-children-skip="*/tools/virsh","*/tests/commandhelper" \
486
	--suppressions=$(abs_srcdir)/.valgrind.supp
487
valgrind:
488
	$(MAKE) check VG="$(LIBTOOL) --mode=execute $(VALGRIND)"
489

490 491 492
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
493
sockettest_LDADD = $(LDADDS)
494

495
if WITH_LIBXL
496 497 498 499
libxl_LDADDS = \
	../src/libvirt_driver_libxl_impl.la \
	$(LDADDS) \
	$(NULL)
500

501 502 503 504
libxltestdriver_la_SOURCES =
libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
libxltestdriver_la_LIBADD = $(libxl_LDADDS)

505 506 507 508
xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
509

510 511 512 513 514
xmconfigtest_SOURCES = \
	xmconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xmconfigtest_LDADD = $(libxl_LDADDS)

515 516 517 518 519
libxlxml2domconfigtest_SOURCES = \
	libxlxml2domconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
libxlxml2domconfigtest_LDADD = $(libxl_LDADDS) $(LIBXML_LIBS)

520 521
libxlmock_la_SOURCES = \
	libxlmock.c
D
Daniel P. Berrangé 已提交
522
libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS) $(GLIB_CFLAGS)
523 524
libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libxlmock_la_LIBADD = $(MOCKLIBS_LIBS)
525

526
else ! WITH_LIBXL
P
Peter Krempa 已提交
527
EXTRA_DIST += xlconfigtest.c \
528
	xmconfigtest.c libxlxml2domconfigtest.c
529 530
endif ! WITH_LIBXL

531 532 533
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
534
	testutilsqemuschema.h testutilsqemuschema.c \
535 536
	$(NULL)

537
if WITH_QEMU
538

539 540
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

541
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
542
if WITH_DTRACE_PROBES
543
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
544
endif WITH_DTRACE_PROBES
545
qemu_LDADDS += $(LDADDS)
546

547
libqemutestdriver_la_SOURCES =
548
libqemutestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
549
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)
550

551
libqemucpumock_la_SOURCES = \
552
	qemucpumock.c testutilshostcpus.h
553 554
libqemucpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemucpumock_la_LIBADD = $(MOCKLIBS_LIBS)
555

556 557 558 559 560
libqemuhotplugmock_la_SOURCES = \
	qemuhotplugmock.c
libqemuhotplugmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemuhotplugmock_la_LIBADD = $(MOCKLIBS_LIBS)

561
qemuxml2argvtest_SOURCES = \
562
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
563 564 565
	testutils.c testutils.h \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
566 567
qemuxml2argvtest_LDADD = libqemutestdriver.la \
	$(LDADDS) $(LIBXML_LIBS)
568

569
libqemuxml2argvmock_la_SOURCES = \
570
	qemuxml2argvmock.c
571 572
libqemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
573

574
qemuxml2xmltest_SOURCES = \
575
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
576 577
	testutils.c testutils.h \
	virfilewrapper.c virfilewrapper.h
578
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
579

580 581 582 583 584
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
585
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
586
	$(qemu_LDADDS)
587

588 589 590 591 592
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
593
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
594
	$(qemu_LDADDS)
595

J
Jiri Denemark 已提交
596 597 598 599 600
qemucapsprobe_SOURCES = \
	qemucapsprobe.c
qemucapsprobe_LDADD = \
	libqemutestdriver.la $(LDADDS)

601
libqemucapsprobemock_la_SOURCES = \
J
Jiri Denemark 已提交
602
	qemucapsprobemock.c
603 604
libqemucapsprobemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemucapsprobemock_la_LIBADD = $(MOCKLIBS_LIBS)
J
Jiri Denemark 已提交
605

606 607 608 609 610 611
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
612
	$(qemu_LDADDS)
613

614 615 616
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
617
	testutilsqemu.c testutilsqemu.h \
618
	$(NULL)
619
qemucaps2xmltest_LDADD = $(qemu_LDADDS)
620

621
libqemucaps2xmlmock_la_SOURCES = \
P
Pavel Hrdina 已提交
622
	qemucaps2xmlmock.c
623 624
libqemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
625

P
Peter Krempa 已提交
626 627 628 629 630
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
631
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
P
Peter Krempa 已提交
632

633 634 635 636 637
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
638 639 640 641 642
qemuhotplugtest_LDADD = \
	libqemutestdriver.la \
	libqemumonitortestutils.la \
	$(qemu_LDADDS) \
	$(NULL)
643

644
qemublocktest_SOURCES = \
645 646
	qemublocktest.c \
	testutils.h testutils.c \
647
	testutilsqemu.h testutilsqemu.c \
648 649
	$(NULL)
qemublocktest_LDADD = \
650
	libqemumonitortestutils.la \
651
	../src/libvirt.la \
652 653 654
	$(qemu_LDADDS) \
	$(NULL)

655 656 657 658 659
qemudomaincheckpointxml2xmltest_SOURCES = \
	qemudomaincheckpointxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemudomaincheckpointxml2xmltest_LDADD = $(qemu_LDADDS)

660 661
qemudomainsnapshotxml2xmltest_SOURCES = \
	qemudomainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
662
	testutils.c testutils.h
663
qemudomainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
664 665 666 667 668

qemumemlocktest_SOURCES = \
	qemumemlocktest.c \
	testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
669
qemumemlocktest_LDADD = $(qemu_LDADDS)
670 671 672 673 674 675 676

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

679 680 681 682 683
qemusecuritytest_SOURCES = \
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
	testutils.h testutils.c \
	testutilsqemu.h testutilsqemu.c
684
qemusecuritytest_LDADD = $(qemu_LDADDS)
685

686 687 688
qemufirmwaretest_SOURCES = \
	qemufirmwaretest.c \
	testutils.h testutils.c \
689
	virfilewrapper.c virfilewrapper.h \
690
	$(NULL)
691
qemufirmwaretest_LDADD = $(qemu_LDADDS)
692

693 694 695 696 697 698 699
qemuvhostusertest_SOURCES = \
	qemuvhostusertest.c \
	testutils.h testutils.c \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
qemuvhostusertest_LDADD = $(qemu_LDADDS)

700
else ! WITH_QEMU
P
Peter Krempa 已提交
701
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c \
702
	qemudomaincheckpointxml2xmltest.c qemudomainsnapshotxml2xmltest.c \
P
Peter Krempa 已提交
703
	testutilsqemu.c testutilsqemu.h \
704
	testutilsqemuschema.c testutilsqemuschema.h \
705
	qemumonitorjsontest.c qemuhotplugtest.c \
706
	qemuagenttest.c qemucapabilitiestest.c \
707
	qemucaps2xmltest.c qemucommandutiltest.c \
708
	qemumemlocktest.c qemucpumock.c testutilshostcpus.h \
709
	qemublocktest.c \
710
	qemumigparamstest.c \
711 712
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
713
	qemufirmwaretest.c \
714
	qemuvhostusertest.c \
715
	qemuhotplugmock.c \
716
	$(QEMUMONITORTESTUTILS_SOURCES)
717
endif ! WITH_QEMU
718

719 720
if WITH_LXC

721 722 723 724
lxc_LDADDS = \
	../src/libvirt_driver_lxc_impl.la \
	$(LDADDS) \
	$(NULL)
725 726 727 728

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
729
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
730 731

lxcconf2xmltest_SOURCES = \
732
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
733 734
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
735
else ! WITH_LXC
736
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
737
endif ! WITH_LXC
738

739 740 741 742
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
743 744
openvzutilstest_LDADD = $(LDADDS) \
	../src/libvirt_driver_openvz.la
745
else ! WITH_OPENVZ
746
EXTRA_DIST += openvzutilstest.c
747
endif ! WITH_OPENVZ
748 749
EXTRA_DIST += openvzutilstest.conf

750 751 752 753
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
754
esxutilstest_LDADD = $(LDADDS)
755 756 757
esxutilstest_CFLAGS = \
	-I$(top_builddir)/src/esx \
	$(AM_CFLAGS)
758
else ! WITH_ESX
759
EXTRA_DIST += esxutilstest.c
760
endif ! WITH_ESX
761

Y
Yohan BELLEGUIC 已提交
762 763 764 765 766 767 768 769 770 771
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

772
if WITH_VMX
773 774 775
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
776
vmx2xmltest_LDADD = $(LDADDS)
777 778 779 780

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
781
xml2vmxtest_LDADD = $(LDADDS)
782
else ! WITH_VMX
783
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
784
endif ! WITH_VMX
785

786 787 788 789 790 791 792 793 794
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 已提交
795
if WITH_BHYVE
796
libbhyvexml2argvmock_la_SOURCES = \
R
Roman Bogorodskiy 已提交
797
	bhyvexml2argvmock.c
798 799
libbhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libbhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
800

801
libbhyveargv2xmlmock_la_SOURCES = \
802
	bhyveargv2xmlmock.c
803 804
libbhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libbhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
805

806 807 808 809
bhyve_LDADDS = \
	../src/libvirt_driver_bhyve_impl.la \
	$(LDADDS) \
	$(NULL)
R
Roman Bogorodskiy 已提交
810 811 812 813
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
814 815 816 817 818

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
819 820 821 822 823

bhyveargv2xmltest_SOURCES = \
	bhyveargv2xmltest.c \
	testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
824
else ! WITH_BHYVE
825 826 827 828 829 830
EXTRA_DIST += \
	bhyvexml2argvtest.c \
	bhyveargv2xmltest.c \
	bhyvexml2xmltest.c \
	bhyvexml2argvmock.c \
	bhyveargv2xmlmock.c
R
Roman Bogorodskiy 已提交
831 832
endif ! WITH_BHYVE

J
Ján Tomko 已提交
833 834 835 836 837
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

838 839 840 841 842
virnetworkportxml2xmltest_SOURCES = \
	virnetworkportxml2xmltest.c \
	testutils.c testutils.h
virnetworkportxml2xmltest_LDADD = $(LDADDS)

843
if WITH_NETWORK
844 845 846 847 848
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)

849 850
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
851
	testutils.c testutils.h
852
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
853 854 855 856 857 858

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

859
else ! WITH_NETWORK
860
EXTRA_DIST += networkxml2xmltest.c networkxml2conftest.c
861
endif !	WITH_NETWORK
862

863 864 865 866
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
867
storagebackendsheepdogtest_LDADD = \
868
	../src/libvirt_storage_backend_sheepdog_priv.la \
869
	../src/libvirt_driver_storage_impl.la \
870
	$(LDADDS)
871
else ! WITH_STORAGE_SHEEPDOG
872
EXTRA_DIST += storagebackendsheepdogtest.c
873
endif ! WITH_STORAGE_SHEEPDOG
874

875 876 877 878
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
879

880 881 882 883 884
virnwfilterbindingxml2xmltest_SOURCES = \
	virnwfilterbindingxml2xmltest.c \
	testutils.c testutils.h
virnwfilterbindingxml2xmltest_LDADD = $(LDADDS)

885 886 887 888 889
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
890 891 892 893 894 895

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

J
Ján Tomko 已提交
898 899 900 901 902
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
903 904 905 906 907
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
908

909
if WITH_STORAGE
910 911 912 913 914 915 916 917 918 919
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

920 921 922 923
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
924
	$(LIBXML_LIBS) \
925
	../src/libvirt_driver_storage_impl.la \
926
	../src/libvirt.la \
927
	$(LDADDS)
J
Ján Tomko 已提交
928

929 930 931 932 933 934
storagepoolxml2argvtest_SOURCES = \
    storagepoolxml2argvtest.c \
    testutils.c testutils.h
storagepoolxml2argvtest_LDADD = \
	$(LIBXML_LIBS) \
	../src/libvirt_driver_storage_impl.la \
935
	../src/libvirt.la \
936 937
	$(LDADDS)

938 939 940 941
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS) \
942
	../src/libvirt_driver_storage_impl.la
943

944 945 946 947
storagepoolcapstest_SOURCES = \
        storagepoolcapstest.c testutils.h testutils.c
storagepoolcapstest_LDADD = $(LDADDS)

948
else ! WITH_STORAGE
949
EXTRA_DIST += storagevolxml2argvtest.c
950
EXTRA_DIST += virstorageutiltest.c
951
EXTRA_DIST += storagepoolxml2argvtest.c
952
EXTRA_DIST += storagepoolxml2xmltest.c
953
EXTRA_DIST += storagepoolcapstest.c
954
endif ! WITH_STORAGE
955

956 957 958 959 960
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
961 962 963
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
964
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
965

966 967 968 969 970
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

971 972 973
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
A
Andrea Bolognani 已提交
974
cputest_LDADD = $(LIBXML_LIBS)
J
Jiri Denemark 已提交
975 976
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
977
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS)
A
Andrea Bolognani 已提交
978 979 980
else ! WITH_QEMU
cputest_LDADD += $(LDADDS)
endif ! WITH_QEMU
981

P
Peter Krempa 已提交
982 983 984 985 986
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

987 988 989 990 991
virerrortest_SOURCES = \
	virerrortest.c \
	testutils.c testutils.h
virerrortest_LDADD = $(LDADDS)

S
Simon Kobyda 已提交
992 993 994 995 996 997 998
vshtabletest_SOURCES = \
	vshtabletest.c \
	testutils.c testutils.h
vshtabletest_LDADD = \
	$(LDADDS) \
	../tools/libvirt_shell.la

999 1000 1001 1002 1003
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

1004
virconftest_SOURCES = \
1005
	virconftest.c testutils.h testutils.c
1006
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
1007

1008
virhostcputest_SOURCES = \
1009
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1010
virhostcputest_LDADD = $(LDADDS)
1011

1012 1013 1014 1015
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

1016
# Must not link to any libvirt modules - libc only
1017 1018 1019
# otherwise external libraries might unexpectedly leak
# file descriptors into commandhelper invalidating the
# test logic assumptions
1020 1021
commandhelper_SOURCES = \
	commandhelper.c
1022
commandhelper_LDADD = \
1023
	$(NO_INDIRECT_LDFLAGS)
1024

1025
commandhelper_LDFLAGS = -static
1026

1027

1028 1029 1030 1031
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

1032
vircapstest_SOURCES = \
1033 1034 1035 1036 1037 1038 1039
	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
1040
vircapstest_LDADD =
1041
if WITH_QEMU
1042 1043 1044 1045 1046 1047 1048 1049 1050
vircapstest_LDADD += ../src/libvirt_driver_qemu_impl.la
if WITH_DTRACE_PROBES
vircapstest_LDADD += ../src/libvirt_qemu_probes.lo
endif WITH_DTRACE_PROBES
endif WITH_QEMU
if WITH_LXC
vircapstest_LDADD += ../src/libvirt_driver_lxc_impl.la
endif WITH_LXC
vircapstest_LDADD += $(LDADDS)
1051

1052 1053 1054
libdomaincapsmock_la_SOURCES = domaincapsmock.c
libdomaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libdomaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)
1055

M
Michal Privoznik 已提交
1056
domaincapstest_SOURCES = \
1057 1058 1059
	domaincapstest.c testutils.h testutils.c \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
M
Michal Privoznik 已提交
1060 1061
domaincapstest_LDADD = $(LDADDS)

1062 1063
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
1064
domaincapstest_LDADD += libqemutestdriver.la
1065 1066
endif WITH_QEMU

1067 1068
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
1069
domaincapstest_LDADD += libxltestdriver.la
1070 1071
endif WITH_LIBXL

1072
if WITH_BHYVE
1073
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la
1074 1075
endif WITH_BHYVE

1076 1077
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1078
virnetmessagetest_LDADD = $(LDADDS)
1079

1080 1081
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1082
virnetsockettest_LDADD = $(LDADDS)
1083

1084 1085
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1086
	testutils.h testutils.c
1087
virnetdaemontest_LDADD = $(LDADDS)
1088

1089
libvirnetdaemonmock_la_SOURCES = \
1090
	virnetdaemonmock.c
1091 1092
libvirnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)
1093

1094 1095 1096 1097 1098
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

1099
libvirnetserverclientmock_la_SOURCES = \
1100
	virnetserverclientmock.c
1101 1102
libvirnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1103

1104
virnettlscontexttest_SOURCES = \
1105 1106 1107
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1108
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
1109 1110 1111 1112
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1113
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
1114 1115 1116
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
1117 1118
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
1119
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
1120
EXTRA_DIST += pkix_asn1_tab.c
1121
endif ! HAVE_LIBTASN1
1122

1123 1124
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1125
virtimetest_LDADD = $(LDADDS)
1126

J
Ján Tomko 已提交
1127 1128
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1129
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1130

1131 1132 1133 1134
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1135 1136
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1137 1138 1139 1140
virstoragetest_LDADD = $(LDADDS) \
	../src/libvirt.la \
	../src/libvirt_driver_storage_impl.la \
	$(NULL)
1141

1142 1143 1144
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1145
if WITH_SELINUX
1146
viridentitytest_LDADD += $(SELINUX_LIBS)
1147 1148 1149
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1150

J
Ján Tomko 已提交
1151 1152 1153 1154
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1155 1156 1157 1158
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1159 1160 1161 1162
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1163 1164 1165 1166
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1167 1168 1169 1170
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1171
libvirportallocatormock_la_SOURCES = \
1172
	virportallocatormock.c
1173 1174
libvirportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1175

1176 1177 1178 1179
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

1180
libvircgroupmock_la_SOURCES = \
1181
	vircgroupmock.c
1182 1183
libvircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1184

1185 1186 1187 1188
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1189 1190 1191 1192
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1193 1194 1195 1196
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

1197
libvirpcimock_la_SOURCES = \
M
Michal Privoznik 已提交
1198
	virpcimock.c
1199 1200
libvirpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1201

1202
libvirrandommock_la_SOURCES = \
J
John Ferlan 已提交
1203
	virrandommock.c
1204 1205
libvirrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirrandommock_la_LIBADD = $(MOCKLIBS_LIBS)
J
John Ferlan 已提交
1206

1207 1208 1209 1210 1211 1212
libvirprocessmock_la_SOURCES = \
	virprocessmock.c
libvirprocessmock_la_CFLAGS = $(AM_CFLAGS)
libvirprocessmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirprocessmock_la_LIBADD = $(MOCKLIBS_LIBS)

1213
libvirhostcpumock_la_SOURCES = \
1214
	virhostcpumock.c
1215 1216
libvirhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1217

1218
libvirfilecachemock_la_SOURCES = \
P
Pavel Hrdina 已提交
1219
	virfilecachemock.c
1220 1221
libvirfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
1222

1223 1224
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1225
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1226 1227
vircaps2xmltest_LDADD = $(LDADDS)

1228
libvirnumamock_la_SOURCES = \
M
Martin Kletzander 已提交
1229
	virnumamock.c
1230 1231
libvirnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1232

M
Martin Kletzander 已提交
1233 1234 1235 1236
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

1237
libvirfilemock_la_SOURCES = \
1238
	virfilemock.c
1239 1240
libvirfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilemock_la_LIBADD = $(MOCKLIBS_LIBS)
1241
else ! WITH_LINUX
M
Martin Kletzander 已提交
1242
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \
1243
			  virfilewrapper.h virresctrltest.c virfilemock.c
1244
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1245

1246
if WITH_NSS
M
Michal Privoznik 已提交
1247 1248 1249
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
1250
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1251 1252
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
1253
	$(LDADDS) \
M
Michal Privoznik 已提交
1254 1255
	../tools/nss/libnss_libvirt_impl.la

1256 1257 1258
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
1259 1260
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1261 1262
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
1263
	$(LDADDS) \
1264 1265
	../tools/nss/libnss_libvirt_guest_impl.la

1266
libnssmock_la_SOURCES = \
M
Michal Privoznik 已提交
1267
	nssmock.c
1268 1269
libnssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libnssmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1270

M
Michal Privoznik 已提交
1271 1272 1273
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
1274 1275
nsslinktest_CFLAGS = \
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1276 1277 1278 1279
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

1280
nssguestlinktest_SOURCES = nsslinktest.c
1281 1282 1283
nssguestlinktest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1284 1285 1286
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1287 1288 1289
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1290

1291
libvirdeterministichashmock_la_SOURCES = \
1292
	virdeterministichashmock.c
1293 1294
libvirdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)
1295

1296
test_libraries += libvirdeterministichashmock.la
1297

1298
if WITH_YAJL
1299 1300 1301 1302
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

1303 1304 1305 1306 1307 1308 1309
virnetdevopenvswitchtest_SOURCES = \
	virnetdevopenvswitchtest.c testutils.h testutils.c
virnetdevopenvswitchtest_LDADD = $(LDADDS)

test_programs += \
	virmacmaptest \
	virnetdevopenvswitchtest
1310
else ! WITH_YAJL
1311 1312 1313
EXTRA_DIST += \
	virmacmaptest.c \
	virnetdevopenvswitchtest.c
1314
endif ! WITH_YAJL
1315

M
Michal Privoznik 已提交
1316 1317 1318 1319 1320
virnetdevtest_SOURCES = \
	virnetdevtest.c testutils.h testutils.c
virnetdevtest_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
virnetdevtest_LDADD = $(LDADDS)

1321
libvirnetdevmock_la_SOURCES = \
M
Michal Privoznik 已提交
1322
	virnetdevmock.c
1323 1324 1325
libvirnetdevmock_la_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
libvirnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1326

1327 1328 1329 1330
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

1331 1332 1333 1334 1335
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1336 1337 1338 1339
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1340 1341 1342
libvirusbmock_la_SOURCES = virusbmock.c
libvirusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1343
	$(PROBES_O) \
1344
	../src/libvirt_util.la
1345

1346
libvirnetdevbandwidthmock_la_SOURCES = \
1347
	virnetdevbandwidthmock.c
1348 1349
libvirnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1350

1351
libvirtestmock_la_SOURCES = \
1352
	virtestmock.c
1353 1354
libvirtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirtestmock_la_LIBADD = \
1355
	$(MOCKLIBS_LIBS) \
1356
	$(PROBES_O) \
1357
	../src/libvirt_util.la
1358
else ! WITH_LINUX
1359
	EXTRA_DIST += virusbtest.c virusbmock.c \
1360 1361
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1362 1363
endif ! WITH_LINUX

1364 1365 1366 1367
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1368
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1369

1370
libvirdbusmock_la_SOURCES = \
1371
	virdbusmock.c
1372 1373 1374
libvirdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
libvirdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1375

1376 1377 1378 1379 1380
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1381 1382
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1383
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1384
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1385

1386
else ! WITH_DBUS
1387
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1388
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1389

1390 1391
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1392
viruritest_LDADD = $(LDADDS)
1393

1394 1395
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1396
virkeyfiletest_LDADD = $(LDADDS)
1397

1398 1399 1400 1401
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1402 1403
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1404
virauthconfigtest_LDADD = $(LDADDS)
1405

1406
seclabeltest_SOURCES = \
1407
	seclabeltest.c testutils.h testutils.c
1408
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1409

1410
if WITH_SECDRIVER_SELINUX
1411
if WITH_ATTR
1412 1413
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1414
else ! WITH_TESTS
1415
check_LTLIBRARIES += libsecurityselinuxhelper.la
1416
endif ! WITH_TESTS
1417 1418 1419

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1420
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1421 1422 1423

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1424
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1425 1426
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1427 1428 1429 1430 1431

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1432
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
1433 1434
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1435 1436 1437
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1438 1439
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1440

1441 1442 1443 1444
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1445 1446 1447
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1448

H
Hu Tao 已提交
1449 1450 1451 1452
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1453 1454 1455 1456
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1457 1458 1459 1460
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1461 1462 1463 1464
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1465 1466
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1467
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1468 1469
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1470 1471 1472
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1473

M
Matthias Bolte 已提交
1474 1475 1476 1477
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1478
if WITH_LIBVIRTD
1479 1480 1481
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1482 1483 1484 1485

virdriverconnvalidatetest_SOURCES = \
	virdriverconnvalidatetest.c testutils.h testutils.c
virdriverconnvalidatetest_LDADD = $(LDADDS)
1486
endif WITH_LIBVIRTD
1487

1488 1489
if WITH_LIBVIRTD
eventtest_SOURCES = \
1490
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1491
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1492
endif WITH_LIBVIRTD
1493

1494 1495
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1496
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1497 1498 1499

shunloadtest_SOURCES = \
	shunloadtest.c
1500
shunloadtest_LDADD = $(THREAD_LIBS) $(DLOPEN_LIBS)
1501 1502
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1503 1504 1505 1506
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1507 1508 1509 1510
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1511 1512 1513 1514
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1515 1516 1517 1518 1519
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1520 1521 1522 1523 1524
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1525
if WITH_LINUX
O
Osier Yang 已提交
1526 1527 1528 1529
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1530 1531 1532 1533
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1534 1535
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1536
EXTRA_DIST += scsihosttest.c
1537 1538
endif  ! WITH_LINUX

O
Osier Yang 已提交
1539 1540 1541 1542 1543 1544 1545 1546 1547
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1548
CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda