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

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

19 20
SHELL = $(PREFERABLY_POSIX_SHELL)

21
AM_CPPFLAGS = \
22
	-I$(top_builddir) -I$(top_srcdir) \
23 24 25
	-I$(top_builddir)/gnulib/lib -I$(top_srcdir)/gnulib/lib \
	-I$(top_builddir)/include -I$(top_srcdir)/include \
	-I$(top_builddir)/src -I$(top_srcdir)/src \
26
	-I$(top_srcdir)/src/util \
27
	-I$(top_srcdir)/src/conf \
28
	$(NULL)
E
Eric Blake 已提交
29

30 31
WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)

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

68 69 70
GNULIB_LIBS = \
       ../gnulib/lib/libgnu.la

K
Karel Zak 已提交
71
LDADDS = \
72
	$(NO_INDIRECT_LDFLAGS) \
73
	$(PROBES_O) \
74 75
	$(GNULIB_LIBS) \
	../src/libvirt.la
K
Karel Zak 已提交
76

77
MOCKLIBS_LIBS = \
78 79
	$(GNULIB_LIBS) \
	../src/libvirt.la
80

81
EXTRA_DIST = \
82
	.valgrind.supp \
R
Roman Bogorodskiy 已提交
83
	bhyvexml2argvdata \
84
	bhyveargv2xmldata \
85
	bhyvexml2xmloutdata \
86
	capabilityschemadata \
E
Eric Blake 已提交
87 88
	commanddata \
	cputestdata \
M
Michal Privoznik 已提交
89
	domaincapsschemadata \
90
	domainconfdata \
91
	domainschemadata \
O
Osier Yang 已提交
92
	fchostdata \
C
Cole Robinson 已提交
93 94
	genericxml2xmlindata \
	genericxml2xmloutdata \
95
	interfaceschemadata \
96
	libxlxml2domconfigdata \
97
	lxcconf2xmldata \
98
	lxcxml2xmldata \
99
	lxcxml2xmloutdata \
100 101
	networkxml2confdata \
	networkxml2firewalldata \
E
Eric Blake 已提交
102 103
	networkxml2xmlin \
	networkxml2xmlout \
J
Ján Tomko 已提交
104 105
	networkxml2xmlupdatein \
	networkxml2xmlupdateout \
E
Eric Blake 已提交
106
	nodedevschemadata \
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 \
J
Ján Tomko 已提交
130
	secretxml2xmlin \
131
	securityselinuxhelperdata \
132
	securityselinuxlabeldata \
133
	storagepoolcapsschemadata \
134
	storagepoolschemadata \
135
	storagepoolxml2xmlin \
E
Eric Blake 已提交
136
	storagepoolxml2xmlout \
137
	storagepoolxml2argvdata \
138
	storagevolschemadata \
139
	storagevolxml2argvdata \
140
	storagevolxml2xmlin \
E
Eric Blake 已提交
141
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
142
	sysinfodata \
143
	test-lib.sh \
Y
Yohan BELLEGUIC 已提交
144
	vboxsnapshotxmldata \
145
	vircaps2xmldata \
146
	vircgroupdata \
147
	virconfdata \
148
	virfiledata \
149
	virjsondata \
150
	virmacmaptestdata \
151
	virmock.h \
152
	virmockstathelpers.c \
153
	virnetdaemondata \
154
	virnetdevtestdata \
155
	virnetdevopenvswitchdata \
156
	virnetworkportxml2xmldata \
157
	virnwfilterbindingxml2xmldata \
158
	virpcitestdata \
O
Osier Yang 已提交
159
	virscsidata \
160
	virsh-uriprecedence \
161
	virusbtestdata \
162
	vmwareverdata \
163
	vmx2xmldata \
164
	xlconfigdata \
165
	xmconfigdata \
166 167
	xml2vmxdata \
	virstorageutildata \
168
	virfilecachedata \
M
Martin Kletzander 已提交
169
	virresctrldata \
170
	$(NULL)
K
Karel Zak 已提交
171

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

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

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

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

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

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

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

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

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

282
if WITH_QEMU
283
test_programs += qemuxml2argvtest qemuxml2xmltest \
284
	qemudomaincheckpointxml2xmltest qemudomainsnapshotxml2xmltest \
P
Peter Krempa 已提交
285
	qemumonitorjsontest qemuhotplugtest \
286
	qemuagenttest qemucapabilitiestest qemucaps2xmltest \
287
	qemumemlocktest \
288 289
	qemucommandutiltest \
	qemublocktest \
290
	qemumigparamstest \
291
	qemusecuritytest \
292
	qemufirmwaretest \
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_CIL
334
test_programs += objectlocking
335
endif WITH_CIL
336

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
test_programs += interfacexml2xmltest
393

394
test_programs += cputest
395

P
Peter Krempa 已提交
396 397
test_programs += metadatatest

J
Ján Tomko 已提交
398 399
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
400 401
test_programs += genericxml2xmltest

402
if WITH_LINUX
403 404 405
test_programs += virusbtest \
	virnetdevbandwidthtest \
	$(NULL)
406 407
endif WITH_LINUX

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

429 430 431
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

432
test_programs += \
433 434
	eventtest \
	virdrivermoduletest
435
else ! WITH_LIBVIRTD
436
EXTRA_DIST += $(libvirtd_test_scripts)
437
endif ! WITH_LIBVIRTD
438

439 440
test_programs += objecteventtest

J
Jamie Strandboge 已提交
441
if WITH_SECDRIVER_APPARMOR
442
if WITH_LIBVIRTD
J
Jamie Strandboge 已提交
443
test_scripts += virt-aa-helper-test
444 445
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
446 447
EXTRA_DIST += virt-aa-helper-test

448 449
EXTRA_DIST += $(test_scripts)

450 451 452 453 454 455 456 457 458 459 460 461 462
if WITH_LINUX
check-access: file-access-clean
	VIR_TEST_FILE_ACCESS=1 $(MAKE) $(AM_MAKEFLAGS) check
	$(PERL) check-file-access.pl | sort -u

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

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

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

471 472
TESTS = $(test_programs) \
	$(test_scripts)
473

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

486

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

493 494 495
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
496
sockettest_LDADD = $(LDADDS)
497

498 499
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
500 501 502
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
503 504
libxl_LDADDS += $(LDADDS)

505 506 507 508
libxltestdriver_la_SOURCES =
libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
libxltestdriver_la_LIBADD = $(libxl_LDADDS)

509 510 511 512
xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
513

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

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

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

530
else ! WITH_LIBXL
P
Peter Krempa 已提交
531
EXTRA_DIST += xlconfigtest.c \
532
	xmconfigtest.c libxlxml2domconfigtest.c
533 534
endif ! WITH_LIBXL

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

541
if WITH_QEMU
542

543 544
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

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

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

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

574
libqemuxml2argvmock_la_SOURCES = \
575
	qemuxml2argvmock.c
576 577
libqemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
578

579
qemuxml2xmltest_SOURCES = \
580
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
581 582
	testutils.c testutils.h \
	virfilewrapper.c virfilewrapper.h
583
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
584

585 586 587 588 589
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
590
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
591
	$(qemu_LDADDS)
592

593 594 595 596 597
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
598
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
599
	$(qemu_LDADDS)
600

J
Jiri Denemark 已提交
601 602 603 604 605
qemucapsprobe_SOURCES = \
	qemucapsprobe.c
qemucapsprobe_LDADD = \
	libqemutestdriver.la $(LDADDS)

606
libqemucapsprobemock_la_SOURCES = \
J
Jiri Denemark 已提交
607
	qemucapsprobemock.c
608 609
libqemucapsprobemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemucapsprobemock_la_LIBADD = $(MOCKLIBS_LIBS)
J
Jiri Denemark 已提交
610

611 612 613 614 615 616
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
617
	$(qemu_LDADDS)
618

619 620 621
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
622
	testutilsqemu.c testutilsqemu.h \
623
	$(NULL)
624
qemucaps2xmltest_LDADD = $(qemu_LDADDS)
625

626
libqemucaps2xmlmock_la_SOURCES = \
P
Pavel Hrdina 已提交
627
	qemucaps2xmlmock.c
628 629
libqemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
630

P
Peter Krempa 已提交
631 632 633 634 635
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
636
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
P
Peter Krempa 已提交
637

638 639 640 641 642
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
643
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
644

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

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

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

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

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

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

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

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

712 713
if WITH_LXC

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

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

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

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

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

Y
Yohan BELLEGUIC 已提交
752 753 754 755 756 757 758 759 760 761
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

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

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

776 777 778 779 780 781 782 783 784
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 已提交
785
if WITH_BHYVE
786
libbhyvexml2argvmock_la_SOURCES = \
R
Roman Bogorodskiy 已提交
787
	bhyvexml2argvmock.c
788 789
libbhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libbhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
790

791
libbhyveargv2xmlmock_la_SOURCES = \
792
	bhyveargv2xmlmock.c
793 794
libbhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libbhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
795

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

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

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

J
Ján Tomko 已提交
824 825 826 827 828
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

829 830 831 832 833
virnetworkportxml2xmltest_SOURCES = \
	virnetworkportxml2xmltest.c \
	testutils.c testutils.h
virnetworkportxml2xmltest_LDADD = $(LDADDS)

834
if WITH_NETWORK
835 836 837 838 839
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)

840 841
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
842
	testutils.c testutils.h
843
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
844 845 846 847 848 849

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

850
else ! WITH_NETWORK
851
EXTRA_DIST += networkxml2xmltest.c networkxml2conftest.c
852
endif !	WITH_NETWORK
853

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

866 867 868 869
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
870

871 872 873 874 875
virnwfilterbindingxml2xmltest_SOURCES = \
	virnwfilterbindingxml2xmltest.c \
	testutils.c testutils.h
virnwfilterbindingxml2xmltest_LDADD = $(LDADDS)

876 877 878 879 880
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
881 882 883 884 885 886

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

J
Ján Tomko 已提交
889 890 891 892 893
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
894 895 896 897 898
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
899

900
if WITH_STORAGE
901 902 903 904 905 906 907 908 909 910
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

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

921 922 923 924 925 926 927 928 929 930
storagepoolxml2argvtest_SOURCES = \
    storagepoolxml2argvtest.c \
    testutils.c testutils.h
storagepoolxml2argvtest_LDADD = \
	$(LIBXML_LIBS) \
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(LDADDS)

931 932 933 934 935 936 937
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS) \
	../src/libvirt_driver_storage_impl.la \
	$(GNULIB_LIBS)

938 939 940 941
storagepoolcapstest_SOURCES = \
        storagepoolcapstest.c testutils.h testutils.c
storagepoolcapstest_LDADD = $(LDADDS)

942
else ! WITH_STORAGE
943
EXTRA_DIST += storagevolxml2argvtest.c
944
EXTRA_DIST += virstorageutiltest.c
945
EXTRA_DIST += storagepoolxml2argvtest.c
946
EXTRA_DIST += storagepoolxml2xmltest.c
947
EXTRA_DIST += storagepoolcapstest.c
948
endif ! WITH_STORAGE
949

950 951 952 953 954
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
955 956 957
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
958
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
959

960 961 962 963 964
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

965 966 967
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
A
Andrea Bolognani 已提交
968
cputest_LDADD = $(LIBXML_LIBS)
J
Jiri Denemark 已提交
969 970
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
971
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS)
A
Andrea Bolognani 已提交
972 973 974
else ! WITH_QEMU
cputest_LDADD += $(LDADDS)
endif ! WITH_QEMU
975

P
Peter Krempa 已提交
976 977 978 979 980
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

981 982 983 984 985
virerrortest_SOURCES = \
	virerrortest.c \
	testutils.c testutils.h
virerrortest_LDADD = $(LDADDS)

S
Simon Kobyda 已提交
986 987 988 989 990 991 992
vshtabletest_SOURCES = \
	vshtabletest.c \
	testutils.c testutils.h
vshtabletest_LDADD = \
	$(LDADDS) \
	../tools/libvirt_shell.la

993 994 995 996 997
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

998
virconftest_SOURCES = \
999
	virconftest.c testutils.h testutils.c
1000
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
1001

1002
virhostcputest_SOURCES = \
1003
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1004
virhostcputest_LDADD = $(LDADDS)
1005

1006 1007 1008 1009
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

1010 1011 1012 1013
# Must not link to any libvirt modules - libc / gnulib only
# otherwise external libraries might unexpectedly leak
# file descriptors into commandhelper invalidating the
# test logic assumptions
1014 1015
commandhelper_SOURCES = \
	commandhelper.c
1016 1017 1018 1019
commandhelper_LDADD = \
	$(NO_INDIRECT_LDFLAGS) \
	$(GNULIB_LIBS)

1020
commandhelper_LDFLAGS = -static
1021

1022

1023 1024 1025 1026
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

1027
vircapstest_SOURCES = \
1028 1029 1030 1031 1032 1033 1034
	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
1035
if WITH_QEMU
1036
vircapstest_LDADD = $(qemu_LDADDS)
1037 1038 1039
else ! WITH_QEMU
vircapstest_LDADD = $(LDADDS)
endif ! WITH_QEMU
1040

1041 1042 1043
libdomaincapsmock_la_SOURCES = domaincapsmock.c
libdomaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libdomaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)
1044

M
Michal Privoznik 已提交
1045
domaincapstest_SOURCES = \
1046 1047 1048
	domaincapstest.c testutils.h testutils.c \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
M
Michal Privoznik 已提交
1049 1050
domaincapstest_LDADD = $(LDADDS)

1051 1052
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
1053
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
1054 1055
endif WITH_QEMU

1056 1057
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
1058
domaincapstest_LDADD += libxltestdriver.la $(GNULIB_LIBS)
1059 1060
endif WITH_LIBXL

1061 1062 1063 1064
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

1065 1066
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1067
virnetmessagetest_LDADD = $(LDADDS)
1068

1069 1070
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1071
virnetsockettest_LDADD = $(LDADDS)
1072

1073 1074
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1075
	testutils.h testutils.c
1076
virnetdaemontest_LDADD = $(LDADDS)
1077

1078
libvirnetdaemonmock_la_SOURCES = \
1079
	virnetdaemonmock.c
1080 1081
libvirnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)
1082

1083 1084 1085 1086 1087
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

1088
libvirnetserverclientmock_la_SOURCES = \
1089
	virnetserverclientmock.c
1090 1091
libvirnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1092

1093
virnettlscontexttest_SOURCES = \
1094 1095 1096
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1097
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
1098 1099 1100 1101
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1102
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
1103 1104 1105
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
1106 1107
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
1108
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
1109
EXTRA_DIST += pkix_asn1_tab.c
1110
endif ! HAVE_LIBTASN1
1111

1112 1113
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1114
virtimetest_LDADD = $(LDADDS)
1115

J
Ján Tomko 已提交
1116 1117
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1118
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1119

1120 1121 1122 1123
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1124 1125
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1126 1127 1128 1129 1130 1131 1132
virstoragetest_LDADD = $(LDADDS) \
	../src/libvirt.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	../src/libvirt_driver_storage_impl.la \
	../gnulib/lib/libgnu.la \
	$(NULL)
1133

1134 1135 1136
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1137
if WITH_SELINUX
1138
viridentitytest_LDADD += $(SELINUX_LIBS)
1139 1140 1141
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1142

J
Ján Tomko 已提交
1143 1144 1145 1146
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1147 1148 1149 1150
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1151 1152 1153 1154
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1155 1156 1157 1158
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1159 1160 1161 1162
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1163
libvirportallocatormock_la_SOURCES = \
1164
	virportallocatormock.c
1165 1166
libvirportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1167

1168 1169 1170 1171
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

1172
libvircgroupmock_la_SOURCES = \
1173
	vircgroupmock.c
1174 1175
libvircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1176

1177 1178 1179 1180
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1181 1182 1183 1184
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1185 1186 1187 1188
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

1189
libvirpcimock_la_SOURCES = \
M
Michal Privoznik 已提交
1190
	virpcimock.c
1191 1192
libvirpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1193

1194
libvirrandommock_la_SOURCES = \
J
John Ferlan 已提交
1195
	virrandommock.c
1196 1197
libvirrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirrandommock_la_LIBADD = $(MOCKLIBS_LIBS)
J
John Ferlan 已提交
1198

1199 1200 1201 1202 1203 1204
libvirprocessmock_la_SOURCES = \
	virprocessmock.c
libvirprocessmock_la_CFLAGS = $(AM_CFLAGS)
libvirprocessmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirprocessmock_la_LIBADD = $(MOCKLIBS_LIBS)

1205
libvirhostcpumock_la_SOURCES = \
1206
	virhostcpumock.c
1207 1208
libvirhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1209

1210
libvirfilecachemock_la_SOURCES = \
P
Pavel Hrdina 已提交
1211
	virfilecachemock.c
1212 1213
libvirfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
1214

1215 1216
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1217
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1218 1219
vircaps2xmltest_LDADD = $(LDADDS)

1220
libvirnumamock_la_SOURCES = \
M
Martin Kletzander 已提交
1221
	virnumamock.c
1222 1223
libvirnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1224

M
Martin Kletzander 已提交
1225 1226 1227 1228
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

1229
libvirfilemock_la_SOURCES = \
1230
	virfilemock.c
1231 1232
libvirfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilemock_la_LIBADD = $(MOCKLIBS_LIBS)
1233
else ! WITH_LINUX
M
Martin Kletzander 已提交
1234
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \
1235
			  virfilewrapper.h virresctrltest.c virfilemock.c
1236
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1237

1238
if WITH_NSS
M
Michal Privoznik 已提交
1239 1240 1241
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
1242
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1243 1244
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
1245
	$(LDADDS) \
M
Michal Privoznik 已提交
1246 1247
	../tools/nss/libnss_libvirt_impl.la

1248 1249 1250
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
1251 1252
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1253 1254
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
1255
	$(LDADDS) \
1256 1257
	../tools/nss/libnss_libvirt_guest_impl.la

1258
libnssmock_la_SOURCES = \
M
Michal Privoznik 已提交
1259
	nssmock.c
1260 1261
libnssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libnssmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1262

M
Michal Privoznik 已提交
1263 1264 1265
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
1266 1267
nsslinktest_CFLAGS = \
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1268 1269 1270 1271
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

1272
nssguestlinktest_SOURCES = nsslinktest.c
1273 1274 1275
nssguestlinktest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1276 1277 1278
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1279 1280 1281
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1282

1283
libvirdeterministichashmock_la_SOURCES = \
1284
	virdeterministichashmock.c
1285 1286
libvirdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)
1287

1288
test_libraries += libvirdeterministichashmock.la
1289

1290
if WITH_YAJL
1291 1292 1293 1294
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

1295 1296 1297 1298 1299 1300 1301
virnetdevopenvswitchtest_SOURCES = \
	virnetdevopenvswitchtest.c testutils.h testutils.c
virnetdevopenvswitchtest_LDADD = $(LDADDS)

test_programs += \
	virmacmaptest \
	virnetdevopenvswitchtest
1302
else ! WITH_YAJL
1303 1304 1305
EXTRA_DIST += \
	virmacmaptest.c \
	virnetdevopenvswitchtest.c
1306
endif ! WITH_YAJL
1307

M
Michal Privoznik 已提交
1308 1309 1310 1311 1312
virnetdevtest_SOURCES = \
	virnetdevtest.c testutils.h testutils.c
virnetdevtest_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
virnetdevtest_LDADD = $(LDADDS)

1313
libvirnetdevmock_la_SOURCES = \
M
Michal Privoznik 已提交
1314
	virnetdevmock.c
1315 1316 1317
libvirnetdevmock_la_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
libvirnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1318

1319 1320 1321 1322
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

1323 1324 1325 1326 1327
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1328 1329 1330 1331
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1332 1333 1334
libvirusbmock_la_SOURCES = virusbmock.c
libvirusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1335
	$(PROBES_O) \
1336
	../src/libvirt_util.la
1337

1338
libvirnetdevbandwidthmock_la_SOURCES = \
1339
	virnetdevbandwidthmock.c
1340 1341
libvirnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1342

1343
libvirtestmock_la_SOURCES = \
1344
	virtestmock.c
1345 1346
libvirtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirtestmock_la_LIBADD = \
1347
	$(MOCKLIBS_LIBS) \
1348
	$(PROBES_O) \
1349
	../src/libvirt_util.la
1350
else ! WITH_LINUX
1351
	EXTRA_DIST += virusbtest.c virusbmock.c \
1352 1353
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1354 1355
endif ! WITH_LINUX

1356 1357 1358 1359
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1360
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1361

1362
libvirdbusmock_la_SOURCES = \
1363
	virdbusmock.c
1364 1365 1366
libvirdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
libvirdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1367

1368 1369 1370 1371 1372
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1373 1374
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1375
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1376
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1377

1378
else ! WITH_DBUS
1379
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1380
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1381

1382 1383
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1384
viruritest_LDADD = $(LDADDS)
1385

1386 1387
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1388
virkeyfiletest_LDADD = $(LDADDS)
1389

1390 1391 1392 1393
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1394 1395
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1396
virauthconfigtest_LDADD = $(LDADDS)
1397

1398
seclabeltest_SOURCES = \
1399
	seclabeltest.c testutils.h testutils.c
1400
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1401

1402
if WITH_SECDRIVER_SELINUX
1403
if WITH_ATTR
1404 1405
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1406
else ! WITH_TESTS
1407
check_LTLIBRARIES += libsecurityselinuxhelper.la
1408
endif ! WITH_TESTS
1409 1410 1411

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1412
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1413 1414 1415

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1416
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1417 1418
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1419 1420 1421 1422 1423

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1424
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
1425 1426
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1427 1428 1429
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1430 1431
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1432

1433 1434 1435 1436
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1437 1438 1439
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1440

1441
viratomictest_SOURCES = \
L
Laine Stump 已提交
1442
	viratomictest.c testutils.h testutils.c
1443 1444
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1445 1446 1447 1448
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1449 1450 1451 1452
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1453 1454 1455 1456
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1457 1458 1459 1460
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1461 1462
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1463
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1464 1465
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1466 1467 1468
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1469

M
Matthias Bolte 已提交
1470 1471 1472 1473
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1474
if WITH_LIBVIRTD
1475 1476 1477
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1478
endif WITH_LIBVIRTD
1479

1480 1481
if WITH_LIBVIRTD
eventtest_SOURCES = \
1482
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1483
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1484
endif WITH_LIBVIRTD
1485

1486 1487
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1488
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1489 1490 1491

shunloadtest_SOURCES = \
	shunloadtest.c
1492
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1493 1494
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1495 1496 1497 1498
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1499 1500 1501 1502
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1503 1504 1505 1506
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1507 1508 1509 1510 1511
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1512 1513 1514 1515 1516
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1517
if WITH_LINUX
O
Osier Yang 已提交
1518 1519 1520 1521
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1522 1523 1524 1525
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1526 1527
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1528
EXTRA_DIST += scsihosttest.c
1529 1530
endif  ! WITH_LINUX

O
Osier Yang 已提交
1531 1532 1533 1534 1535 1536 1537 1538 1539
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1540 1541 1542 1543 1544 1545
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1546
objectlocking_SOURCES = objectlocking.ml
1547 1548 1549 1550

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

1551
objectlocking: objectlocking.cmx objectlocking-files.txt
1552 1553
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1554

1555
objectlocking-files.txt:
1556 1557
	find $(top_builddir)/src/ -name '*.i' > $@

1558
else ! WITH_CIL
1559
EXTRA_DIST += objectlocking.ml
1560
endif ! WITH_CIL
1561

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