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
	-I$(top_builddir)/src/rpc \
29
	$(NULL)
E
Eric Blake 已提交
30

31 32
WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)

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

50 51 52
AM_LDFLAGS = \
	-export-dynamic

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

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

65
PROBES_O =
66
if WITH_DTRACE_PROBES
67
PROBES_O += ../src/libvirt_probes.lo
68
endif WITH_DTRACE_PROBES
69

70 71 72
GNULIB_LIBS = \
       ../gnulib/lib/libgnu.la

K
Karel Zak 已提交
73
LDADDS = \
74
	$(NO_INDIRECT_LDFLAGS) \
75
	$(PROBES_O) \
76
	$(GNULIB_LIBS) \
D
Daniel P. Berrangé 已提交
77 78 79
	../src/libvirt.la \
	$(GLIB_LIBS) \
	$(NULL)
K
Karel Zak 已提交
80

81
MOCKLIBS_LIBS = \
82 83
	$(GNULIB_LIBS) \
	../src/libvirt.la
84

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

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

217
test_libraries = libshunload.la \
218 219 220 221 222 223 224
	libvirportallocatormock.la \
	libvirnetdaemonmock.la \
	libvirnetserverclientmock.la \
	libvircgroupmock.la \
	libvirpcimock.la \
	libvirnetdevmock.la \
	libvirrandommock.la \
225
	libvirprocessmock.la \
226 227 228
	libvirhostcpumock.la \
	libdomaincapsmock.la \
	libvirfilecachemock.la \
229
	libqemuhotplugmock.la \
230 231
	$(NULL)

E
Eric Blake 已提交
232 233 234 235
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
236
	virnetdaemontest \
E
Eric Blake 已提交
237
	virnetserverclienttest \
238 239
	virnettlscontexttest \
	virnettlssessiontest \
E
Eric Blake 已提交
240 241 242
	$(NULL)
endif WITH_REMOTE

243 244
if WITH_LINUX
test_programs += fchosttest
245
test_programs += scsihosttest
246
test_programs += vircaps2xmltest
M
Martin Kletzander 已提交
247
test_programs += virresctrltest
248 249 250 251 252
test_libraries += libvirusbmock.la \
	libvirnetdevbandwidthmock.la \
	libvirnumamock.la \
	libvirtestmock.la \
	libvirfilemock.la \
253
	$(NULL)
254 255
endif WITH_LINUX

256 257 258 259
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

260
if WITH_DBUS
261
test_programs += virdbustest \
262 263
                 virsystemdtest \
                 $(NULL)
264
test_libraries += libvirdbusmock.la
J
Ján Tomko 已提交
265
if WITH_POLKIT
266
test_programs += virpolkittest
J
Ján Tomko 已提交
267
endif WITH_POLKIT
268
endif WITH_DBUS
269

270
if WITH_SECDRIVER_SELINUX
271
if WITH_ATTR
272 273
test_programs += securityselinuxtest \
                 viridentitytest
274
if WITH_QEMU
275
test_programs += securityselinuxlabeltest
276 277 278
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
279

280 281
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
282
ssh_LDADD = $(COVERAGE_LDFLAGS)
283

284
if WITH_LIBXL
P
Peter Krempa 已提交
285
test_programs += xlconfigtest \
286
	xmconfigtest libxlxml2domconfigtest
287
test_libraries += libxltestdriver.la libxlmock.la
288 289
endif WITH_LIBXL

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

313
if WITH_LXC
314
test_programs += lxcxml2xmltest lxcconf2xmltest
315
endif WITH_LXC
316

317
if WITH_OPENVZ
318
test_programs += openvzutilstest
319
endif WITH_OPENVZ
320

321
if WITH_ESX
322
test_programs += esxutilstest
323
endif WITH_ESX
324

Y
Yohan BELLEGUIC 已提交
325 326 327 328
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

329
if WITH_VMX
330
test_programs += vmx2xmltest xml2vmxtest
331
endif WITH_VMX
332

333 334 335 336
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
337
if WITH_BHYVE
338
test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest
339
test_libraries += libbhyvexml2argvmock.la libbhyveargv2xmlmock.la
R
Roman Bogorodskiy 已提交
340 341
endif WITH_BHYVE

342
if WITH_YAJL
343
test_programs += virjsontest
344
endif WITH_YAJL
345

346 347
test_programs += \
		networkxml2xmlupdatetest \
348
		virnetworkportxml2xmltest \
349
		$(NULL)
350

351
if WITH_NETWORK
352
test_programs += \
353
		networkxml2xmltest \
354 355 356
		networkxml2conftest \
		networkxml2firewalltest \
		$(NULL)
357
endif WITH_NETWORK
358

359 360
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
361
endif WITH_STORAGE_SHEEPDOG
362

363
test_programs += nwfilterxml2xmltest
364
test_programs += virnwfilterbindingxml2xmltest
365

366 367
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
368
test_programs += nwfilterxml2firewalltest
369 370
endif WITH_NWFILTER

371
if WITH_STORAGE
372
test_programs += storagevolxml2argvtest
373
test_programs += storagepoolxml2argvtest
374
test_programs += virstorageutiltest
375
test_programs += storagepoolxml2xmltest
376
test_programs += storagepoolcapstest
377
endif WITH_STORAGE
378

379 380
if WITH_STORAGE_FS
test_programs += virstoragetest
381
endif WITH_STORAGE_FS
382

O
Osier Yang 已提交
383 384 385 386
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

387
if WITH_NSS
388 389
test_helpers += nsslinktest nssguestlinktest
test_programs += nsstest nssguesttest
390
test_libraries += libnssmock.la
391 392
endif WITH_NSS

393
test_programs += storagevolxml2xmltest
394

395
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
396

397
test_programs += interfacexml2xmltest
398

399
test_programs += cputest
400

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

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

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

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

J
Ján Tomko 已提交
413
test_scripts =
414 415 416 417 418 419 420 421 422 423 424 425
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 已提交
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 460 461
	$(PERL) $(abs_srcdir)/check-file-access.pl \
		$(abs_builddir)/test_file_access.txt \
		$(abs_srcdir)/file_access_whitelist.txt | sort -u
462 463 464 465 466 467 468 469 470

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

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

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

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

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

494

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

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

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

512 513 514 515
libxltestdriver_la_SOURCES =
libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
libxltestdriver_la_LIBADD = $(libxl_LDADDS)

516 517 518 519
xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
520

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

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

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

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

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

548
if WITH_QEMU
549

550 551
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

730 731
if WITH_LXC

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

J
Ján Tomko 已提交
919

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

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

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

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

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
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

983 984 985
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
A
Andrea Bolognani 已提交
986
cputest_LDADD = $(LIBXML_LIBS)
J
Jiri Denemark 已提交
987 988
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
989
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS)
A
Andrea Bolognani 已提交
990 991 992
else ! WITH_QEMU
cputest_LDADD += $(LDADDS)
endif ! WITH_QEMU
993

P
Peter Krempa 已提交
994 995 996 997 998
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

999 1000 1001 1002 1003
virerrortest_SOURCES = \
	virerrortest.c \
	testutils.c testutils.h
virerrortest_LDADD = $(LDADDS)

S
Simon Kobyda 已提交
1004 1005 1006 1007 1008 1009 1010
vshtabletest_SOURCES = \
	vshtabletest.c \
	testutils.c testutils.h
vshtabletest_LDADD = \
	$(LDADDS) \
	../tools/libvirt_shell.la

1011 1012 1013 1014 1015
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

1016
virconftest_SOURCES = \
1017
	virconftest.c testutils.h testutils.c
1018
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
1019

1020
virhostcputest_SOURCES = \
1021
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1022
virhostcputest_LDADD = $(LDADDS)
1023

1024 1025 1026 1027
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

1028 1029 1030 1031
# 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
1032 1033
commandhelper_SOURCES = \
	commandhelper.c
1034 1035 1036 1037
commandhelper_LDADD = \
	$(NO_INDIRECT_LDFLAGS) \
	$(GNULIB_LIBS)

1038
commandhelper_LDFLAGS = -static
1039

1040

1041 1042 1043 1044
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

1045
vircapstest_SOURCES = \
1046 1047 1048 1049 1050 1051 1052
	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
1053
vircapstest_LDADD =
1054
if WITH_QEMU
1055 1056 1057 1058 1059 1060 1061 1062 1063
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)
1064

1065 1066 1067
libdomaincapsmock_la_SOURCES = domaincapsmock.c
libdomaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libdomaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)
1068

M
Michal Privoznik 已提交
1069
domaincapstest_SOURCES = \
1070 1071 1072
	domaincapstest.c testutils.h testutils.c \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
M
Michal Privoznik 已提交
1073 1074
domaincapstest_LDADD = $(LDADDS)

1075 1076
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
1077
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
1078 1079
endif WITH_QEMU

1080 1081
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
1082
domaincapstest_LDADD += libxltestdriver.la $(GNULIB_LIBS)
1083 1084
endif WITH_LIBXL

1085 1086 1087 1088
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

1089 1090
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1091
virnetmessagetest_LDADD = $(LDADDS)
1092

1093 1094
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1095
virnetsockettest_LDADD = $(LDADDS)
1096

1097 1098
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1099
	testutils.h testutils.c
1100
virnetdaemontest_LDADD = $(LDADDS)
1101

1102
libvirnetdaemonmock_la_SOURCES = \
1103
	virnetdaemonmock.c
1104 1105
libvirnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)
1106

1107 1108 1109 1110 1111
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

1112
libvirnetserverclientmock_la_SOURCES = \
1113
	virnetserverclientmock.c
1114 1115
libvirnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1116

1117
virnettlscontexttest_SOURCES = \
1118 1119 1120
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1121
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
1122 1123 1124 1125
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1126
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
1127 1128 1129
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
1130 1131
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
1132
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
1133
EXTRA_DIST += pkix_asn1_tab.c
1134
endif ! HAVE_LIBTASN1
1135

1136 1137
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1138
virtimetest_LDADD = $(LDADDS)
1139

J
Ján Tomko 已提交
1140 1141
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1142
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1143

1144 1145 1146 1147
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1148 1149
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1150 1151 1152 1153 1154
virstoragetest_LDADD = $(LDADDS) \
	../src/libvirt.la \
	../src/libvirt_driver_storage_impl.la \
	../gnulib/lib/libgnu.la \
	$(NULL)
1155

1156 1157 1158
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1159
if WITH_SELINUX
1160
viridentitytest_LDADD += $(SELINUX_LIBS)
1161 1162 1163
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1164

J
Ján Tomko 已提交
1165 1166 1167 1168
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1169 1170 1171 1172
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1173 1174 1175 1176
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1177 1178 1179 1180
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1181 1182 1183 1184
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1185
libvirportallocatormock_la_SOURCES = \
1186
	virportallocatormock.c
1187 1188
libvirportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1189

1190 1191 1192 1193
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

1194
libvircgroupmock_la_SOURCES = \
1195
	vircgroupmock.c
1196 1197
libvircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1198

1199 1200 1201 1202
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1203 1204 1205 1206
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1207 1208 1209 1210
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

1211
libvirpcimock_la_SOURCES = \
M
Michal Privoznik 已提交
1212
	virpcimock.c
1213 1214
libvirpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1215

1216
libvirrandommock_la_SOURCES = \
J
John Ferlan 已提交
1217
	virrandommock.c
1218 1219
libvirrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirrandommock_la_LIBADD = $(MOCKLIBS_LIBS)
J
John Ferlan 已提交
1220

1221 1222 1223 1224 1225 1226
libvirprocessmock_la_SOURCES = \
	virprocessmock.c
libvirprocessmock_la_CFLAGS = $(AM_CFLAGS)
libvirprocessmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirprocessmock_la_LIBADD = $(MOCKLIBS_LIBS)

1227
libvirhostcpumock_la_SOURCES = \
1228
	virhostcpumock.c
1229 1230
libvirhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1231

1232
libvirfilecachemock_la_SOURCES = \
P
Pavel Hrdina 已提交
1233
	virfilecachemock.c
1234 1235
libvirfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
1236

1237 1238
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1239
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1240 1241
vircaps2xmltest_LDADD = $(LDADDS)

1242
libvirnumamock_la_SOURCES = \
M
Martin Kletzander 已提交
1243
	virnumamock.c
1244 1245
libvirnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1246

M
Martin Kletzander 已提交
1247 1248 1249 1250
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

1251
libvirfilemock_la_SOURCES = \
1252
	virfilemock.c
1253 1254
libvirfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilemock_la_LIBADD = $(MOCKLIBS_LIBS)
1255
else ! WITH_LINUX
M
Martin Kletzander 已提交
1256
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \
1257
			  virfilewrapper.h virresctrltest.c virfilemock.c
1258
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1259

1260
if WITH_NSS
M
Michal Privoznik 已提交
1261 1262 1263
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
1264
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1265 1266
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
1267
	$(LDADDS) \
M
Michal Privoznik 已提交
1268 1269
	../tools/nss/libnss_libvirt_impl.la

1270 1271 1272
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
1273 1274
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1275 1276
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
1277
	$(LDADDS) \
1278 1279
	../tools/nss/libnss_libvirt_guest_impl.la

1280
libnssmock_la_SOURCES = \
M
Michal Privoznik 已提交
1281
	nssmock.c
1282 1283
libnssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libnssmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1284

M
Michal Privoznik 已提交
1285 1286 1287
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
1288 1289
nsslinktest_CFLAGS = \
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1290 1291 1292 1293
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

1294
nssguestlinktest_SOURCES = nsslinktest.c
1295 1296 1297
nssguestlinktest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1298 1299 1300
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1301 1302 1303
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1304

1305
libvirdeterministichashmock_la_SOURCES = \
1306
	virdeterministichashmock.c
1307 1308
libvirdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)
1309

1310
test_libraries += libvirdeterministichashmock.la
1311

1312
if WITH_YAJL
1313 1314 1315 1316
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

1317 1318 1319 1320 1321 1322 1323
virnetdevopenvswitchtest_SOURCES = \
	virnetdevopenvswitchtest.c testutils.h testutils.c
virnetdevopenvswitchtest_LDADD = $(LDADDS)

test_programs += \
	virmacmaptest \
	virnetdevopenvswitchtest
1324
else ! WITH_YAJL
1325 1326 1327
EXTRA_DIST += \
	virmacmaptest.c \
	virnetdevopenvswitchtest.c
1328
endif ! WITH_YAJL
1329

M
Michal Privoznik 已提交
1330 1331 1332 1333 1334
virnetdevtest_SOURCES = \
	virnetdevtest.c testutils.h testutils.c
virnetdevtest_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
virnetdevtest_LDADD = $(LDADDS)

1335
libvirnetdevmock_la_SOURCES = \
M
Michal Privoznik 已提交
1336
	virnetdevmock.c
1337 1338 1339
libvirnetdevmock_la_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
libvirnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1340

1341 1342 1343 1344
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

1345 1346 1347 1348 1349
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1350 1351 1352 1353
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1354 1355 1356
libvirusbmock_la_SOURCES = virusbmock.c
libvirusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1357
	$(PROBES_O) \
1358
	../src/libvirt_util.la
1359

1360
libvirnetdevbandwidthmock_la_SOURCES = \
1361
	virnetdevbandwidthmock.c
1362 1363
libvirnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1364

1365
libvirtestmock_la_SOURCES = \
1366
	virtestmock.c
1367 1368
libvirtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirtestmock_la_LIBADD = \
1369
	$(MOCKLIBS_LIBS) \
1370
	$(PROBES_O) \
1371
	../src/libvirt_util.la
1372
else ! WITH_LINUX
1373
	EXTRA_DIST += virusbtest.c virusbmock.c \
1374 1375
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1376 1377
endif ! WITH_LINUX

1378 1379 1380 1381
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1382
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1383

1384
libvirdbusmock_la_SOURCES = \
1385
	virdbusmock.c
1386 1387 1388
libvirdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
libvirdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1389

1390 1391 1392 1393 1394
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1395 1396
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1397
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1398
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1399

1400
else ! WITH_DBUS
1401
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1402
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1403

1404 1405
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1406
viruritest_LDADD = $(LDADDS)
1407

1408 1409
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1410
virkeyfiletest_LDADD = $(LDADDS)
1411

1412 1413 1414 1415
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1416 1417
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1418
virauthconfigtest_LDADD = $(LDADDS)
1419

1420
seclabeltest_SOURCES = \
1421
	seclabeltest.c testutils.h testutils.c
1422
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1423

1424
if WITH_SECDRIVER_SELINUX
1425
if WITH_ATTR
1426 1427
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1428
else ! WITH_TESTS
1429
check_LTLIBRARIES += libsecurityselinuxhelper.la
1430
endif ! WITH_TESTS
1431 1432 1433

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1434
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1435 1436 1437

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1438
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1439 1440
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1441 1442 1443 1444 1445

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1446
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
1447 1448
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1449 1450 1451
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1452 1453
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1454

1455 1456 1457 1458
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1459 1460 1461
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1462

1463
viratomictest_SOURCES = \
L
Laine Stump 已提交
1464
	viratomictest.c testutils.h testutils.c
1465 1466
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1467 1468 1469 1470
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1471 1472 1473 1474
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1475 1476 1477 1478
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1479 1480 1481 1482
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1483 1484
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1485
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1486 1487
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1488 1489 1490
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1491

M
Matthias Bolte 已提交
1492 1493 1494 1495
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1496
if WITH_LIBVIRTD
1497 1498 1499
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1500 1501 1502 1503

virdriverconnvalidatetest_SOURCES = \
	virdriverconnvalidatetest.c testutils.h testutils.c
virdriverconnvalidatetest_LDADD = $(LDADDS)
1504
endif WITH_LIBVIRTD
1505

1506 1507
if WITH_LIBVIRTD
eventtest_SOURCES = \
1508
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1509
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1510
endif WITH_LIBVIRTD
1511

1512 1513
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1514
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1515 1516 1517

shunloadtest_SOURCES = \
	shunloadtest.c
1518
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1519 1520
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1521 1522 1523 1524
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1525 1526 1527 1528
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1529 1530 1531 1532
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1533 1534 1535 1536 1537
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1538 1539 1540 1541 1542
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1543
if WITH_LINUX
O
Osier Yang 已提交
1544 1545 1546 1547
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1548 1549 1550 1551
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1552 1553
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1554
EXTRA_DIST += scsihosttest.c
1555 1556
endif  ! WITH_LINUX

O
Osier Yang 已提交
1557 1558 1559 1560 1561 1562 1563 1564 1565
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

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