Makefile.am 38.1 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
	$(XDR_CFLAGS) \
E
Eric Blake 已提交
45
	$(WARN_CFLAGS)
46

47 48 49
AM_LDFLAGS = \
	-export-dynamic

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

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

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

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

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

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

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

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

207 208 209 210 211 212 213 214 215 216
test_libraries = libshunload.la \
	virportallocatormock.la \
	virnetdaemonmock.la \
	virnetserverclientmock.la \
	vircgroupmock.la \
	virpcimock.la \
	virnetdevmock.la \
	virrandommock.la \
	virhostcpumock.la \
	domaincapsmock.la \
P
Pavel Hrdina 已提交
217
	virfilecachemock.la \
218 219
	$(NULL)

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

231 232
if WITH_LINUX
test_programs += fchosttest
233
test_programs += scsihosttest
234
test_programs += vircaps2xmltest
M
Martin Kletzander 已提交
235
test_programs += virresctrltest
236 237
test_libraries += virusbmock.la \
	virnetdevbandwidthmock.la \
238
	virnumamock.la \
239
	virtestmock.la \
240
	virfilemock.la \
241
	$(NULL)
242 243
endif WITH_LINUX

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

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

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

268 269
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
270

271
if WITH_LIBXL
272
test_programs += xlconfigtest xml2sexprtest sexpr2xmltest \
273
	xmconfigtest libxlxml2domconfigtest
274
test_libraries += libxltestdriver.la libxlmock.la
275 276
endif WITH_LIBXL

277
if WITH_QEMU
278
test_programs += qemuxml2argvtest qemuxml2xmltest \
J
Ján Tomko 已提交
279
	qemuargv2xmltest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
280
	qemumonitorjsontest qemuhotplugtest \
281
	qemuagenttest qemucapabilitiestest qemucaps2xmltest \
282
	qemumemlocktest \
283 284
	qemucommandutiltest \
	qemublocktest \
285
	qemumigparamstest \
286
	qemusecuritytest \
287
	qemufirmwaretest \
288
	$(NULL)
J
Jiri Denemark 已提交
289
test_helpers += qemucapsprobe
290 291 292 293 294
test_libraries += libqemumonitortestutils.la \
		libqemutestdriver.la \
		qemuxml2argvmock.la \
		qemucaps2xmlmock.la \
		qemucapsprobemock.la \
295
		qemucpumock.la \
296
		$(NULL)
297
endif WITH_QEMU
298

299
if WITH_LXC
300
test_programs += lxcxml2xmltest lxcconf2xmltest
301
endif WITH_LXC
302

303
if WITH_OPENVZ
304
test_programs += openvzutilstest
305
endif WITH_OPENVZ
306

307
if WITH_ESX
308
test_programs += esxutilstest
309
endif WITH_ESX
310

Y
Yohan BELLEGUIC 已提交
311 312 313 314
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

315
if WITH_VMX
316
test_programs += vmx2xmltest xml2vmxtest
317
endif WITH_VMX
318

319 320 321 322
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
323
if WITH_BHYVE
324
test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest
325
test_libraries += bhyvexml2argvmock.la bhyveargv2xmlmock.la
R
Roman Bogorodskiy 已提交
326 327
endif WITH_BHYVE

328
if WITH_CIL
329
test_programs += objectlocking
330
endif WITH_CIL
331

332
if WITH_YAJL
333
test_programs += virjsontest
334
endif WITH_YAJL
335

336 337 338
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
339
		virnetworkportxml2xmltest \
340
		$(NULL)
341

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

349 350
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
351
endif WITH_STORAGE_SHEEPDOG
352

353
test_programs += nwfilterxml2xmltest
354
test_programs += virnwfilterbindingxml2xmltest
355

356 357
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
358
test_programs += nwfilterxml2firewalltest
359 360
endif WITH_NWFILTER

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

369 370
if WITH_STORAGE_FS
test_programs += virstoragetest
371
endif WITH_STORAGE_FS
372

O
Osier Yang 已提交
373 374 375 376
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

377
if WITH_NSS
378 379
test_helpers += nsslinktest nssguestlinktest
test_programs += nsstest nssguesttest
380
test_libraries += nssmock.la
381 382
endif WITH_NSS

383
test_programs += storagevolxml2xmltest
384

385
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
386

387
test_programs += interfacexml2xmltest
388

389
test_programs += cputest
390

P
Peter Krempa 已提交
391 392
test_programs += metadatatest

J
Ján Tomko 已提交
393 394
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
395 396
test_programs += genericxml2xmltest

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

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

423 424 425
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

426
test_programs += \
427 428
	eventtest \
	virdrivermoduletest
429
else ! WITH_LIBVIRTD
430
EXTRA_DIST += $(libvirtd_test_scripts)
431
endif ! WITH_LIBVIRTD
432

433 434
test_programs += objecteventtest

J
Jamie Strandboge 已提交
435
if WITH_SECDRIVER_APPARMOR
436
if WITH_LIBVIRTD
J
Jamie Strandboge 已提交
437
test_scripts += virt-aa-helper-test
438 439
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
440 441
EXTRA_DIST += virt-aa-helper-test

442 443
EXTRA_DIST += $(test_scripts)

444 445 446 447 448 449 450 451 452 453 454 455 456
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

457 458
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
459
noinst_LTLIBRARIES = $(test_libraries)
460
else ! WITH_TESTS
461
check_PROGRAMS = $(test_programs) $(test_helpers)
462
check_LTLIBRARIES = $(test_libraries)
463
endif ! WITH_TESTS
464

465 466
TESTS = $(test_programs) \
	$(test_scripts)
467

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

480

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

487 488 489
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
490
sockettest_LDADD = $(LDADDS)
491

492 493
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
494 495 496
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
497 498
libxl_LDADDS += $(LDADDS)

499 500 501 502
libxltestdriver_la_SOURCES =
libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
libxltestdriver_la_LIBADD = $(libxl_LDADDS)

503 504 505 506
xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
507

508 509 510 511 512
xml2sexprtest_SOURCES = \
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xml2sexprtest_LDADD = $(libxl_LDADDS)

513 514 515 516 517
sexpr2xmltest_SOURCES = \
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
sexpr2xmltest_LDADD = $(libxl_LDADDS)

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

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

528 529 530 531 532
libxlmock_la_SOURCES = \
	libxlmock.c
libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS)
libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libxlmock_la_LIBADD = $(MOCKLIBS_LIBS)
533

534
else ! WITH_LIBXL
535
EXTRA_DIST += xlconfigtest.c xml2sexprtest.c sexpr2xmltest.c \
536
	xmconfigtest.c libxlxml2domconfigtest.c
537 538
endif ! WITH_LIBXL

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

545
if WITH_QEMU
546

547 548
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

549
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
550
if WITH_NETWORK
E
Eric Blake 已提交
551
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
552
endif WITH_NETWORK
553 554 555
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
556
if WITH_DTRACE_PROBES
557
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
558
endif WITH_DTRACE_PROBES
559
qemu_LDADDS += $(LDADDS)
560

561
libqemutestdriver_la_SOURCES =
562
libqemutestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
563
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)
564

565
qemucpumock_la_SOURCES = \
566
	qemucpumock.c testutilshostcpus.h
567 568 569
qemucpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
qemucpumock_la_LIBADD = $(MOCKLIBS_LIBS)

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

578 579
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
580
qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
581
qemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
582

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

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
591 592
qemuargv2xmltest_LDADD = libqemutestdriver.la \
	$(LDADDS)
593

594 595 596 597 598
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
599
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
600
	$(qemu_LDADDS)
601

602 603 604 605 606
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
607
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
608
	$(qemu_LDADDS)
609

J
Jiri Denemark 已提交
610 611 612 613 614 615 616 617 618 619
qemucapsprobe_SOURCES = \
	qemucapsprobe.c
qemucapsprobe_LDADD = \
	libqemutestdriver.la $(LDADDS)

qemucapsprobemock_la_SOURCES = \
	qemucapsprobemock.c
qemucapsprobemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
qemucapsprobemock_la_LIBADD = $(MOCKLIBS_LIBS)

620 621 622 623 624 625
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
626
	$(qemu_LDADDS)
627

628 629 630
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
631
	testutilsqemu.c testutilsqemu.h \
632
	$(NULL)
633
qemucaps2xmltest_LDADD = $(qemu_LDADDS)
634

P
Pavel Hrdina 已提交
635 636
qemucaps2xmlmock_la_SOURCES = \
	qemucaps2xmlmock.c
637
qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
638
qemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
639

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

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

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

666 667 668
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
669
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
670 671 672 673 674

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

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

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

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

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

716 717
if WITH_LXC

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

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
727
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
728 729

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

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

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

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

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

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

780 781 782 783 784 785 786 787 788
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 已提交
789 790 791
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
792
bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
793
bhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
794

795 796 797 798 799
bhyveargv2xmlmock_la_SOURCES = \
	bhyveargv2xmlmock.c
bhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
bhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)

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

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

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

828 829 830 831 832
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
833 834 835 836 837
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

838 839 840 841 842
virnetworkportxml2xmltest_SOURCES = \
	virnetworkportxml2xmltest.c \
	testutils.c testutils.h
virnetworkportxml2xmltest_LDADD = $(LDADDS)

843
if WITH_NETWORK
844 845
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
846
	testutils.c testutils.h
847
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
848 849 850 851 852 853

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

854
else ! WITH_NETWORK
855
EXTRA_DIST += networkxml2conftest.c
856
endif !	WITH_NETWORK
857

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

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

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

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

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

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

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

J
Ján Tomko 已提交
903

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

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

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

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

942 943 944 945
storagepoolcapstest_SOURCES = \
        storagepoolcapstest.c testutils.h testutils.c
storagepoolcapstest_LDADD = $(LDADDS)

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

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

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

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

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

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

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

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

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

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

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

1010 1011 1012 1013
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

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

1024
commandhelper_LDFLAGS = -static
1025

1026

1027 1028 1029 1030
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

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

1045 1046 1047 1048
domaincapsmock_la_SOURCES = domaincapsmock.c
domaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
domaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)

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

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

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

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

1069 1070
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1071
virnetmessagetest_LDADD = $(LDADDS)
1072

1073 1074
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1075
virnetsockettest_LDADD = $(LDADDS)
1076

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

1082 1083 1084 1085 1086
virnetdaemonmock_la_SOURCES = \
	virnetdaemonmock.c
virnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)

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

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
1094
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1095
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1096

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

1116 1117
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1118
virtimetest_LDADD = $(LDADDS)
1119

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

1124 1125 1126 1127
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

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

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

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

1151 1152 1153 1154
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1155 1156 1157 1158
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1159 1160 1161 1162
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

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

1167
virportallocatormock_la_SOURCES = \
1168
	virportallocatormock.c
1169 1170
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1171

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

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
1178
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1179
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1180

1181 1182 1183 1184
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1185 1186 1187 1188
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

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

virpcimock_la_SOURCES = \
	virpcimock.c
1195
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1196
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1197

J
John Ferlan 已提交
1198 1199 1200 1201 1202
virrandommock_la_SOURCES = \
	virrandommock.c
virrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virrandommock_la_LIBADD = $(MOCKLIBS_LIBS)

1203 1204 1205 1206
virhostcpumock_la_SOURCES = \
	virhostcpumock.c
virhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1207

P
Pavel Hrdina 已提交
1208 1209 1210 1211 1212
virfilecachemock_la_SOURCES = \
	virfilecachemock.c
virfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)

1213 1214
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1215
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1216 1217
vircaps2xmltest_LDADD = $(LDADDS)

M
Martin Kletzander 已提交
1218 1219 1220 1221
virnumamock_la_SOURCES = \
	virnumamock.c
virnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1222

M
Martin Kletzander 已提交
1223 1224 1225 1226
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

1227 1228 1229 1230
virfilemock_la_SOURCES = \
	virfilemock.c
virfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilemock_la_LIBADD = $(MOCKLIBS_LIBS)
1231
else ! WITH_LINUX
M
Martin Kletzander 已提交
1232
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \
1233
			  virfilewrapper.h virresctrltest.c virfilemock.c
1234
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1235

1236
if WITH_NSS
M
Michal Privoznik 已提交
1237 1238 1239
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
1240
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1241 1242
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
1243
	$(LDADDS) \
M
Michal Privoznik 已提交
1244 1245
	../tools/nss/libnss_libvirt_impl.la

1246 1247 1248
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
1249 1250
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1251 1252
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
1253
	$(LDADDS) \
1254 1255
	../tools/nss/libnss_libvirt_guest_impl.la

M
Michal Privoznik 已提交
1256 1257 1258 1259 1260
nssmock_la_SOURCES = \
	nssmock.c
nssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
nssmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1261 1262 1263
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
1264 1265
nsslinktest_CFLAGS = \
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1266 1267 1268 1269
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

1270
nssguestlinktest_SOURCES = nsslinktest.c
1271 1272 1273
nssguestlinktest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1274 1275 1276
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1277 1278 1279
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1280

1281 1282 1283 1284 1285 1286
virdeterministichashmock_la_SOURCES = \
	virdeterministichashmock.c
virdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)

test_libraries += virdeterministichashmock.la
1287

1288
if WITH_YAJL
1289 1290 1291 1292
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

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

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

virnetdevmock_la_SOURCES = \
	virnetdevmock.c
virnetdevmock_la_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
1306
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1307
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1308

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

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

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

1322
virusbmock_la_SOURCES = virusbmock.c
1323
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1324
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1325
	$(PROBES_O) \
1326
	../src/libvirt_util.la
1327 1328 1329

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
1330
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1331
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1332

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

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

1352 1353 1354 1355 1356
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1357

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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