Makefile.am 38.9 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 \
J
Ján Tomko 已提交
25
	-I$(top_srcdir)/src/hypervisor \
26
	-I$(top_builddir)/src/rpc \
27
	$(NULL)
E
Eric Blake 已提交
28

29 30
WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)

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

48 49 50
AM_LDFLAGS = \
	-export-dynamic

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

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

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

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

75
MOCKLIBS_LIBS = \
76
	../src/libvirt.la
77

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

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

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

E
Eric Blake 已提交
227 228 229 230
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
231
	virnetdaemontest \
E
Eric Blake 已提交
232
	virnetserverclienttest \
233 234
	virnettlscontexttest \
	virnettlssessiontest \
E
Eric Blake 已提交
235 236 237
	$(NULL)
endif WITH_REMOTE

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

251 252 253 254
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

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

265
if WITH_SECDRIVER_SELINUX
266
if WITH_ATTR
267 268
test_programs += securityselinuxtest \
                 viridentitytest
269
if WITH_QEMU
270
test_programs += securityselinuxlabeltest
271 272 273
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
274

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

279
if WITH_LIBXL
P
Peter Krempa 已提交
280
test_programs += xlconfigtest \
281
	xmconfigtest libxlxml2domconfigtest
282
test_libraries += libxltestdriver.la libxlmock.la
283 284
endif WITH_LIBXL

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

308
if WITH_LXC
309
test_programs += lxcxml2xmltest lxcconf2xmltest
310
endif WITH_LXC
311

312
if WITH_OPENVZ
313
test_programs += openvzutilstest
314
endif WITH_OPENVZ
315

316
if WITH_ESX
317
test_programs += esxutilstest
318
endif WITH_ESX
319

Y
Yohan BELLEGUIC 已提交
320 321 322 323
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

324
if WITH_VMX
325
test_programs += vmx2xmltest xml2vmxtest
326
endif WITH_VMX
327

328 329 330 331
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
332
if WITH_BHYVE
333
test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest
334
test_libraries += libbhyvexml2argvmock.la libbhyveargv2xmlmock.la
R
Roman Bogorodskiy 已提交
335 336
endif WITH_BHYVE

337
if WITH_YAJL
338
test_programs += virjsontest
339
endif WITH_YAJL
340

341 342
test_programs += \
		networkxml2xmlupdatetest \
343
		virnetworkportxml2xmltest \
344
		$(NULL)
345

346
if WITH_NETWORK
347
test_programs += \
348
		networkxml2xmltest \
349 350 351
		networkxml2conftest \
		networkxml2firewalltest \
		$(NULL)
352
endif WITH_NETWORK
353

354 355
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
356
endif WITH_STORAGE_SHEEPDOG
357

358
test_programs += nwfilterxml2xmltest
359
test_programs += virnwfilterbindingxml2xmltest
360

361 362
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
363
test_programs += nwfilterxml2firewalltest
364 365
endif WITH_NWFILTER

366
if WITH_STORAGE
367
test_programs += storagevolxml2argvtest
368
test_programs += storagepoolxml2argvtest
369
test_programs += virstorageutiltest
370
test_programs += storagepoolxml2xmltest
371
test_programs += storagepoolcapstest
372
endif WITH_STORAGE
373

374 375
if WITH_STORAGE_FS
test_programs += virstoragetest
376
endif WITH_STORAGE_FS
377

O
Osier Yang 已提交
378 379 380 381
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

382
if WITH_NSS
383 384
test_helpers += nsslinktest nssguestlinktest
test_programs += nsstest nssguesttest
385
test_libraries += libnssmock.la
386 387
endif WITH_NSS

388
test_programs += storagevolxml2xmltest
389

390
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
391

392 393 394 395
if WITH_NODE_DEVICES
test_programs += nodedevmdevctltest
endif WITH_NODE_DEVICES

396
test_programs += interfacexml2xmltest
397

398
test_programs += cputest
399

P
Peter Krempa 已提交
400 401
test_programs += metadatatest

J
Ján Tomko 已提交
402 403
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
404 405
test_programs += genericxml2xmltest

406
if WITH_LINUX
407 408 409
test_programs += virusbtest \
	virnetdevbandwidthtest \
	$(NULL)
410 411
endif WITH_LINUX

J
Ján Tomko 已提交
412
test_scripts =
413 414 415
libvirtd_test_scripts = \
	libvirtd-fail \
	libvirtd-pool \
416
	virsh-auth \
417 418 419 420 421 422 423 424 425
	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 已提交
426
	virsh-checkpoint \
427
	virsh-snapshot \
428 429 430 431
	virsh-start \
	virsh-undefine \
	virsh-uriprecedence \
	virsh-vcpupin \
432
	$(NULL)
433

434 435 436
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

437
test_programs += \
438
	eventtest \
439 440
	virdrivermoduletest \
	virdriverconnvalidatetest
441
else ! WITH_LIBVIRTD
442
EXTRA_DIST += $(libvirtd_test_scripts)
443
endif ! WITH_LIBVIRTD
444

445 446
test_programs += objecteventtest

J
Jamie Strandboge 已提交
447
if WITH_SECDRIVER_APPARMOR
448
if WITH_LIBVIRTD
J
Jamie Strandboge 已提交
449
test_scripts += virt-aa-helper-test
450 451
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
452 453
EXTRA_DIST += virt-aa-helper-test

454 455
EXTRA_DIST += $(test_scripts)

456 457 458
if WITH_LINUX
check-access: file-access-clean
	VIR_TEST_FILE_ACCESS=1 $(MAKE) $(AM_MAKEFLAGS) check
459
	$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-file-access.py \
460
		$(abs_builddir)/test_file_access.txt \
461
		$(abs_srcdir)/permitted_file_access.txt | sort -u
462 463 464 465 466 467

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

EXTRA_DIST += \
468
	permitted_file_access.txt
469

470 471
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
472
noinst_LTLIBRARIES = $(test_libraries)
473
else ! WITH_TESTS
474
check_PROGRAMS = $(test_programs) $(test_helpers)
475
check_LTLIBRARIES = $(test_libraries)
476
endif ! WITH_TESTS
477

478 479
TESTS = $(test_programs) \
	$(test_scripts)
480

481
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
482
TESTS_ENVIRONMENT = \
483 484 485 486
  abs_top_builddir="$(abs_top_builddir)" \
  abs_top_srcdir="$(abs_top_srcdir)" \
  abs_builddir="$(abs_builddir)" \
  abs_srcdir="$(abs_srcdir)" \
487 488 489
  LIBVIRT_AUTOSTART=0 \
  LC_ALL=C \
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \
490 491
  $(VG)

492

493
VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \
494
	--trace-children-skip="*/tools/virsh","*/tests/commandhelper","/usr/bin/*" \
495
	--suppressions=$(abs_srcdir)/.valgrind.supp
496
valgrind:
497
	$(MAKE) check VG="$(LIBTOOL) --mode=execute $(VALGRIND)"
498

499 500 501
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
502
sockettest_LDADD = $(LDADDS)
503

504
if WITH_LIBXL
505 506 507 508
libxl_LDADDS = \
	../src/libvirt_driver_libxl_impl.la \
	$(LDADDS) \
	$(NULL)
509

510 511 512 513
libxltestdriver_la_SOURCES =
libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
libxltestdriver_la_LIBADD = $(libxl_LDADDS)

514 515 516
xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
517 518
xlconfigtest_LDADD = libxltestdriver.la \
	$(libxl_LDADDS)
519

520 521 522
xmconfigtest_SOURCES = \
	xmconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
523 524
xmconfigtest_LDADD = libxltestdriver.la \
	$(libxl_LDADDS)
525

526 527 528
libxlxml2domconfigtest_SOURCES = \
	libxlxml2domconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
529 530
libxlxml2domconfigtest_LDADD = libxltestdriver.la \
	$(libxl_LDADDS) $(LIBXML_LIBS)
531

532 533
libxlmock_la_SOURCES = \
	libxlmock.c
D
Daniel P. Berrangé 已提交
534
libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS) $(GLIB_CFLAGS)
535 536
libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libxlmock_la_LIBADD = $(MOCKLIBS_LIBS)
537

538
else ! WITH_LIBXL
P
Peter Krempa 已提交
539
EXTRA_DIST += xlconfigtest.c \
540
	xmconfigtest.c libxlxml2domconfigtest.c
541 542
endif ! WITH_LIBXL

543 544 545
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
546
	testutilsqemuschema.h testutilsqemuschema.c \
547 548
	$(NULL)

549
if WITH_QEMU
550

551 552
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

553
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
554
if WITH_DTRACE_PROBES
555
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
556
endif WITH_DTRACE_PROBES
557
qemu_LDADDS += $(LDADDS)
558

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

563
libqemucpumock_la_SOURCES = \
564
	qemucpumock.c testutilshostcpus.h
565 566
libqemucpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemucpumock_la_LIBADD = $(MOCKLIBS_LIBS)
567

568 569 570 571 572
libqemuhotplugmock_la_SOURCES = \
	qemuhotplugmock.c
libqemuhotplugmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemuhotplugmock_la_LIBADD = $(MOCKLIBS_LIBS)

573
qemuxml2argvtest_SOURCES = \
574
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
575 576 577
	testutils.c testutils.h \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
578
qemuxml2argvtest_LDADD = libqemutestdriver.la libqemumonitortestutils.la \
579
	$(LDADDS) $(LIBXML_LIBS)
580

581
libqemuxml2argvmock_la_SOURCES = \
582
	qemuxml2argvmock.c
583 584
libqemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
585

586
qemuxml2xmltest_SOURCES = \
587
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
588 589
	testutils.c testutils.h \
	virfilewrapper.c virfilewrapper.h
590
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
591

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

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

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

613
libqemucapsprobemock_la_SOURCES = \
J
Jiri Denemark 已提交
614
	qemucapsprobemock.c
615 616
libqemucapsprobemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemucapsprobemock_la_LIBADD = $(MOCKLIBS_LIBS)
J
Jiri Denemark 已提交
617

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

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

633
libqemucaps2xmlmock_la_SOURCES = \
P
Pavel Hrdina 已提交
634
	qemucaps2xmlmock.c
635 636
libqemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
637

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

645 646 647 648 649
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
650 651 652 653 654
qemuhotplugtest_LDADD = \
	libqemutestdriver.la \
	libqemumonitortestutils.la \
	$(qemu_LDADDS) \
	$(NULL)
655

656
qemublocktest_SOURCES = \
657 658
	qemublocktest.c \
	testutils.h testutils.c \
659
	testutilsqemu.h testutilsqemu.c \
660 661
	$(NULL)
qemublocktest_LDADD = \
662
	libqemumonitortestutils.la \
663
	../src/libvirt.la \
664 665 666
	$(qemu_LDADDS) \
	$(NULL)

667 668 669 670 671
qemudomaincheckpointxml2xmltest_SOURCES = \
	qemudomaincheckpointxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemudomaincheckpointxml2xmltest_LDADD = $(qemu_LDADDS)

672 673
qemudomainsnapshotxml2xmltest_SOURCES = \
	qemudomainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
674
	testutils.c testutils.h
675
qemudomainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
676 677 678 679 680

qemumemlocktest_SOURCES = \
	qemumemlocktest.c \
	testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
681
qemumemlocktest_LDADD = $(qemu_LDADDS)
682 683 684 685 686 687 688

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

691 692 693 694 695
qemusecuritytest_SOURCES = \
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
	testutils.h testutils.c \
	testutilsqemu.h testutilsqemu.c
696
qemusecuritytest_LDADD = $(qemu_LDADDS)
697

698 699 700
qemufirmwaretest_SOURCES = \
	qemufirmwaretest.c \
	testutils.h testutils.c \
701
	virfilewrapper.c virfilewrapper.h \
702
	$(NULL)
703
qemufirmwaretest_LDADD = $(qemu_LDADDS)
704

705 706 707 708 709 710 711
qemuvhostusertest_SOURCES = \
	qemuvhostusertest.c \
	testutils.h testutils.c \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
qemuvhostusertest_LDADD = $(qemu_LDADDS)

712
else ! WITH_QEMU
P
Peter Krempa 已提交
713
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c \
714
	qemudomaincheckpointxml2xmltest.c qemudomainsnapshotxml2xmltest.c \
P
Peter Krempa 已提交
715
	testutilsqemu.c testutilsqemu.h \
716
	testutilsqemuschema.c testutilsqemuschema.h \
717
	qemumonitorjsontest.c qemuhotplugtest.c \
718
	qemuagenttest.c qemucapabilitiestest.c \
719
	qemucaps2xmltest.c qemucommandutiltest.c \
720
	qemumemlocktest.c qemucpumock.c testutilshostcpus.h \
721
	qemublocktest.c \
722
	qemumigparamstest.c \
723 724
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
725
	qemufirmwaretest.c \
726
	qemuvhostusertest.c \
727
	qemuhotplugmock.c \
728
	$(QEMUMONITORTESTUTILS_SOURCES)
729
endif ! WITH_QEMU
730

731 732
if WITH_LXC

733 734 735 736
lxc_LDADDS = \
	../src/libvirt_driver_lxc_impl.la \
	$(LDADDS) \
	$(NULL)
737 738 739 740

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
741
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
742 743

lxcconf2xmltest_SOURCES = \
744
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
745 746
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
747
else ! WITH_LXC
748
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
749
endif ! WITH_LXC
750

751 752 753 754
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
755 756
openvzutilstest_LDADD = $(LDADDS) \
	../src/libvirt_driver_openvz.la
757
else ! WITH_OPENVZ
758
EXTRA_DIST += openvzutilstest.c
759
endif ! WITH_OPENVZ
760 761
EXTRA_DIST += openvzutilstest.conf

762 763 764 765
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
766
esxutilstest_LDADD = $(LDADDS)
767 768 769
esxutilstest_CFLAGS = \
	-I$(top_builddir)/src/esx \
	$(AM_CFLAGS)
770
else ! WITH_ESX
771
EXTRA_DIST += esxutilstest.c
772
endif ! WITH_ESX
773

Y
Yohan BELLEGUIC 已提交
774 775 776 777 778 779 780 781 782 783
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

784
if WITH_VMX
785 786 787
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
788
vmx2xmltest_LDADD = $(LDADDS)
789 790 791 792

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
793
xml2vmxtest_LDADD = $(LDADDS)
794
else ! WITH_VMX
795
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
796
endif ! WITH_VMX
797

798 799 800 801 802 803 804 805 806
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 已提交
807
if WITH_BHYVE
808
libbhyvexml2argvmock_la_SOURCES = \
R
Roman Bogorodskiy 已提交
809
	bhyvexml2argvmock.c
810 811
libbhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libbhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
812

813
libbhyveargv2xmlmock_la_SOURCES = \
814
	bhyveargv2xmlmock.c
815 816
libbhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libbhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
817

818 819 820 821
bhyve_LDADDS = \
	../src/libvirt_driver_bhyve_impl.la \
	$(LDADDS) \
	$(NULL)
R
Roman Bogorodskiy 已提交
822 823 824 825
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
826 827 828 829 830

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
831 832 833 834 835

bhyveargv2xmltest_SOURCES = \
	bhyveargv2xmltest.c \
	testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
836
else ! WITH_BHYVE
837 838 839 840 841 842
EXTRA_DIST += \
	bhyvexml2argvtest.c \
	bhyveargv2xmltest.c \
	bhyvexml2xmltest.c \
	bhyvexml2argvmock.c \
	bhyveargv2xmlmock.c
R
Roman Bogorodskiy 已提交
843 844
endif ! WITH_BHYVE

J
Ján Tomko 已提交
845 846 847 848 849
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

850 851 852 853 854
virnetworkportxml2xmltest_SOURCES = \
	virnetworkportxml2xmltest.c \
	testutils.c testutils.h
virnetworkportxml2xmltest_LDADD = $(LDADDS)

855
if WITH_NETWORK
856 857 858 859 860
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)

861 862
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
863
	testutils.c testutils.h
864
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
865 866 867 868 869 870

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

871
else ! WITH_NETWORK
872
EXTRA_DIST += networkxml2xmltest.c networkxml2conftest.c
873
endif !	WITH_NETWORK
874

875 876 877 878
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
879
storagebackendsheepdogtest_LDADD = \
880
	../src/libvirt_storage_backend_sheepdog_priv.la \
881
	../src/libvirt_driver_storage_impl.la \
882
	$(LDADDS)
883
else ! WITH_STORAGE_SHEEPDOG
884
EXTRA_DIST += storagebackendsheepdogtest.c
885
endif ! WITH_STORAGE_SHEEPDOG
886

887 888 889 890
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
891

892 893 894 895 896
virnwfilterbindingxml2xmltest_SOURCES = \
	virnwfilterbindingxml2xmltest.c \
	testutils.c testutils.h
virnwfilterbindingxml2xmltest_LDADD = $(LDADDS)

897 898 899 900 901
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
902 903 904 905 906 907

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

J
Ján Tomko 已提交
910 911 912 913 914
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
915 916 917 918 919
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
920

921
if WITH_STORAGE
922 923 924 925 926 927 928 929 930 931
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

932 933 934 935
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
936
	$(LIBXML_LIBS) \
937
	../src/libvirt_driver_storage_impl.la \
938
	../src/libvirt.la \
939
	$(LDADDS)
J
Ján Tomko 已提交
940

941 942 943 944 945 946
storagepoolxml2argvtest_SOURCES = \
    storagepoolxml2argvtest.c \
    testutils.c testutils.h
storagepoolxml2argvtest_LDADD = \
	$(LIBXML_LIBS) \
	../src/libvirt_driver_storage_impl.la \
947
	../src/libvirt.la \
948 949
	$(LDADDS)

950 951 952 953
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS) \
954
	../src/libvirt_driver_storage_impl.la
955

956 957 958 959
storagepoolcapstest_SOURCES = \
        storagepoolcapstest.c testutils.h testutils.c
storagepoolcapstest_LDADD = $(LDADDS)

960
else ! WITH_STORAGE
961
EXTRA_DIST += storagevolxml2argvtest.c
962
EXTRA_DIST += virstorageutiltest.c
963
EXTRA_DIST += storagepoolxml2argvtest.c
964
EXTRA_DIST += storagepoolxml2xmltest.c
965
EXTRA_DIST += storagepoolcapstest.c
966
endif ! WITH_STORAGE
967

968 969 970 971 972
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
973 974 975
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
976
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
977

978 979 980 981 982 983 984 985 986 987
if WITH_NODE_DEVICES
nodedevmdevctltest_SOURCES = \
	nodedevmdevctltest.c \
	testutils.c testutils.h

nodedevmdevctltest_LDADD = \
	../src/libvirt_driver_nodedev_impl.la \
	$(LDADDS)
endif WITH_NODE_DEVICES

988 989 990 991 992
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

993 994 995
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
A
Andrea Bolognani 已提交
996
cputest_LDADD = $(LIBXML_LIBS)
J
Jiri Denemark 已提交
997 998
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
999
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS)
A
Andrea Bolognani 已提交
1000 1001 1002
else ! WITH_QEMU
cputest_LDADD += $(LDADDS)
endif ! WITH_QEMU
1003

P
Peter Krempa 已提交
1004 1005 1006 1007 1008
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1009 1010 1011 1012 1013
virerrortest_SOURCES = \
	virerrortest.c \
	testutils.c testutils.h
virerrortest_LDADD = $(LDADDS)

S
Simon Kobyda 已提交
1014 1015 1016 1017 1018 1019 1020
vshtabletest_SOURCES = \
	vshtabletest.c \
	testutils.c testutils.h
vshtabletest_LDADD = \
	$(LDADDS) \
	../tools/libvirt_shell.la

1021 1022 1023 1024 1025
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

1026
virconftest_SOURCES = \
1027
	virconftest.c testutils.h testutils.c
1028
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
1029

1030
virhostcputest_SOURCES = \
1031
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1032
virhostcputest_LDADD = $(LDADDS)
1033

1034 1035 1036 1037
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

1038
# Must not link to any libvirt modules - libc only
1039 1040 1041
# otherwise external libraries might unexpectedly leak
# file descriptors into commandhelper invalidating the
# test logic assumptions
1042 1043
commandhelper_SOURCES = \
	commandhelper.c
1044
commandhelper_LDADD = \
1045
	$(NO_INDIRECT_LDFLAGS)
1046

1047
commandhelper_LDFLAGS = -static
1048

1049

1050 1051 1052 1053
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

1054
vircapstest_SOURCES = \
1055 1056 1057 1058 1059 1060 1061
	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
1062
vircapstest_LDADD =
1063
if WITH_QEMU
1064 1065 1066 1067 1068 1069 1070 1071 1072
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)
1073

1074 1075 1076
libdomaincapsmock_la_SOURCES = domaincapsmock.c
libdomaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libdomaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)
1077

M
Michal Privoznik 已提交
1078
domaincapstest_SOURCES = \
1079 1080 1081
	domaincapstest.c testutils.h testutils.c \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
M
Michal Privoznik 已提交
1082 1083
domaincapstest_LDADD = $(LDADDS)

1084 1085
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
1086
domaincapstest_LDADD += libqemutestdriver.la
1087 1088
endif WITH_QEMU

1089 1090
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
1091
domaincapstest_LDADD += libxltestdriver.la
1092 1093
endif WITH_LIBXL

1094
if WITH_BHYVE
1095
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la
1096 1097
endif WITH_BHYVE

1098 1099
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1100
virnetmessagetest_LDADD = $(LDADDS)
1101

1102 1103
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1104
virnetsockettest_LDADD = $(LDADDS)
1105

1106 1107
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1108
	testutils.h testutils.c
1109
virnetdaemontest_LDADD = $(LDADDS)
1110

1111
libvirnetdaemonmock_la_SOURCES = \
1112
	virnetdaemonmock.c
1113 1114
libvirnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)
1115

1116 1117 1118 1119 1120
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

1121
libvirnetserverclientmock_la_SOURCES = \
1122
	virnetserverclientmock.c
1123 1124
libvirnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1125

1126
virnettlscontexttest_SOURCES = \
1127 1128 1129
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1130
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
1131 1132 1133 1134
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1135
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
1136 1137 1138
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
1139 1140
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
1141
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
1142
EXTRA_DIST += pkix_asn1_tab.c
1143
endif ! HAVE_LIBTASN1
1144

1145 1146
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1147
virtimetest_LDADD = $(LDADDS)
1148

J
Ján Tomko 已提交
1149 1150
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1151
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1152

1153 1154 1155 1156
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1157 1158
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1159 1160 1161 1162
virstoragetest_LDADD = $(LDADDS) \
	../src/libvirt.la \
	../src/libvirt_driver_storage_impl.la \
	$(NULL)
1163

1164 1165 1166
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1167
if WITH_SELINUX
1168
viridentitytest_LDADD += $(SELINUX_LIBS)
1169 1170 1171
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1172

J
Ján Tomko 已提交
1173 1174 1175 1176
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1177 1178 1179 1180
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1181 1182 1183 1184
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1185 1186 1187 1188
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1189 1190 1191 1192
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1193
libvirportallocatormock_la_SOURCES = \
1194
	virportallocatormock.c
1195 1196
libvirportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1197

1198 1199 1200 1201
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

1202
libvircgroupmock_la_SOURCES = \
1203
	vircgroupmock.c
1204 1205
libvircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1206

1207 1208 1209 1210
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1211 1212 1213 1214
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1215 1216 1217 1218
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

1219
libvirpcimock_la_SOURCES = \
M
Michal Privoznik 已提交
1220
	virpcimock.c
1221 1222
libvirpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1223

1224
libvirrandommock_la_SOURCES = \
J
John Ferlan 已提交
1225
	virrandommock.c
1226 1227
libvirrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirrandommock_la_LIBADD = $(MOCKLIBS_LIBS)
J
John Ferlan 已提交
1228

1229 1230 1231 1232 1233 1234
libvirprocessmock_la_SOURCES = \
	virprocessmock.c
libvirprocessmock_la_CFLAGS = $(AM_CFLAGS)
libvirprocessmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirprocessmock_la_LIBADD = $(MOCKLIBS_LIBS)

1235
libvirhostcpumock_la_SOURCES = \
1236
	virhostcpumock.c
1237 1238
libvirhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1239

1240
libvirfilecachemock_la_SOURCES = \
P
Pavel Hrdina 已提交
1241
	virfilecachemock.c
1242 1243
libvirfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
1244

1245 1246 1247 1248 1249 1250
libvirhostdevmock_la_SOURCES = \
	virhostdevmock.c \
	$(NULL)
libvirhostdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirhostdevmock_la_LIBADD = $(MOCKLIBS_LIBS)

1251 1252
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1253
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1254 1255
vircaps2xmltest_LDADD = $(LDADDS)

1256
libvirnumamock_la_SOURCES = \
M
Martin Kletzander 已提交
1257
	virnumamock.c
1258 1259
libvirnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1260

M
Martin Kletzander 已提交
1261 1262 1263 1264
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

1265
libvirfilemock_la_SOURCES = \
1266
	virfilemock.c
1267 1268
libvirfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilemock_la_LIBADD = $(MOCKLIBS_LIBS)
1269
else ! WITH_LINUX
M
Martin Kletzander 已提交
1270
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \
1271
			  virfilewrapper.h virresctrltest.c virfilemock.c
1272
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1273

1274
if WITH_NSS
M
Michal Privoznik 已提交
1275 1276 1277
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
1278
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1279 1280
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
1281
	$(LDADDS) \
M
Michal Privoznik 已提交
1282 1283
	../tools/nss/libnss_libvirt_impl.la

1284 1285 1286
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
1287 1288
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1289 1290
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
1291
	$(LDADDS) \
1292 1293
	../tools/nss/libnss_libvirt_guest_impl.la

1294
libnssmock_la_SOURCES = \
M
Michal Privoznik 已提交
1295
	nssmock.c
1296 1297
libnssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libnssmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1298

M
Michal Privoznik 已提交
1299 1300 1301
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
1302 1303
nsslinktest_CFLAGS = \
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1304 1305 1306 1307
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

1308
nssguestlinktest_SOURCES = nsslinktest.c
1309 1310 1311
nssguestlinktest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1312 1313 1314
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1315 1316 1317
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1318

1319
libvirdeterministichashmock_la_SOURCES = \
1320
	virdeterministichashmock.c
1321 1322
libvirdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)
1323

1324
test_libraries += libvirdeterministichashmock.la
1325

1326
if WITH_YAJL
1327 1328 1329 1330
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

1331 1332 1333 1334 1335 1336 1337
virnetdevopenvswitchtest_SOURCES = \
	virnetdevopenvswitchtest.c testutils.h testutils.c
virnetdevopenvswitchtest_LDADD = $(LDADDS)

test_programs += \
	virmacmaptest \
	virnetdevopenvswitchtest
1338
else ! WITH_YAJL
1339 1340 1341
EXTRA_DIST += \
	virmacmaptest.c \
	virnetdevopenvswitchtest.c
1342
endif ! WITH_YAJL
1343

M
Michal Privoznik 已提交
1344 1345 1346 1347 1348
virnetdevtest_SOURCES = \
	virnetdevtest.c testutils.h testutils.c
virnetdevtest_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
virnetdevtest_LDADD = $(LDADDS)

1349
libvirnetdevmock_la_SOURCES = \
M
Michal Privoznik 已提交
1350
	virnetdevmock.c
1351 1352 1353
libvirnetdevmock_la_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
libvirnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1354

1355 1356 1357 1358
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

1359 1360 1361 1362 1363
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1364 1365 1366 1367
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1368 1369 1370
libvirusbmock_la_SOURCES = virusbmock.c
libvirusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1371
	$(PROBES_O) \
1372
	../src/libvirt_util.la
1373

1374
libvirnetdevbandwidthmock_la_SOURCES = \
1375
	virnetdevbandwidthmock.c
1376 1377
libvirnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1378

1379
libvirtestmock_la_SOURCES = \
1380
	virtestmock.c
1381 1382
libvirtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirtestmock_la_LIBADD = \
1383
	$(MOCKLIBS_LIBS) \
1384
	$(PROBES_O) \
1385
	../src/libvirt_util.la
1386
else ! WITH_LINUX
1387
	EXTRA_DIST += virusbtest.c virusbmock.c \
1388 1389
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1390 1391
endif ! WITH_LINUX

1392 1393 1394 1395
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1396
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1397

1398
libvirdbusmock_la_SOURCES = \
1399
	virdbusmock.c
1400 1401 1402
libvirdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
libvirdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1403

1404 1405 1406 1407 1408
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1409 1410
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1411
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1412
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1413

1414
else ! WITH_DBUS
1415
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1416
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1417

1418 1419
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1420
viruritest_LDADD = $(LDADDS)
1421

1422 1423 1424 1425
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1426 1427
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1428
virauthconfigtest_LDADD = $(LDADDS)
1429

1430
seclabeltest_SOURCES = \
1431
	seclabeltest.c testutils.h testutils.c
1432
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1433

1434
if WITH_SECDRIVER_SELINUX
1435
if WITH_ATTR
1436 1437
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1438
else ! WITH_TESTS
1439
check_LTLIBRARIES += libsecurityselinuxhelper.la
1440
endif ! WITH_TESTS
1441 1442 1443

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1444
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1445 1446 1447

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1448
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1449 1450
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1451 1452 1453 1454 1455

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1456
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
1457 1458
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1459 1460 1461
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1462 1463
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1464

1465 1466 1467 1468
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1469 1470 1471
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1472

H
Hu Tao 已提交
1473 1474 1475 1476
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1477 1478 1479 1480
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1481 1482 1483 1484
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1485 1486 1487 1488
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1489 1490
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1491
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1492 1493
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1494 1495 1496
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1497

M
Matthias Bolte 已提交
1498 1499 1500 1501
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1502
if WITH_LIBVIRTD
1503 1504 1505
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1506 1507 1508 1509

virdriverconnvalidatetest_SOURCES = \
	virdriverconnvalidatetest.c testutils.h testutils.c
virdriverconnvalidatetest_LDADD = $(LDADDS)
1510
endif WITH_LIBVIRTD
1511

1512 1513
if WITH_LIBVIRTD
eventtest_SOURCES = \
1514
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1515
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1516
endif WITH_LIBVIRTD
1517

1518 1519
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1520
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1521 1522 1523

shunloadtest_SOURCES = \
	shunloadtest.c
1524
shunloadtest_LDADD = $(THREAD_LIBS) $(DLOPEN_LIBS)
1525 1526
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1527 1528 1529 1530
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1531 1532 1533 1534
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1535 1536 1537 1538
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1539 1540 1541 1542 1543
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1544 1545 1546 1547 1548
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1549
if WITH_LINUX
O
Osier Yang 已提交
1550 1551 1552 1553
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1554 1555 1556 1557
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1558 1559
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1560
EXTRA_DIST += scsihosttest.c
1561 1562
endif  ! WITH_LINUX

O
Osier Yang 已提交
1563 1564 1565 1566 1567 1568 1569 1570 1571
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

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