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

29 30
WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)

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

48 49 50
AM_LDFLAGS = \
	-export-dynamic

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

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

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

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

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

79
MOCKLIBS_LIBS = \
80 81
	$(GNULIB_LIBS) \
	../src/libvirt.la
82

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

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

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

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

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

253 254 255 256
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

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

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

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

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

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

310
if WITH_LXC
311
test_programs += lxcxml2xmltest lxcconf2xmltest
312
endif WITH_LXC
313

314
if WITH_OPENVZ
315
test_programs += openvzutilstest
316
endif WITH_OPENVZ
317

318
if WITH_ESX
319
test_programs += esxutilstest
320
endif WITH_ESX
321

Y
Yohan BELLEGUIC 已提交
322 323 324 325
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

326
if WITH_VMX
327
test_programs += vmx2xmltest xml2vmxtest
328
endif WITH_VMX
329

330 331 332 333
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

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

339
if WITH_YAJL
340
test_programs += virjsontest
341
endif WITH_YAJL
342

343 344
test_programs += \
		networkxml2xmlupdatetest \
345
		virnetworkportxml2xmltest \
346
		$(NULL)
347

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

356 357
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
358
endif WITH_STORAGE_SHEEPDOG
359

360
test_programs += nwfilterxml2xmltest
361
test_programs += virnwfilterbindingxml2xmltest
362

363 364
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
365
test_programs += nwfilterxml2firewalltest
366 367
endif WITH_NWFILTER

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

376 377
if WITH_STORAGE_FS
test_programs += virstoragetest
378
endif WITH_STORAGE_FS
379

O
Osier Yang 已提交
380 381 382 383
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

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

390
test_programs += storagevolxml2xmltest
391

392
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
393

394
test_programs += interfacexml2xmltest
395

396
test_programs += cputest
397

P
Peter Krempa 已提交
398 399
test_programs += metadatatest

J
Ján Tomko 已提交
400 401
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
402 403
test_programs += genericxml2xmltest

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

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

431 432 433
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

434
test_programs += \
435
	eventtest \
436 437
	virdrivermoduletest \
	virdriverconnvalidatetest
438
else ! WITH_LIBVIRTD
439
EXTRA_DIST += $(libvirtd_test_scripts)
440
endif ! WITH_LIBVIRTD
441

442 443
test_programs += objecteventtest

J
Jamie Strandboge 已提交
444
if WITH_SECDRIVER_APPARMOR
445
if WITH_LIBVIRTD
J
Jamie Strandboge 已提交
446
test_scripts += virt-aa-helper-test
447 448
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
449 450
EXTRA_DIST += virt-aa-helper-test

451 452
EXTRA_DIST += $(test_scripts)

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

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

EXTRA_DIST += \
	file_access_whitelist.txt

467 468
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
469
noinst_LTLIBRARIES = $(test_libraries)
470
else ! WITH_TESTS
471
check_PROGRAMS = $(test_programs) $(test_helpers)
472
check_LTLIBRARIES = $(test_libraries)
473
endif ! WITH_TESTS
474

475 476
TESTS = $(test_programs) \
	$(test_scripts)
477

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

489

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

496 497 498
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
499
sockettest_LDADD = $(LDADDS)
500

501
if WITH_LIBXL
502 503 504 505
libxl_LDADDS = \
	../src/libvirt_driver_libxl_impl.la \
	$(LDADDS) \
	$(NULL)
506

507 508 509 510
libxltestdriver_la_SOURCES =
libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
libxltestdriver_la_LIBADD = $(libxl_LDADDS)

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

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

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

526 527
libxlmock_la_SOURCES = \
	libxlmock.c
D
Daniel P. Berrangé 已提交
528
libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS) $(GLIB_CFLAGS)
529 530
libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libxlmock_la_LIBADD = $(MOCKLIBS_LIBS)
531

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

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

543
if WITH_QEMU
544

545 546
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

547
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
548
if WITH_DTRACE_PROBES
549
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
550
endif WITH_DTRACE_PROBES
551
qemu_LDADDS += $(LDADDS)
552

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

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

562 563 564 565 566
libqemuhotplugmock_la_SOURCES = \
	qemuhotplugmock.c
libqemuhotplugmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libqemuhotplugmock_la_LIBADD = $(MOCKLIBS_LIBS)

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

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

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

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

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

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

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

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

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

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

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

639 640 641 642 643
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
644 645 646 647 648
qemuhotplugtest_LDADD = \
	libqemutestdriver.la \
	libqemumonitortestutils.la \
	$(qemu_LDADDS) \
	$(NULL)
649

650
qemublocktest_SOURCES = \
651 652
	qemublocktest.c \
	testutils.h testutils.c \
653
	testutilsqemu.h testutilsqemu.c \
654 655
	$(NULL)
qemublocktest_LDADD = \
656
	libqemumonitortestutils.la \
657
	../src/libvirt.la \
658 659 660
	$(qemu_LDADDS) \
	$(NULL)

661 662 663 664 665
qemudomaincheckpointxml2xmltest_SOURCES = \
	qemudomaincheckpointxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemudomaincheckpointxml2xmltest_LDADD = $(qemu_LDADDS)

666 667
qemudomainsnapshotxml2xmltest_SOURCES = \
	qemudomainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
668
	testutils.c testutils.h
669
qemudomainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
670 671 672 673 674

qemumemlocktest_SOURCES = \
	qemumemlocktest.c \
	testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
675
qemumemlocktest_LDADD = $(qemu_LDADDS)
676 677 678 679 680 681 682

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

685 686 687 688 689
qemusecuritytest_SOURCES = \
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
	testutils.h testutils.c \
	testutilsqemu.h testutilsqemu.c
690
qemusecuritytest_LDADD = $(qemu_LDADDS)
691

692 693 694
qemufirmwaretest_SOURCES = \
	qemufirmwaretest.c \
	testutils.h testutils.c \
695
	virfilewrapper.c virfilewrapper.h \
696
	$(NULL)
697
qemufirmwaretest_LDADD = $(qemu_LDADDS)
698

699 700 701 702 703 704 705
qemuvhostusertest_SOURCES = \
	qemuvhostusertest.c \
	testutils.h testutils.c \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
qemuvhostusertest_LDADD = $(qemu_LDADDS)

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

725 726
if WITH_LXC

727 728 729 730
lxc_LDADDS = \
	../src/libvirt_driver_lxc_impl.la \
	$(LDADDS) \
	$(NULL)
731 732 733 734

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
735
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
736 737

lxcconf2xmltest_SOURCES = \
738
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
739 740
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
741
else ! WITH_LXC
742
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
743
endif ! WITH_LXC
744

745 746 747 748
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
749 750
openvzutilstest_LDADD = $(LDADDS) \
	../src/libvirt_driver_openvz.la
751
else ! WITH_OPENVZ
752
EXTRA_DIST += openvzutilstest.c
753
endif ! WITH_OPENVZ
754 755
EXTRA_DIST += openvzutilstest.conf

756 757 758 759
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
760
esxutilstest_LDADD = $(LDADDS)
761 762 763
esxutilstest_CFLAGS = \
	-I$(top_builddir)/src/esx \
	$(AM_CFLAGS)
764
else ! WITH_ESX
765
EXTRA_DIST += esxutilstest.c
766
endif ! WITH_ESX
767

Y
Yohan BELLEGUIC 已提交
768 769 770 771 772 773 774 775 776 777
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

778
if WITH_VMX
779 780 781
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
782
vmx2xmltest_LDADD = $(LDADDS)
783 784 785 786

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
787
xml2vmxtest_LDADD = $(LDADDS)
788
else ! WITH_VMX
789
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
790
endif ! WITH_VMX
791

792 793 794 795 796 797 798 799 800
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 已提交
801
if WITH_BHYVE
802
libbhyvexml2argvmock_la_SOURCES = \
R
Roman Bogorodskiy 已提交
803
	bhyvexml2argvmock.c
804 805
libbhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libbhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
806

807
libbhyveargv2xmlmock_la_SOURCES = \
808
	bhyveargv2xmlmock.c
809 810
libbhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libbhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
811

812 813 814 815
bhyve_LDADDS = \
	../src/libvirt_driver_bhyve_impl.la \
	$(LDADDS) \
	$(NULL)
R
Roman Bogorodskiy 已提交
816 817 818 819
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
820 821 822 823 824

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
825 826 827 828 829

bhyveargv2xmltest_SOURCES = \
	bhyveargv2xmltest.c \
	testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
830
else ! WITH_BHYVE
831 832 833 834 835 836
EXTRA_DIST += \
	bhyvexml2argvtest.c \
	bhyveargv2xmltest.c \
	bhyvexml2xmltest.c \
	bhyvexml2argvmock.c \
	bhyveargv2xmlmock.c
R
Roman Bogorodskiy 已提交
837 838
endif ! WITH_BHYVE

J
Ján Tomko 已提交
839 840 841 842 843
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

844 845 846 847 848
virnetworkportxml2xmltest_SOURCES = \
	virnetworkportxml2xmltest.c \
	testutils.c testutils.h
virnetworkportxml2xmltest_LDADD = $(LDADDS)

849
if WITH_NETWORK
850 851 852 853 854
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)

855 856
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
857
	testutils.c testutils.h
858
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
859 860 861 862 863 864

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

865
else ! WITH_NETWORK
866
EXTRA_DIST += networkxml2xmltest.c networkxml2conftest.c
867
endif !	WITH_NETWORK
868

869 870 871 872
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
873
storagebackendsheepdogtest_LDADD = \
874
	../src/libvirt_storage_backend_sheepdog_priv.la \
875
	../src/libvirt_driver_storage_impl.la \
876
	$(LDADDS)
877
else ! WITH_STORAGE_SHEEPDOG
878
EXTRA_DIST += storagebackendsheepdogtest.c
879
endif ! WITH_STORAGE_SHEEPDOG
880

881 882 883 884
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
885

886 887 888 889 890
virnwfilterbindingxml2xmltest_SOURCES = \
	virnwfilterbindingxml2xmltest.c \
	testutils.c testutils.h
virnwfilterbindingxml2xmltest_LDADD = $(LDADDS)

891 892 893 894 895
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
896 897 898 899 900 901

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

J
Ján Tomko 已提交
904 905 906 907 908
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
909 910 911 912 913
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
914

915
if WITH_STORAGE
916 917 918 919 920 921 922 923 924 925
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

926 927 928 929
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
930
	$(LIBXML_LIBS) \
931
	../src/libvirt_driver_storage_impl.la \
932
	../src/libvirt.la \
933
	$(LDADDS)
J
Ján Tomko 已提交
934

935 936 937 938 939 940
storagepoolxml2argvtest_SOURCES = \
    storagepoolxml2argvtest.c \
    testutils.c testutils.h
storagepoolxml2argvtest_LDADD = \
	$(LIBXML_LIBS) \
	../src/libvirt_driver_storage_impl.la \
941
	../src/libvirt.la \
942 943
	$(LDADDS)

944 945 946 947 948 949 950
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS) \
	../src/libvirt_driver_storage_impl.la \
	$(GNULIB_LIBS)

951 952 953 954
storagepoolcapstest_SOURCES = \
        storagepoolcapstest.c testutils.h testutils.c
storagepoolcapstest_LDADD = $(LDADDS)

955
else ! WITH_STORAGE
956
EXTRA_DIST += storagevolxml2argvtest.c
957
EXTRA_DIST += virstorageutiltest.c
958
EXTRA_DIST += storagepoolxml2argvtest.c
959
EXTRA_DIST += storagepoolxml2xmltest.c
960
EXTRA_DIST += storagepoolcapstest.c
961
endif ! WITH_STORAGE
962

963 964 965 966 967
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
968 969 970
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
971
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
972

973 974 975 976 977
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

978 979 980
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
A
Andrea Bolognani 已提交
981
cputest_LDADD = $(LIBXML_LIBS)
J
Jiri Denemark 已提交
982 983
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
984
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS)
A
Andrea Bolognani 已提交
985 986 987
else ! WITH_QEMU
cputest_LDADD += $(LDADDS)
endif ! WITH_QEMU
988

P
Peter Krempa 已提交
989 990 991 992 993
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

994 995 996 997 998
virerrortest_SOURCES = \
	virerrortest.c \
	testutils.c testutils.h
virerrortest_LDADD = $(LDADDS)

S
Simon Kobyda 已提交
999 1000 1001 1002 1003 1004 1005
vshtabletest_SOURCES = \
	vshtabletest.c \
	testutils.c testutils.h
vshtabletest_LDADD = \
	$(LDADDS) \
	../tools/libvirt_shell.la

1006 1007 1008 1009 1010
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

1011
virconftest_SOURCES = \
1012
	virconftest.c testutils.h testutils.c
1013
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
1014

1015
virhostcputest_SOURCES = \
1016
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1017
virhostcputest_LDADD = $(LDADDS)
1018

1019 1020 1021 1022
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

1023 1024 1025 1026
# 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
1027 1028
commandhelper_SOURCES = \
	commandhelper.c
1029 1030 1031 1032
commandhelper_LDADD = \
	$(NO_INDIRECT_LDFLAGS) \
	$(GNULIB_LIBS)

1033
commandhelper_LDFLAGS = -static
1034

1035

1036 1037 1038 1039
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

1040
vircapstest_SOURCES = \
1041 1042 1043 1044 1045 1046 1047
	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
1048
vircapstest_LDADD =
1049
if WITH_QEMU
1050 1051 1052 1053 1054 1055 1056 1057 1058
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)
1059

1060 1061 1062
libdomaincapsmock_la_SOURCES = domaincapsmock.c
libdomaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libdomaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)
1063

M
Michal Privoznik 已提交
1064
domaincapstest_SOURCES = \
1065 1066 1067
	domaincapstest.c testutils.h testutils.c \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
M
Michal Privoznik 已提交
1068 1069
domaincapstest_LDADD = $(LDADDS)

1070 1071
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
1072
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
1073 1074
endif WITH_QEMU

1075 1076
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
1077
domaincapstest_LDADD += libxltestdriver.la $(GNULIB_LIBS)
1078 1079
endif WITH_LIBXL

1080 1081 1082 1083
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

1084 1085
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1086
virnetmessagetest_LDADD = $(LDADDS)
1087

1088 1089
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1090
virnetsockettest_LDADD = $(LDADDS)
1091

1092 1093
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1094
	testutils.h testutils.c
1095
virnetdaemontest_LDADD = $(LDADDS)
1096

1097
libvirnetdaemonmock_la_SOURCES = \
1098
	virnetdaemonmock.c
1099 1100
libvirnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)
1101

1102 1103 1104 1105 1106
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

1107
libvirnetserverclientmock_la_SOURCES = \
1108
	virnetserverclientmock.c
1109 1110
libvirnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1111

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

1131 1132
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1133
virtimetest_LDADD = $(LDADDS)
1134

J
Ján Tomko 已提交
1135 1136
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1137
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1138

1139 1140 1141 1142
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1143 1144
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1145 1146 1147 1148 1149
virstoragetest_LDADD = $(LDADDS) \
	../src/libvirt.la \
	../src/libvirt_driver_storage_impl.la \
	../gnulib/lib/libgnu.la \
	$(NULL)
1150

1151 1152 1153
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1154
if WITH_SELINUX
1155
viridentitytest_LDADD += $(SELINUX_LIBS)
1156 1157 1158
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1159

J
Ján Tomko 已提交
1160 1161 1162 1163
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1164 1165 1166 1167
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1168 1169 1170 1171
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1172 1173 1174 1175
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1176 1177 1178 1179
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1180
libvirportallocatormock_la_SOURCES = \
1181
	virportallocatormock.c
1182 1183
libvirportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1184

1185 1186 1187 1188
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

1189
libvircgroupmock_la_SOURCES = \
1190
	vircgroupmock.c
1191 1192
libvircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1193

1194 1195 1196 1197
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1198 1199 1200 1201
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1202 1203 1204 1205
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

1206
libvirpcimock_la_SOURCES = \
M
Michal Privoznik 已提交
1207
	virpcimock.c
1208 1209
libvirpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1210

1211
libvirrandommock_la_SOURCES = \
J
John Ferlan 已提交
1212
	virrandommock.c
1213 1214
libvirrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirrandommock_la_LIBADD = $(MOCKLIBS_LIBS)
J
John Ferlan 已提交
1215

1216 1217 1218 1219 1220 1221
libvirprocessmock_la_SOURCES = \
	virprocessmock.c
libvirprocessmock_la_CFLAGS = $(AM_CFLAGS)
libvirprocessmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirprocessmock_la_LIBADD = $(MOCKLIBS_LIBS)

1222
libvirhostcpumock_la_SOURCES = \
1223
	virhostcpumock.c
1224 1225
libvirhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1226

1227
libvirfilecachemock_la_SOURCES = \
P
Pavel Hrdina 已提交
1228
	virfilecachemock.c
1229 1230
libvirfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
1231

1232 1233
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1234
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1235 1236
vircaps2xmltest_LDADD = $(LDADDS)

1237
libvirnumamock_la_SOURCES = \
M
Martin Kletzander 已提交
1238
	virnumamock.c
1239 1240
libvirnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1241

M
Martin Kletzander 已提交
1242 1243 1244 1245
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

1246
libvirfilemock_la_SOURCES = \
1247
	virfilemock.c
1248 1249
libvirfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilemock_la_LIBADD = $(MOCKLIBS_LIBS)
1250
else ! WITH_LINUX
M
Martin Kletzander 已提交
1251
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \
1252
			  virfilewrapper.h virresctrltest.c virfilemock.c
1253
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1254

1255
if WITH_NSS
M
Michal Privoznik 已提交
1256 1257 1258
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
1259
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1260 1261
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
1262
	$(LDADDS) \
M
Michal Privoznik 已提交
1263 1264
	../tools/nss/libnss_libvirt_impl.la

1265 1266 1267
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
1268 1269
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1270 1271
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
1272
	$(LDADDS) \
1273 1274
	../tools/nss/libnss_libvirt_guest_impl.la

1275
libnssmock_la_SOURCES = \
M
Michal Privoznik 已提交
1276
	nssmock.c
1277 1278
libnssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libnssmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1279

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

1289
nssguestlinktest_SOURCES = nsslinktest.c
1290 1291 1292
nssguestlinktest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1293 1294 1295
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1296 1297 1298
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1299

1300
libvirdeterministichashmock_la_SOURCES = \
1301
	virdeterministichashmock.c
1302 1303
libvirdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)
1304

1305
test_libraries += libvirdeterministichashmock.la
1306

1307
if WITH_YAJL
1308 1309 1310 1311
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

1312 1313 1314 1315 1316 1317 1318
virnetdevopenvswitchtest_SOURCES = \
	virnetdevopenvswitchtest.c testutils.h testutils.c
virnetdevopenvswitchtest_LDADD = $(LDADDS)

test_programs += \
	virmacmaptest \
	virnetdevopenvswitchtest
1319
else ! WITH_YAJL
1320 1321 1322
EXTRA_DIST += \
	virmacmaptest.c \
	virnetdevopenvswitchtest.c
1323
endif ! WITH_YAJL
1324

M
Michal Privoznik 已提交
1325 1326 1327 1328 1329
virnetdevtest_SOURCES = \
	virnetdevtest.c testutils.h testutils.c
virnetdevtest_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
virnetdevtest_LDADD = $(LDADDS)

1330
libvirnetdevmock_la_SOURCES = \
M
Michal Privoznik 已提交
1331
	virnetdevmock.c
1332 1333 1334
libvirnetdevmock_la_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
libvirnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1335

1336 1337 1338 1339
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

1340 1341 1342 1343 1344
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1345 1346 1347 1348
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1349 1350 1351
libvirusbmock_la_SOURCES = virusbmock.c
libvirusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1352
	$(PROBES_O) \
1353
	../src/libvirt_util.la
1354

1355
libvirnetdevbandwidthmock_la_SOURCES = \
1356
	virnetdevbandwidthmock.c
1357 1358
libvirnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1359

1360
libvirtestmock_la_SOURCES = \
1361
	virtestmock.c
1362 1363
libvirtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirtestmock_la_LIBADD = \
1364
	$(MOCKLIBS_LIBS) \
1365
	$(PROBES_O) \
1366
	../src/libvirt_util.la
1367
else ! WITH_LINUX
1368
	EXTRA_DIST += virusbtest.c virusbmock.c \
1369 1370
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1371 1372
endif ! WITH_LINUX

1373 1374 1375 1376
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1377
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1378

1379
libvirdbusmock_la_SOURCES = \
1380
	virdbusmock.c
1381 1382 1383
libvirdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
libvirdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1384

1385 1386 1387 1388 1389
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1390 1391
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1392
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1393
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1394

1395
else ! WITH_DBUS
1396
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1397
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1398

1399 1400
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1401
viruritest_LDADD = $(LDADDS)
1402

1403 1404
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1405
virkeyfiletest_LDADD = $(LDADDS)
1406

1407 1408 1409 1410
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1411 1412
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1413
virauthconfigtest_LDADD = $(LDADDS)
1414

1415
seclabeltest_SOURCES = \
1416
	seclabeltest.c testutils.h testutils.c
1417
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1418

1419
if WITH_SECDRIVER_SELINUX
1420
if WITH_ATTR
1421 1422
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1423
else ! WITH_TESTS
1424
check_LTLIBRARIES += libsecurityselinuxhelper.la
1425
endif ! WITH_TESTS
1426 1427 1428

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1429
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1430 1431 1432

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1433
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1434 1435
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1436 1437 1438 1439 1440

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1441
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
1442 1443
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1444 1445 1446
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1447 1448
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1449

1450 1451 1452 1453
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1454 1455 1456
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1457

H
Hu Tao 已提交
1458 1459 1460 1461
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1462 1463 1464 1465
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1466 1467 1468 1469
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1470 1471 1472 1473
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1474 1475
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1476
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1477 1478
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1479 1480 1481
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1482

M
Matthias Bolte 已提交
1483 1484 1485 1486
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1487
if WITH_LIBVIRTD
1488 1489 1490
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1491 1492 1493 1494

virdriverconnvalidatetest_SOURCES = \
	virdriverconnvalidatetest.c testutils.h testutils.c
virdriverconnvalidatetest_LDADD = $(LDADDS)
1495
endif WITH_LIBVIRTD
1496

1497 1498
if WITH_LIBVIRTD
eventtest_SOURCES = \
1499
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1500
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1501
endif WITH_LIBVIRTD
1502

1503 1504
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1505
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1506 1507 1508

shunloadtest_SOURCES = \
	shunloadtest.c
1509
shunloadtest_LDADD = $(THREAD_LIBS) $(DLOPEN_LIBS)
1510 1511
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1512 1513 1514 1515
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1516 1517 1518 1519
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1520 1521 1522 1523
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1524 1525 1526 1527 1528
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1529 1530 1531 1532 1533
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1534
if WITH_LINUX
O
Osier Yang 已提交
1535 1536 1537 1538
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1539 1540 1541 1542
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1543 1544
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1545
EXTRA_DIST += scsihosttest.c
1546 1547
endif  ! WITH_LINUX

O
Osier Yang 已提交
1548 1549 1550 1551 1552 1553 1554 1555 1556
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

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