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

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

19 20
SHELL = $(PREFERABLY_POSIX_SHELL)

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

30 31
WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)

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

48 49 50
AM_LDFLAGS = \
	-export-dynamic

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

306
if WITH_LXC
307
test_programs += lxcxml2xmltest lxcconf2xmltest
308
endif WITH_LXC
309

310
if WITH_OPENVZ
311
test_programs += openvzutilstest
312
endif WITH_OPENVZ
313

314
if WITH_ESX
315
test_programs += esxutilstest
316
endif WITH_ESX
317

Y
Yohan BELLEGUIC 已提交
318 319 320 321
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

322
if WITH_VMX
323
test_programs += vmx2xmltest xml2vmxtest
324
endif WITH_VMX
325

326 327 328 329
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

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

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

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

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

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

356
test_programs += nwfilterxml2xmltest
357
test_programs += virnwfilterbindingxml2xmltest
358

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

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

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

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

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

386
test_programs += storagevolxml2xmltest
387

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

390
test_programs += interfacexml2xmltest
391

392
test_programs += cputest
393

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

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

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

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

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

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

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

437 438
test_programs += objecteventtest

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

446 447
EXTRA_DIST += $(test_scripts)

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

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

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

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

484

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

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

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

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

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

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

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

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

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

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

539
if WITH_QEMU
540

541 542
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

693 694 695 696 697 698 699
qemuvhostusertest_SOURCES = \
	qemuvhostusertest.c \
	testutils.h testutils.c \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
qemuvhostusertest_LDADD = $(qemu_LDADDS)

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

718 719
if WITH_LXC

E
Eric Blake 已提交
720
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
721
if WITH_NETWORK
E
Eric Blake 已提交
722
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
723
endif WITH_NETWORK
724
lxc_LDADDS += $(LDADDS)
725 726 727 728

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
729
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
730 731

lxcconf2xmltest_SOURCES = \
732
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
733 734
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
735
else ! WITH_LXC
736
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
737
endif ! WITH_LXC
738

739 740 741 742
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
743
openvzutilstest_LDADD = $(LDADDS)
744
else ! WITH_OPENVZ
745
EXTRA_DIST += openvzutilstest.c
746
endif ! WITH_OPENVZ
747 748
EXTRA_DIST += openvzutilstest.conf

749 750 751 752
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
753
esxutilstest_LDADD = $(LDADDS)
754
else ! WITH_ESX
755
EXTRA_DIST += esxutilstest.c
756
endif ! WITH_ESX
757

Y
Yohan BELLEGUIC 已提交
758 759 760 761 762 763 764 765 766 767
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

768
if WITH_VMX
769 770 771
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
772
vmx2xmltest_LDADD = $(LDADDS)
773 774 775 776

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
777
xml2vmxtest_LDADD = $(LDADDS)
778
else ! WITH_VMX
779
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
780
endif ! WITH_VMX
781

782 783 784 785 786 787 788 789 790
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 已提交
791
if WITH_BHYVE
792
libbhyvexml2argvmock_la_SOURCES = \
R
Roman Bogorodskiy 已提交
793
	bhyvexml2argvmock.c
794 795
libbhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libbhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
796

797
libbhyveargv2xmlmock_la_SOURCES = \
798
	bhyveargv2xmlmock.c
799 800
libbhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libbhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
801

R
Roman Bogorodskiy 已提交
802
bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
R
Roman Bogorodskiy 已提交
803 804 805
if WITH_STORAGE
bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
R
Roman Bogorodskiy 已提交
806 807 808 809 810
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
811 812 813 814 815

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
816 817 818 819 820

bhyveargv2xmltest_SOURCES = \
	bhyveargv2xmltest.c \
	testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
821
else ! WITH_BHYVE
822 823 824 825 826 827
EXTRA_DIST += \
	bhyvexml2argvtest.c \
	bhyveargv2xmltest.c \
	bhyvexml2xmltest.c \
	bhyvexml2argvmock.c \
	bhyveargv2xmlmock.c
R
Roman Bogorodskiy 已提交
828 829
endif ! WITH_BHYVE

J
Ján Tomko 已提交
830 831 832 833 834
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

835 836 837 838 839
virnetworkportxml2xmltest_SOURCES = \
	virnetworkportxml2xmltest.c \
	testutils.c testutils.h
virnetworkportxml2xmltest_LDADD = $(LDADDS)

840
if WITH_NETWORK
841 842 843 844 845
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)

846 847
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
848
	testutils.c testutils.h
849
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
850 851 852 853 854 855

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

856
else ! WITH_NETWORK
857
EXTRA_DIST += networkxml2xmltest.c networkxml2conftest.c
858
endif !	WITH_NETWORK
859

860 861 862 863
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
864
storagebackendsheepdogtest_LDADD = \
865
	../src/libvirt_storage_backend_sheepdog_priv.la \
866
	../src/libvirt_driver_storage_impl.la \
867
	$(LDADDS)
868
else ! WITH_STORAGE_SHEEPDOG
869
EXTRA_DIST += storagebackendsheepdogtest.c
870
endif ! WITH_STORAGE_SHEEPDOG
871

872 873 874 875
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
876

877 878 879 880 881
virnwfilterbindingxml2xmltest_SOURCES = \
	virnwfilterbindingxml2xmltest.c \
	testutils.c testutils.h
virnwfilterbindingxml2xmltest_LDADD = $(LDADDS)

882 883 884 885 886
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
887 888 889 890 891 892

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

J
Ján Tomko 已提交
895 896 897 898 899
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
900 901 902 903 904
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
905

906
if WITH_STORAGE
907 908 909 910 911 912 913 914 915 916
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

917 918 919 920
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
921
	$(LIBXML_LIBS) \
922 923 924 925
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(LDADDS)
J
Ján Tomko 已提交
926

927 928 929 930 931 932 933 934 935 936
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)

937 938 939 940 941 942 943
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS) \
	../src/libvirt_driver_storage_impl.la \
	$(GNULIB_LIBS)

944 945 946 947
storagepoolcapstest_SOURCES = \
        storagepoolcapstest.c testutils.h testutils.c
storagepoolcapstest_LDADD = $(LDADDS)

948
else ! WITH_STORAGE
949
EXTRA_DIST += storagevolxml2argvtest.c
950
EXTRA_DIST += virstorageutiltest.c
951
EXTRA_DIST += storagepoolxml2argvtest.c
952
EXTRA_DIST += storagepoolxml2xmltest.c
953
EXTRA_DIST += storagepoolcapstest.c
954
endif ! WITH_STORAGE
955

956 957 958 959 960
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
961 962 963
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
964
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
965

966 967 968 969 970
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

971 972 973
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
A
Andrea Bolognani 已提交
974
cputest_LDADD = $(LIBXML_LIBS)
J
Jiri Denemark 已提交
975 976
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
977
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS)
A
Andrea Bolognani 已提交
978 979 980
else ! WITH_QEMU
cputest_LDADD += $(LDADDS)
endif ! WITH_QEMU
981

P
Peter Krempa 已提交
982 983 984 985 986
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

987 988 989 990 991
virerrortest_SOURCES = \
	virerrortest.c \
	testutils.c testutils.h
virerrortest_LDADD = $(LDADDS)

S
Simon Kobyda 已提交
992 993 994 995 996 997 998
vshtabletest_SOURCES = \
	vshtabletest.c \
	testutils.c testutils.h
vshtabletest_LDADD = \
	$(LDADDS) \
	../tools/libvirt_shell.la

999 1000 1001 1002 1003
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

1004
virconftest_SOURCES = \
1005
	virconftest.c testutils.h testutils.c
1006
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
1007

1008
virhostcputest_SOURCES = \
1009
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1010
virhostcputest_LDADD = $(LDADDS)
1011

1012 1013 1014 1015
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

1016 1017 1018 1019
# 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
1020 1021
commandhelper_SOURCES = \
	commandhelper.c
1022 1023 1024 1025
commandhelper_LDADD = \
	$(NO_INDIRECT_LDFLAGS) \
	$(GNULIB_LIBS)

1026
commandhelper_LDFLAGS = -static
1027

1028

1029 1030 1031 1032
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

1033
vircapstest_SOURCES = \
1034 1035 1036 1037 1038 1039 1040
	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
1041
if WITH_QEMU
1042
vircapstest_LDADD = $(qemu_LDADDS)
1043 1044 1045
else ! WITH_QEMU
vircapstest_LDADD = $(LDADDS)
endif ! WITH_QEMU
1046

1047 1048 1049
libdomaincapsmock_la_SOURCES = domaincapsmock.c
libdomaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libdomaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)
1050

M
Michal Privoznik 已提交
1051
domaincapstest_SOURCES = \
1052 1053 1054
	domaincapstest.c testutils.h testutils.c \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
M
Michal Privoznik 已提交
1055 1056
domaincapstest_LDADD = $(LDADDS)

1057 1058
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
1059
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
1060 1061
endif WITH_QEMU

1062 1063
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
1064
domaincapstest_LDADD += libxltestdriver.la $(GNULIB_LIBS)
1065 1066
endif WITH_LIBXL

1067 1068 1069 1070
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

1071 1072
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1073
virnetmessagetest_LDADD = $(LDADDS)
1074

1075 1076
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1077
virnetsockettest_LDADD = $(LDADDS)
1078

1079 1080
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1081
	testutils.h testutils.c
1082
virnetdaemontest_LDADD = $(LDADDS)
1083

1084
libvirnetdaemonmock_la_SOURCES = \
1085
	virnetdaemonmock.c
1086 1087
libvirnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)
1088

1089 1090 1091 1092 1093
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

1094
libvirnetserverclientmock_la_SOURCES = \
1095
	virnetserverclientmock.c
1096 1097
libvirnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1098

1099
virnettlscontexttest_SOURCES = \
1100 1101 1102
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1103
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
1104 1105 1106 1107
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1108
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
1109 1110 1111
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
1112 1113
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
1114
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
1115
EXTRA_DIST += pkix_asn1_tab.c
1116
endif ! HAVE_LIBTASN1
1117

1118 1119
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1120
virtimetest_LDADD = $(LDADDS)
1121

J
Ján Tomko 已提交
1122 1123
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1124
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1125

1126 1127 1128 1129
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1130 1131
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1132 1133 1134 1135 1136 1137 1138
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)
1139

1140 1141 1142
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1143
if WITH_SELINUX
1144
viridentitytest_LDADD += $(SELINUX_LIBS)
1145 1146 1147
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1148

J
Ján Tomko 已提交
1149 1150 1151 1152
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1153 1154 1155 1156
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1157 1158 1159 1160
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1161 1162 1163 1164
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1165 1166 1167 1168
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1169
libvirportallocatormock_la_SOURCES = \
1170
	virportallocatormock.c
1171 1172
libvirportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1173

1174 1175 1176 1177
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

1178
libvircgroupmock_la_SOURCES = \
1179
	vircgroupmock.c
1180 1181
libvircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1182

1183 1184 1185 1186
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1187 1188 1189 1190
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1191 1192 1193 1194
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

1195
libvirpcimock_la_SOURCES = \
M
Michal Privoznik 已提交
1196
	virpcimock.c
1197 1198
libvirpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1199

1200
libvirrandommock_la_SOURCES = \
J
John Ferlan 已提交
1201
	virrandommock.c
1202 1203
libvirrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirrandommock_la_LIBADD = $(MOCKLIBS_LIBS)
J
John Ferlan 已提交
1204

1205 1206 1207 1208 1209 1210
libvirprocessmock_la_SOURCES = \
	virprocessmock.c
libvirprocessmock_la_CFLAGS = $(AM_CFLAGS)
libvirprocessmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirprocessmock_la_LIBADD = $(MOCKLIBS_LIBS)

1211
libvirhostcpumock_la_SOURCES = \
1212
	virhostcpumock.c
1213 1214
libvirhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1215

1216
libvirfilecachemock_la_SOURCES = \
P
Pavel Hrdina 已提交
1217
	virfilecachemock.c
1218 1219
libvirfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
1220

1221 1222
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1223
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1224 1225
vircaps2xmltest_LDADD = $(LDADDS)

1226
libvirnumamock_la_SOURCES = \
M
Martin Kletzander 已提交
1227
	virnumamock.c
1228 1229
libvirnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1230

M
Martin Kletzander 已提交
1231 1232 1233 1234
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

1235
libvirfilemock_la_SOURCES = \
1236
	virfilemock.c
1237 1238
libvirfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirfilemock_la_LIBADD = $(MOCKLIBS_LIBS)
1239
else ! WITH_LINUX
M
Martin Kletzander 已提交
1240
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \
1241
			  virfilewrapper.h virresctrltest.c virfilemock.c
1242
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1243

1244
if WITH_NSS
M
Michal Privoznik 已提交
1245 1246 1247
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
1248
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1249 1250
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
1251
	$(LDADDS) \
M
Michal Privoznik 已提交
1252 1253
	../tools/nss/libnss_libvirt_impl.la

1254 1255 1256
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
1257 1258
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1259 1260
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
1261
	$(LDADDS) \
1262 1263
	../tools/nss/libnss_libvirt_guest_impl.la

1264
libnssmock_la_SOURCES = \
M
Michal Privoznik 已提交
1265
	nssmock.c
1266 1267
libnssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libnssmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1268

M
Michal Privoznik 已提交
1269 1270 1271
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
1272 1273
nsslinktest_CFLAGS = \
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1274 1275 1276 1277
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

1278
nssguestlinktest_SOURCES = nsslinktest.c
1279 1280 1281
nssguestlinktest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1282 1283 1284
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1285 1286 1287
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1288

1289
libvirdeterministichashmock_la_SOURCES = \
1290
	virdeterministichashmock.c
1291 1292
libvirdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)
1293

1294
test_libraries += libvirdeterministichashmock.la
1295

1296
if WITH_YAJL
1297 1298 1299 1300
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

1301 1302 1303 1304 1305 1306 1307
virnetdevopenvswitchtest_SOURCES = \
	virnetdevopenvswitchtest.c testutils.h testutils.c
virnetdevopenvswitchtest_LDADD = $(LDADDS)

test_programs += \
	virmacmaptest \
	virnetdevopenvswitchtest
1308
else ! WITH_YAJL
1309 1310 1311
EXTRA_DIST += \
	virmacmaptest.c \
	virnetdevopenvswitchtest.c
1312
endif ! WITH_YAJL
1313

M
Michal Privoznik 已提交
1314 1315 1316 1317 1318
virnetdevtest_SOURCES = \
	virnetdevtest.c testutils.h testutils.c
virnetdevtest_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
virnetdevtest_LDADD = $(LDADDS)

1319
libvirnetdevmock_la_SOURCES = \
M
Michal Privoznik 已提交
1320
	virnetdevmock.c
1321 1322 1323
libvirnetdevmock_la_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
libvirnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1324

1325 1326 1327 1328
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

1329 1330 1331 1332 1333
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1334 1335 1336 1337
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1338 1339 1340
libvirusbmock_la_SOURCES = virusbmock.c
libvirusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1341
	$(PROBES_O) \
1342
	../src/libvirt_util.la
1343

1344
libvirnetdevbandwidthmock_la_SOURCES = \
1345
	virnetdevbandwidthmock.c
1346 1347
libvirnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1348

1349
libvirtestmock_la_SOURCES = \
1350
	virtestmock.c
1351 1352
libvirtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirtestmock_la_LIBADD = \
1353
	$(MOCKLIBS_LIBS) \
1354
	$(PROBES_O) \
1355
	../src/libvirt_util.la
1356
else ! WITH_LINUX
1357
	EXTRA_DIST += virusbtest.c virusbmock.c \
1358 1359
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1360 1361
endif ! WITH_LINUX

1362 1363 1364 1365
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1366
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1367

1368
libvirdbusmock_la_SOURCES = \
1369
	virdbusmock.c
1370 1371 1372
libvirdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
libvirdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1373

1374 1375 1376 1377 1378
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1379 1380
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1381
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1382
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1383

1384
else ! WITH_DBUS
1385
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1386
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1387

1388 1389
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1390
viruritest_LDADD = $(LDADDS)
1391

1392 1393
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1394
virkeyfiletest_LDADD = $(LDADDS)
1395

1396 1397 1398 1399
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1400 1401
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1402
virauthconfigtest_LDADD = $(LDADDS)
1403

1404
seclabeltest_SOURCES = \
1405
	seclabeltest.c testutils.h testutils.c
1406
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1407

1408
if WITH_SECDRIVER_SELINUX
1409
if WITH_ATTR
1410 1411
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1412
else ! WITH_TESTS
1413
check_LTLIBRARIES += libsecurityselinuxhelper.la
1414
endif ! WITH_TESTS
1415 1416 1417

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1418
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1419 1420 1421

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1422
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1423 1424
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1425 1426 1427 1428 1429

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1430
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
1431 1432
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1433 1434 1435
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1436 1437
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1438

1439 1440 1441 1442
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1443 1444 1445
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1446

1447
viratomictest_SOURCES = \
L
Laine Stump 已提交
1448
	viratomictest.c testutils.h testutils.c
1449 1450
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1451 1452 1453 1454
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1455 1456 1457 1458
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1459 1460 1461 1462
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1463 1464 1465 1466
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1467 1468
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1469
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1470 1471
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1472 1473 1474
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1475

M
Matthias Bolte 已提交
1476 1477 1478 1479
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1480
if WITH_LIBVIRTD
1481 1482 1483
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1484
endif WITH_LIBVIRTD
1485

1486 1487
if WITH_LIBVIRTD
eventtest_SOURCES = \
1488
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1489
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1490
endif WITH_LIBVIRTD
1491

1492 1493
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1494
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1495 1496 1497

shunloadtest_SOURCES = \
	shunloadtest.c
1498
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1499 1500
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1501 1502 1503 1504
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1505 1506 1507 1508
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1509 1510 1511 1512
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1513 1514 1515 1516 1517
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1518 1519 1520 1521 1522
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1523
if WITH_LINUX
O
Osier Yang 已提交
1524 1525 1526 1527
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1528 1529 1530 1531
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1532 1533
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1534
EXTRA_DIST += scsihosttest.c
1535 1536
endif  ! WITH_LINUX

O
Osier Yang 已提交
1537 1538 1539 1540 1541 1542 1543 1544 1545
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

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