Makefile.am 38.6 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 59
	-avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
	$(MINGW_EXTRA_LDFLAGS)

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

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

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

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

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

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

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

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

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

245 246 247 248
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

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

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

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

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

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

301
if WITH_LXC
302
test_programs += lxcxml2xmltest lxcconf2xmltest
303
endif WITH_LXC
304

305
if WITH_OPENVZ
306
test_programs += openvzutilstest
307
endif WITH_OPENVZ
308

309
if WITH_ESX
310
test_programs += esxutilstest
311
endif WITH_ESX
312

Y
Yohan BELLEGUIC 已提交
313 314 315 316
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

317
if WITH_VMX
318
test_programs += vmx2xmltest xml2vmxtest
319
endif WITH_VMX
320

321 322 323 324
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
325
if WITH_BHYVE
326
test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest
327
test_libraries += libbhyvexml2argvmock.la libbhyveargv2xmlmock.la
R
Roman Bogorodskiy 已提交
328 329
endif WITH_BHYVE

330
if WITH_CIL
331
test_programs += objectlocking
332
endif WITH_CIL
333

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

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

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

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

355
test_programs += nwfilterxml2xmltest
356
test_programs += virnwfilterbindingxml2xmltest
357

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

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

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

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

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

385
test_programs += storagevolxml2xmltest
386

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

389
test_programs += interfacexml2xmltest
390

391
test_programs += cputest
392

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

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

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

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

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

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

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

436 437
test_programs += objecteventtest

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

445 446
EXTRA_DIST += $(test_scripts)

447 448 449 450 451 452 453 454 455 456 457 458 459
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

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

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

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

483

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

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

495 496
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
497 498 499
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
500 501
libxl_LDADDS += $(LDADDS)

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

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

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

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

521 522 523 524 525
libxlmock_la_SOURCES = \
	libxlmock.c
libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS)
libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libxlmock_la_LIBADD = $(MOCKLIBS_LIBS)
526

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

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

538
if WITH_QEMU
539

540 541
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

554
libqemutestdriver_la_SOURCES =
555
libqemutestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
556
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)
557

558
libqemucpumock_la_SOURCES = \
559
	qemucpumock.c testutilshostcpus.h
560 561
libqemucpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemucpumock_la_LIBADD = $(MOCKLIBS_LIBS)
562

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

709 710
if WITH_LXC

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

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
720
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
721 722

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

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

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

Y
Yohan BELLEGUIC 已提交
749 750 751 752 753 754 755 756 757 758
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

759
if WITH_VMX
760 761 762
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
763
vmx2xmltest_LDADD = $(LDADDS)
764 765 766 767

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
768
xml2vmxtest_LDADD = $(LDADDS)
769
else ! WITH_VMX
770
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
771
endif ! WITH_VMX
772

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

788
libbhyveargv2xmlmock_la_SOURCES = \
789
	bhyveargv2xmlmock.c
790 791
libbhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libbhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
792

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

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
807 808 809 810 811

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

J
Ján Tomko 已提交
821 822 823 824 825
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

826 827 828 829 830
virnetworkportxml2xmltest_SOURCES = \
	virnetworkportxml2xmltest.c \
	testutils.c testutils.h
virnetworkportxml2xmltest_LDADD = $(LDADDS)

831
if WITH_NETWORK
832 833 834 835 836
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)

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

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

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

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

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

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

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

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

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

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

J
Ján Tomko 已提交
896

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

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

918 919 920 921 922 923 924 925 926 927
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)

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

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

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

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

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

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

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

P
Peter Krempa 已提交
973 974 975 976 977
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

978 979 980 981 982
virerrortest_SOURCES = \
	virerrortest.c \
	testutils.c testutils.h
virerrortest_LDADD = $(LDADDS)

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

990 991 992 993 994
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

995
virconftest_SOURCES = \
996
	virconftest.c testutils.h testutils.c
997
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
998

999
virhostcputest_SOURCES = \
1000
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1001
virhostcputest_LDADD = $(LDADDS)
1002

1003 1004 1005 1006
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

1007 1008 1009 1010
# 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
1011 1012
commandhelper_SOURCES = \
	commandhelper.c
1013 1014 1015 1016
commandhelper_LDADD = \
	$(NO_INDIRECT_LDFLAGS) \
	$(GNULIB_LIBS)

1017
commandhelper_LDFLAGS = -static
1018

1019

1020 1021 1022 1023
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

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

1038 1039 1040
libdomaincapsmock_la_SOURCES = domaincapsmock.c
libdomaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libdomaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)
1041

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

1048 1049
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
1050
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
1051 1052
endif WITH_QEMU

1053 1054
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
1055
domaincapstest_LDADD += libxltestdriver.la $(GNULIB_LIBS)
1056 1057
endif WITH_LIBXL

1058 1059 1060 1061
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

1062 1063
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1064
virnetmessagetest_LDADD = $(LDADDS)
1065

1066 1067
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1068
virnetsockettest_LDADD = $(LDADDS)
1069

1070 1071
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1072
	testutils.h testutils.c
1073
virnetdaemontest_LDADD = $(LDADDS)
1074

1075
libvirnetdaemonmock_la_SOURCES = \
1076
	virnetdaemonmock.c
1077 1078
libvirnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)
1079

1080 1081 1082 1083 1084
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

1085
libvirnetserverclientmock_la_SOURCES = \
1086
	virnetserverclientmock.c
1087 1088
libvirnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1089

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

1109 1110
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1111
virtimetest_LDADD = $(LDADDS)
1112

J
Ján Tomko 已提交
1113 1114
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1115
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1116

1117 1118 1119 1120
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1121 1122
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1123 1124 1125 1126 1127 1128 1129
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)
1130

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

J
Ján Tomko 已提交
1140 1141 1142 1143
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1144 1145 1146 1147
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1148 1149 1150 1151
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1152 1153 1154 1155
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1156 1157 1158 1159
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1160
libvirportallocatormock_la_SOURCES = \
1161
	virportallocatormock.c
1162 1163
libvirportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1164

1165 1166 1167 1168
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

1169
libvircgroupmock_la_SOURCES = \
1170
	vircgroupmock.c
1171 1172
libvircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1173

1174 1175 1176 1177
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1178 1179 1180 1181
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1182 1183 1184 1185
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

1186
libvirpcimock_la_SOURCES = \
M
Michal Privoznik 已提交
1187
	virpcimock.c
1188 1189
libvirpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1190

1191
libvirrandommock_la_SOURCES = \
J
John Ferlan 已提交
1192
	virrandommock.c
1193 1194
libvirrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirrandommock_la_LIBADD = $(MOCKLIBS_LIBS)
J
John Ferlan 已提交
1195

1196
libvirhostcpumock_la_SOURCES = \
1197
	virhostcpumock.c
1198 1199
libvirhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1200

1201
libvirfilecachemock_la_SOURCES = \
P
Pavel Hrdina 已提交
1202
	virfilecachemock.c
1203 1204
libvirfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
1205

1206 1207
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1208
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1209 1210
vircaps2xmltest_LDADD = $(LDADDS)

1211
libvirnumamock_la_SOURCES = \
M
Martin Kletzander 已提交
1212
	virnumamock.c
1213 1214
libvirnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1215

M
Martin Kletzander 已提交
1216 1217 1218 1219
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

1220
libvirfilemock_la_SOURCES = \
1221
	virfilemock.c
1222 1223
libvirfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilemock_la_LIBADD = $(MOCKLIBS_LIBS)
1224
else ! WITH_LINUX
M
Martin Kletzander 已提交
1225
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \
1226
			  virfilewrapper.h virresctrltest.c virfilemock.c
1227
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1228

1229
if WITH_NSS
M
Michal Privoznik 已提交
1230 1231 1232
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
1233
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1234 1235
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
1236
	$(LDADDS) \
M
Michal Privoznik 已提交
1237 1238
	../tools/nss/libnss_libvirt_impl.la

1239 1240 1241
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
1242 1243
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1244 1245
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
1246
	$(LDADDS) \
1247 1248
	../tools/nss/libnss_libvirt_guest_impl.la

1249
libnssmock_la_SOURCES = \
M
Michal Privoznik 已提交
1250
	nssmock.c
1251 1252
libnssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libnssmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1253

M
Michal Privoznik 已提交
1254 1255 1256
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
1257 1258
nsslinktest_CFLAGS = \
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1259 1260 1261 1262
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

1263
nssguestlinktest_SOURCES = nsslinktest.c
1264 1265 1266
nssguestlinktest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1267 1268 1269
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1270 1271 1272
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1273

1274
libvirdeterministichashmock_la_SOURCES = \
1275
	virdeterministichashmock.c
1276 1277
libvirdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)
1278

1279
test_libraries += libvirdeterministichashmock.la
1280

1281
if WITH_YAJL
1282 1283 1284 1285
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

1286 1287 1288 1289 1290 1291 1292
virnetdevopenvswitchtest_SOURCES = \
	virnetdevopenvswitchtest.c testutils.h testutils.c
virnetdevopenvswitchtest_LDADD = $(LDADDS)

test_programs += \
	virmacmaptest \
	virnetdevopenvswitchtest
1293
else ! WITH_YAJL
1294 1295 1296
EXTRA_DIST += \
	virmacmaptest.c \
	virnetdevopenvswitchtest.c
1297
endif ! WITH_YAJL
1298

M
Michal Privoznik 已提交
1299 1300 1301 1302 1303
virnetdevtest_SOURCES = \
	virnetdevtest.c testutils.h testutils.c
virnetdevtest_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
virnetdevtest_LDADD = $(LDADDS)

1304
libvirnetdevmock_la_SOURCES = \
M
Michal Privoznik 已提交
1305
	virnetdevmock.c
1306 1307 1308
libvirnetdevmock_la_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
libvirnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1309

1310 1311 1312 1313
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

1314 1315 1316 1317 1318
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1319 1320 1321 1322
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1323 1324 1325
libvirusbmock_la_SOURCES = virusbmock.c
libvirusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1326
	$(PROBES_O) \
1327
	../src/libvirt_util.la
1328

1329
libvirnetdevbandwidthmock_la_SOURCES = \
1330
	virnetdevbandwidthmock.c
1331 1332
libvirnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1333

1334
libvirtestmock_la_SOURCES = \
1335
	virtestmock.c
1336 1337
libvirtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirtestmock_la_LIBADD = \
1338
	$(MOCKLIBS_LIBS) \
1339
	$(PROBES_O) \
1340
	../src/libvirt_util.la
1341
else ! WITH_LINUX
1342
	EXTRA_DIST += virusbtest.c virusbmock.c \
1343 1344
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1345 1346
endif ! WITH_LINUX

1347 1348 1349 1350
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1351
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1352

1353
libvirdbusmock_la_SOURCES = \
1354
	virdbusmock.c
1355 1356 1357
libvirdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
libvirdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1358

1359 1360 1361 1362 1363
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1364 1365
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1366
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1367
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1368

1369
else ! WITH_DBUS
1370
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1371
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1372

1373 1374
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1375
viruritest_LDADD = $(LDADDS)
1376

1377 1378
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1379
virkeyfiletest_LDADD = $(LDADDS)
1380

1381 1382 1383 1384
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1385 1386
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1387
virauthconfigtest_LDADD = $(LDADDS)
1388

1389
seclabeltest_SOURCES = \
1390
	seclabeltest.c testutils.h testutils.c
1391
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1392

1393
if WITH_SECDRIVER_SELINUX
1394
if WITH_ATTR
1395 1396
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1397
else ! WITH_TESTS
1398
check_LTLIBRARIES += libsecurityselinuxhelper.la
1399
endif ! WITH_TESTS
1400 1401 1402

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1403
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1404 1405 1406

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1407
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1408 1409
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1410 1411 1412 1413 1414

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1415
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
1416 1417
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1418 1419 1420
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1421 1422
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1423

1424 1425 1426 1427
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1428 1429 1430
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1431

1432
viratomictest_SOURCES = \
L
Laine Stump 已提交
1433
	viratomictest.c testutils.h testutils.c
1434 1435
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1436 1437 1438 1439
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1440 1441 1442 1443
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1444 1445 1446 1447
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1448 1449 1450 1451
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1452 1453
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1454
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1455 1456
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1457 1458 1459
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1460

M
Matthias Bolte 已提交
1461 1462 1463 1464
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1465
if WITH_LIBVIRTD
1466 1467 1468
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1469
endif WITH_LIBVIRTD
1470

1471 1472
if WITH_LIBVIRTD
eventtest_SOURCES = \
1473
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1474
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1475
endif WITH_LIBVIRTD
1476

1477 1478
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1479
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1480 1481 1482

shunloadtest_SOURCES = \
	shunloadtest.c
1483
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1484 1485
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1486 1487 1488 1489
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1490 1491 1492 1493
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1494 1495 1496 1497
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1498 1499 1500 1501 1502
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1503 1504 1505 1506 1507
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1508
if WITH_LINUX
O
Osier Yang 已提交
1509 1510 1511 1512
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1513 1514 1515 1516
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1517 1518
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1519
EXTRA_DIST += scsihosttest.c
1520 1521
endif  ! WITH_LINUX

O
Osier Yang 已提交
1522 1523 1524 1525 1526 1527 1528 1529 1530
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1531 1532 1533 1534 1535 1536
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1537
objectlocking_SOURCES = objectlocking.ml
1538 1539 1540 1541

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

1542
objectlocking: objectlocking.cmx objectlocking-files.txt
1543 1544
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1545

1546
objectlocking-files.txt:
1547 1548
	find $(top_builddir)/src/ -name '*.i' > $@

1549
else ! WITH_CIL
1550
EXTRA_DIST += objectlocking.ml
1551
endif ! WITH_CIL
1552

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