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

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

19 20
SHELL = $(PREFERABLY_POSIX_SHELL)

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

31 32
WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)

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

50 51 52
AM_LDFLAGS = \
	-export-dynamic

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

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

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

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

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

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

85
EXTRA_DIST = \
86
	.valgrind.supp \
R
Roman Bogorodskiy 已提交
87
	bhyvexml2argvdata \
88
	bhyveargv2xmldata \
89
	bhyvexml2xmloutdata \
90
	capabilityschemadata \
E
Eric Blake 已提交
91 92
	commanddata \
	cputestdata \
93
	domaincapsdata \
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 \
E
Eric Blake 已提交
182
	viratomictest \
183
	utiltest shunloadtest \
184
	virtimetest viruritest virkeyfiletest \
185
	viralloctest \
H
Hu Tao 已提交
186
	virauthconfigtest \
187 188
	virbitmaptest \
	vircgrouptest \
189
	vircryptotest \
M
Michal Privoznik 已提交
190
	virpcitest \
191
	virendiantest \
192
	virfiletest \
P
Pavel Hrdina 已提交
193
	virfilecachetest \
194
	virfirewalltest \
J
Ján Tomko 已提交
195
	viriscsitest \
196
	virkeycodetest \
197
	virlockspacetest \
198
	virlogtest \
199
	virrotatingfiletest \
J
Ján Tomko 已提交
200
	virschematest \
201
	virstringtest \
202
	virportallocatortest \
V
Viktor Mihajlovski 已提交
203
	sysinfotest \
204
	virkmodtest \
205
	vircapstest \
M
Michal Privoznik 已提交
206
	domaincapstest \
207
	domainconftest \
208
	virhostdevtest \
M
Michal Privoznik 已提交
209
	virnetdevtest \
210
	virtypedparamtest \
S
Simon Kobyda 已提交
211
	vshtabletest \
212
	virerrortest \
213
	$(NULL)
214

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

361
test_programs += nwfilterxml2xmltest
362
test_programs += virnwfilterbindingxml2xmltest
363

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

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

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

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

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

391
test_programs += storagevolxml2xmltest
392

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

395
test_programs += interfacexml2xmltest
396

397
test_programs += cputest
398

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

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

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

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

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

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

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

443 444
test_programs += objecteventtest

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

452 453
EXTRA_DIST += $(test_scripts)

454 455 456 457 458 459 460 461 462 463 464 465 466
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

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 487
  SHELL="$(SHELL)" \
  LIBVIRT_AUTOSTART=0 \
  LC_ALL=C \
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \
488 489
  $(VG)

490

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

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

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

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

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

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

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

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

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

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

544
if WITH_QEMU
545

546 547
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

727 728
if WITH_LXC

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

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
737
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
738 739

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

J
Ján Tomko 已提交
915

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

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

937 938 939 940 941 942 943 944 945 946
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)

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

954 955 956 957
storagepoolcapstest_SOURCES = \
        storagepoolcapstest.c testutils.h testutils.c
storagepoolcapstest_LDADD = $(LDADDS)

958
else ! WITH_STORAGE
959
EXTRA_DIST += storagevolxml2argvtest.c
960
EXTRA_DIST += virstorageutiltest.c
961
EXTRA_DIST += storagepoolxml2argvtest.c
962
EXTRA_DIST += storagepoolxml2xmltest.c
963
EXTRA_DIST += storagepoolcapstest.c
964
endif ! WITH_STORAGE
965

966 967 968 969 970
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
971 972 973
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
974
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
975

976 977 978 979 980
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

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

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

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

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

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

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

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

1022 1023 1024 1025
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

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

1036
commandhelper_LDFLAGS = -static
1037

1038

1039 1040 1041 1042
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

1043
vircapstest_SOURCES = \
1044 1045 1046 1047 1048 1049 1050
	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
1051
if WITH_QEMU
1052
vircapstest_LDADD = $(qemu_LDADDS)
1053 1054 1055
else ! WITH_QEMU
vircapstest_LDADD = $(LDADDS)
endif ! WITH_QEMU
1056

1057 1058 1059
libdomaincapsmock_la_SOURCES = domaincapsmock.c
libdomaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libdomaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)
1060

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

1067 1068
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
1069
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
1070 1071
endif WITH_QEMU

1072 1073
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
1074
domaincapstest_LDADD += libxltestdriver.la $(GNULIB_LIBS)
1075 1076
endif WITH_LIBXL

1077 1078 1079 1080
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

1081 1082
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1083
virnetmessagetest_LDADD = $(LDADDS)
1084

1085 1086
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1087
virnetsockettest_LDADD = $(LDADDS)
1088

1089 1090
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1091
	testutils.h testutils.c
1092
virnetdaemontest_LDADD = $(LDADDS)
1093

1094
libvirnetdaemonmock_la_SOURCES = \
1095
	virnetdaemonmock.c
1096 1097
libvirnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)
1098

1099 1100 1101 1102 1103
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

1104
libvirnetserverclientmock_la_SOURCES = \
1105
	virnetserverclientmock.c
1106 1107
libvirnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libvirnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1108

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

1128 1129
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1130
virtimetest_LDADD = $(LDADDS)
1131

J
Ján Tomko 已提交
1132 1133
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1134
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1135

1136 1137 1138 1139
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1140 1141
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1142 1143 1144 1145 1146 1147 1148
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)
1149

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1304
test_libraries += libvirdeterministichashmock.la
1305

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1457
viratomictest_SOURCES = \
L
Laine Stump 已提交
1458
	viratomictest.c testutils.h testutils.c
1459 1460
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1461 1462 1463 1464
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1465 1466 1467 1468
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1469 1470 1471 1472
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1473 1474 1475 1476
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1477 1478
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1479
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1480 1481
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1482 1483 1484
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1485

M
Matthias Bolte 已提交
1486 1487 1488 1489
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1490
if WITH_LIBVIRTD
1491 1492 1493
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1494 1495 1496 1497

virdriverconnvalidatetest_SOURCES = \
	virdriverconnvalidatetest.c testutils.h testutils.c
virdriverconnvalidatetest_LDADD = $(LDADDS)
1498
endif WITH_LIBVIRTD
1499

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

1506 1507
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1508
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1509 1510 1511

shunloadtest_SOURCES = \
	shunloadtest.c
1512
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1513 1514
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1515 1516 1517 1518
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1519 1520 1521 1522
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1523 1524 1525 1526
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1527 1528 1529 1530 1531
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1532 1533 1534 1535 1536
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1537
if WITH_LINUX
O
Osier Yang 已提交
1538 1539 1540 1541
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1542 1543 1544 1545
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1546 1547
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1548
EXTRA_DIST += scsihosttest.c
1549 1550
endif  ! WITH_LINUX

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

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

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