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

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

19 20
SHELL = $(PREFERABLY_POSIX_SHELL)

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

30 31
WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)

E
Eric Blake 已提交
32
AM_CFLAGS = \
33
	-Dabs_builddir="\"$(abs_builddir)\"" \
34
	-Dabs_top_builddir="\"$(abs_top_builddir)\"" \
35
	-Dabs_srcdir="\"$(abs_srcdir)\"" \
36
	-Dabs_top_srcdir="\"$(abs_top_srcdir)\"" \
37
	$(LIBXML_CFLAGS) \
38
	$(LIBNL_CFLAGS) \
39
	$(GNUTLS_CFLAGS) \
40
	$(SASL_CFLAGS) \
41
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
42
	$(APPARMOR_CFLAGS) \
43
	$(YAJL_CFLAGS) \
44
	$(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 \
O
Osier Yang 已提交
88
	fchostdata \
C
Cole Robinson 已提交
89 90
	genericxml2xmlindata \
	genericxml2xmloutdata \
91
	interfaceschemadata \
92
	libxlxml2domconfigdata \
93
	lxcconf2xmldata \
94
	lxcxml2xmldata \
95
	lxcxml2xmloutdata \
96 97
	networkxml2confdata \
	networkxml2firewalldata \
E
Eric Blake 已提交
98 99
	networkxml2xmlin \
	networkxml2xmlout \
J
Ján Tomko 已提交
100 101
	networkxml2xmlupdatein \
	networkxml2xmlupdateout \
E
Eric Blake 已提交
102
	nodedevschemadata \
103
	virhostcpudata \
M
Michal Privoznik 已提交
104
	nssdata \
105
	nwfilterxml2firewalldata \
E
Eric Blake 已提交
106 107 108
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
109
	qemuagentdata \
110
	qemublocktestdata \
111
	qemucapabilitiesdata \
112
	qemucaps2xmloutdata \
113 114
	qemudomainsnapshotxml2xmlin \
	qemudomainsnapshotxml2xmlout \
115
	qemuhotplugtestcpus \
116 117
	qemuhotplugtestdevices \
	qemuhotplugtestdomains \
118
	qemumigparamsdata \
119
	qemumonitorjsondata \
E
Eric Blake 已提交
120 121
	qemuxml2argvdata \
	qemuxml2xmloutdata \
122
	qemustatusxml2xmldata \
123
	qemumemlockdata \
124
	qemufirmwaredata \
J
Ján Tomko 已提交
125
	secretxml2xmlin \
126
	securityselinuxhelperdata \
127
	securityselinuxlabeldata \
128
	storagepoolcapsschemadata \
129
	storagepoolschemadata \
130
	storagepoolxml2xmlin \
E
Eric Blake 已提交
131
	storagepoolxml2xmlout \
132
	storagepoolxml2argvdata \
133
	storagevolschemadata \
134
	storagevolxml2argvdata \
135
	storagevolxml2xmlin \
E
Eric Blake 已提交
136
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
137
	sysinfodata \
138
	test-lib.sh \
Y
Yohan BELLEGUIC 已提交
139
	vboxsnapshotxmldata \
140
	vircaps2xmldata \
141
	vircgroupdata \
142
	virconfdata \
143
	virfiledata \
144
	virjsondata \
145
	virmacmaptestdata \
146
	virmock.h \
147
	virmockstathelpers.c \
148
	virnetdaemondata \
149
	virnetdevtestdata \
150
	virnetworkportxml2xmldata \
151
	virnwfilterbindingxml2xmldata \
152
	virpcitestdata \
O
Osier Yang 已提交
153
	virscsidata \
154
	virsh-uriprecedence \
155
	virusbtestdata \
156
	vmwareverdata \
157
	vmx2xmldata \
158
	xlconfigdata \
159
	xmconfigdata \
160 161
	xml2vmxdata \
	virstorageutildata \
162
	virfilecachedata \
M
Martin Kletzander 已提交
163
	virresctrldata \
164
	$(NULL)
K
Karel Zak 已提交
165

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

204 205 206 207 208 209 210 211 212 213
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 已提交
214
	virfilecachemock.la \
215 216
	$(NULL)

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

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

241 242 243 244
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

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

255
if WITH_SECDRIVER_SELINUX
256
if WITH_ATTR
257 258
test_programs += securityselinuxtest \
                 viridentitytest
259
if WITH_QEMU
260
test_programs += securityselinuxlabeltest
261 262 263
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
264

265 266
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
267

268
if WITH_LIBXL
P
Peter Krempa 已提交
269
test_programs += xlconfigtest \
270
	xmconfigtest libxlxml2domconfigtest
271
test_libraries += libxltestdriver.la libxlmock.la
272 273
endif WITH_LIBXL

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

296
if WITH_LXC
297
test_programs += lxcxml2xmltest lxcconf2xmltest
298
endif WITH_LXC
299

300
if WITH_OPENVZ
301
test_programs += openvzutilstest
302
endif WITH_OPENVZ
303

304
if WITH_ESX
305
test_programs += esxutilstest
306
endif WITH_ESX
307

Y
Yohan BELLEGUIC 已提交
308 309 310 311
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

312
if WITH_VMX
313
test_programs += vmx2xmltest xml2vmxtest
314
endif WITH_VMX
315

316 317 318 319
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
320
if WITH_BHYVE
321
test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest
322
test_libraries += bhyvexml2argvmock.la bhyveargv2xmlmock.la
R
Roman Bogorodskiy 已提交
323 324
endif WITH_BHYVE

325
if WITH_CIL
326
test_programs += objectlocking
327
endif WITH_CIL
328

329
if WITH_YAJL
330
test_programs += virjsontest
331
endif WITH_YAJL
332

333 334 335
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
336
		virnetworkportxml2xmltest \
337
		$(NULL)
338

339
if WITH_NETWORK
340 341 342 343
test_programs += \
		networkxml2conftest \
		networkxml2firewalltest \
		$(NULL)
344
endif WITH_NETWORK
345

346 347
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
348
endif WITH_STORAGE_SHEEPDOG
349

350
test_programs += nwfilterxml2xmltest
351
test_programs += virnwfilterbindingxml2xmltest
352

353 354
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
355
test_programs += nwfilterxml2firewalltest
356 357
endif WITH_NWFILTER

358
if WITH_STORAGE
359
test_programs += storagevolxml2argvtest
360
test_programs += storagepoolxml2argvtest
361
test_programs += virstorageutiltest
362
test_programs += storagepoolxml2xmltest
363
test_programs += storagepoolcapstest
364
endif WITH_STORAGE
365

366 367
if WITH_STORAGE_FS
test_programs += virstoragetest
368
endif WITH_STORAGE_FS
369

O
Osier Yang 已提交
370 371 372 373
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

374
if WITH_NSS
375 376
test_helpers += nsslinktest nssguestlinktest
test_programs += nsstest nssguesttest
377
test_libraries += nssmock.la
378 379
endif WITH_NSS

380
test_programs += storagevolxml2xmltest
381

382
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
383

384
test_programs += interfacexml2xmltest
385

386
test_programs += cputest
387

P
Peter Krempa 已提交
388 389
test_programs += metadatatest

J
Ján Tomko 已提交
390 391
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
392 393
test_programs += genericxml2xmltest

394
if WITH_LINUX
395 396 397
test_programs += virusbtest \
	virnetdevbandwidthtest \
	$(NULL)
398 399
endif WITH_LINUX

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

420 421 422
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

423
test_programs += \
424 425
	eventtest \
	virdrivermoduletest
426
else ! WITH_LIBVIRTD
427
EXTRA_DIST += $(libvirtd_test_scripts)
428
endif ! WITH_LIBVIRTD
429

430 431
test_programs += objecteventtest

J
Jamie Strandboge 已提交
432
if WITH_SECDRIVER_APPARMOR
433
if WITH_LIBVIRTD
J
Jamie Strandboge 已提交
434
test_scripts += virt-aa-helper-test
435 436
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
437 438
EXTRA_DIST += virt-aa-helper-test

439 440
EXTRA_DIST += $(test_scripts)

441 442 443 444 445 446 447 448 449 450 451 452 453
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

454 455
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
456
noinst_LTLIBRARIES = $(test_libraries)
457
else ! WITH_TESTS
458
check_PROGRAMS = $(test_programs) $(test_helpers)
459
check_LTLIBRARIES = $(test_libraries)
460
endif ! WITH_TESTS
461

462 463
TESTS = $(test_programs) \
	$(test_scripts)
464

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

477

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

484 485 486
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
487
sockettest_LDADD = $(LDADDS)
488

489 490
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
491 492 493
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
494 495
libxl_LDADDS += $(LDADDS)

496 497 498 499
libxltestdriver_la_SOURCES =
libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
libxltestdriver_la_LIBADD = $(libxl_LDADDS)

500 501 502 503
xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
504

505 506 507 508 509
xmconfigtest_SOURCES = \
	xmconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xmconfigtest_LDADD = $(libxl_LDADDS)

510 511 512 513 514
libxlxml2domconfigtest_SOURCES = \
	libxlxml2domconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
libxlxml2domconfigtest_LDADD = $(libxl_LDADDS) $(LIBXML_LIBS)

515 516 517 518 519
libxlmock_la_SOURCES = \
	libxlmock.c
libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS)
libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libxlmock_la_LIBADD = $(MOCKLIBS_LIBS)
520

521
else ! WITH_LIBXL
P
Peter Krempa 已提交
522
EXTRA_DIST += xlconfigtest.c \
523
	xmconfigtest.c libxlxml2domconfigtest.c
524 525
endif ! WITH_LIBXL

526 527 528
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
529
	testutilsqemuschema.h testutilsqemuschema.c \
530 531
	$(NULL)

532
if WITH_QEMU
533

534 535
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

536
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
537
if WITH_NETWORK
E
Eric Blake 已提交
538
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
539
endif WITH_NETWORK
540 541 542
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
543
if WITH_DTRACE_PROBES
544
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
545
endif WITH_DTRACE_PROBES
546
qemu_LDADDS += $(LDADDS)
547

548
libqemutestdriver_la_SOURCES =
549
libqemutestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
550
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)
551

552
qemucpumock_la_SOURCES = \
553
	qemucpumock.c testutilshostcpus.h
554 555 556
qemucpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
qemucpumock_la_LIBADD = $(MOCKLIBS_LIBS)

557
qemuxml2argvtest_SOURCES = \
558
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
559 560 561
	testutils.c testutils.h \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
562 563
qemuxml2argvtest_LDADD = libqemutestdriver.la \
	$(LDADDS) $(LIBXML_LIBS)
564

565 566
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
567
qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
568
qemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
569

570
qemuxml2xmltest_SOURCES = \
571
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
572
	testutils.c testutils.h
573
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
574

575 576 577 578 579
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
580
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
581
	$(qemu_LDADDS)
582

583 584 585 586 587
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
588
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
589
	$(qemu_LDADDS)
590

J
Jiri Denemark 已提交
591 592 593 594 595 596 597 598 599 600
qemucapsprobe_SOURCES = \
	qemucapsprobe.c
qemucapsprobe_LDADD = \
	libqemutestdriver.la $(LDADDS)

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

601 602 603 604 605 606
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
607
	$(qemu_LDADDS)
608

609 610 611
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
612
	testutilsqemu.c testutilsqemu.h \
613
	$(NULL)
614
qemucaps2xmltest_LDADD = $(qemu_LDADDS)
615

P
Pavel Hrdina 已提交
616 617
qemucaps2xmlmock_la_SOURCES = \
	qemucaps2xmlmock.c
618
qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
619
qemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
620

P
Peter Krempa 已提交
621 622 623 624 625
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
626
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
P
Peter Krempa 已提交
627

628 629 630 631 632
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
633
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
634

635
qemublocktest_SOURCES = \
636 637
	qemublocktest.c \
	testutils.h testutils.c \
638
	testutilsqemu.h testutilsqemu.c \
639 640
	$(NULL)
qemublocktest_LDADD = \
641
	libqemumonitortestutils.la \
642 643 644 645 646
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(qemu_LDADDS) \
	$(NULL)

647 648
qemudomainsnapshotxml2xmltest_SOURCES = \
	qemudomainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
649
	testutils.c testutils.h
650
qemudomainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
651 652 653 654 655

qemumemlocktest_SOURCES = \
	qemumemlocktest.c \
	testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
656
qemumemlocktest_LDADD = $(qemu_LDADDS)
657 658 659 660 661 662 663

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

666 667 668 669 670
qemusecuritytest_SOURCES = \
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
	testutils.h testutils.c \
	testutilsqemu.h testutilsqemu.c
671
qemusecuritytest_LDADD = $(qemu_LDADDS)
672

673 674 675
qemufirmwaretest_SOURCES = \
	qemufirmwaretest.c \
	testutils.h testutils.c \
676
	virfilewrapper.c virfilewrapper.h \
677
	$(NULL)
678
qemufirmwaretest_LDADD = $(qemu_LDADDS)
679

680
else ! WITH_QEMU
P
Peter Krempa 已提交
681
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c \
682
	qemudomainsnapshotxml2xmltest.c \
P
Peter Krempa 已提交
683
	testutilsqemu.c testutilsqemu.h \
684
	testutilsqemuschema.c testutilsqemuschema.h \
685
	qemumonitorjsontest.c qemuhotplugtest.c \
686
	qemuagenttest.c qemucapabilitiestest.c \
687
	qemucaps2xmltest.c qemucommandutiltest.c \
688
	qemumemlocktest.c qemucpumock.c testutilshostcpus.h \
689
	qemublocktest.c \
690
	qemumigparamstest.c \
691 692
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
693
	qemufirmwaretest.c \
694
	$(QEMUMONITORTESTUTILS_SOURCES)
695
endif ! WITH_QEMU
696

697 698
if WITH_LXC

E
Eric Blake 已提交
699
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
700
if WITH_NETWORK
E
Eric Blake 已提交
701
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
702
endif WITH_NETWORK
703
lxc_LDADDS += $(LDADDS)
704 705 706 707

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
708
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
709 710

lxcconf2xmltest_SOURCES = \
711
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
712 713
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
714
else ! WITH_LXC
715
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
716
endif ! WITH_LXC
717

718 719 720 721
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
722
openvzutilstest_LDADD = $(LDADDS)
723
else ! WITH_OPENVZ
724
EXTRA_DIST += openvzutilstest.c
725
endif ! WITH_OPENVZ
726 727
EXTRA_DIST += openvzutilstest.conf

728 729 730 731
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
732
esxutilstest_LDADD = $(LDADDS)
733
else ! WITH_ESX
734
EXTRA_DIST += esxutilstest.c
735
endif ! WITH_ESX
736

Y
Yohan BELLEGUIC 已提交
737 738 739 740 741 742 743 744 745 746
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

747
if WITH_VMX
748 749 750
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
751
vmx2xmltest_LDADD = $(LDADDS)
752 753 754 755

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
756
xml2vmxtest_LDADD = $(LDADDS)
757
else ! WITH_VMX
758
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
759
endif ! WITH_VMX
760

761 762 763 764 765 766 767 768 769
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 已提交
770 771 772
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
773
bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
774
bhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
775

776 777 778 779 780
bhyveargv2xmlmock_la_SOURCES = \
	bhyveargv2xmlmock.c
bhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
bhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)

R
Roman Bogorodskiy 已提交
781
bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
R
Roman Bogorodskiy 已提交
782 783 784
if WITH_STORAGE
bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
R
Roman Bogorodskiy 已提交
785 786 787 788 789
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
790 791 792 793 794

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
795 796 797 798 799

bhyveargv2xmltest_SOURCES = \
	bhyveargv2xmltest.c \
	testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
800
else ! WITH_BHYVE
801 802 803 804 805 806
EXTRA_DIST += \
	bhyvexml2argvtest.c \
	bhyveargv2xmltest.c \
	bhyvexml2xmltest.c \
	bhyvexml2argvmock.c \
	bhyveargv2xmlmock.c
R
Roman Bogorodskiy 已提交
807 808
endif ! WITH_BHYVE

809 810 811 812 813
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
814 815 816 817 818
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

819 820 821 822 823
virnetworkportxml2xmltest_SOURCES = \
	virnetworkportxml2xmltest.c \
	testutils.c testutils.h
virnetworkportxml2xmltest_LDADD = $(LDADDS)

824
if WITH_NETWORK
825 826
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
827
	testutils.c testutils.h
828
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
829 830 831 832 833 834

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

835
else ! WITH_NETWORK
836
EXTRA_DIST += networkxml2conftest.c
837
endif !	WITH_NETWORK
838

839 840 841 842
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
843
storagebackendsheepdogtest_LDADD = \
844
	../src/libvirt_storage_backend_sheepdog_priv.la \
845
	../src/libvirt_driver_storage_impl.la \
846
	$(LDADDS)
847
else ! WITH_STORAGE_SHEEPDOG
848
EXTRA_DIST += storagebackendsheepdogtest.c
849
endif ! WITH_STORAGE_SHEEPDOG
850

851 852 853 854
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
855

856 857 858 859 860
virnwfilterbindingxml2xmltest_SOURCES = \
	virnwfilterbindingxml2xmltest.c \
	testutils.c testutils.h
virnwfilterbindingxml2xmltest_LDADD = $(LDADDS)

861 862 863 864 865
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
866 867 868 869 870 871

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

J
Ján Tomko 已提交
874 875 876 877 878
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
879 880 881 882 883
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
884

885
if WITH_STORAGE
886 887 888 889 890 891 892 893 894 895
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

896 897 898 899
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
900
	$(LIBXML_LIBS) \
901 902 903 904
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(LDADDS)
J
Ján Tomko 已提交
905

906 907 908 909 910 911 912 913 914 915
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)

916 917 918 919 920 921 922
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS) \
	../src/libvirt_driver_storage_impl.la \
	$(GNULIB_LIBS)

923 924 925 926
storagepoolcapstest_SOURCES = \
        storagepoolcapstest.c testutils.h testutils.c
storagepoolcapstest_LDADD = $(LDADDS)

927
else ! WITH_STORAGE
928
EXTRA_DIST += storagevolxml2argvtest.c
929
EXTRA_DIST += virstorageutiltest.c
930
EXTRA_DIST += storagepoolxml2argvtest.c
931
EXTRA_DIST += storagepoolxml2xmltest.c
932
EXTRA_DIST += storagepoolcapstest.c
933
endif ! WITH_STORAGE
934

935 936 937 938 939
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
940 941 942
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
943
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
944

945 946 947 948 949
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

950 951 952
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
A
Andrea Bolognani 已提交
953
cputest_LDADD = $(LIBXML_LIBS)
J
Jiri Denemark 已提交
954 955
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
956
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS)
A
Andrea Bolognani 已提交
957 958 959
else ! WITH_QEMU
cputest_LDADD += $(LDADDS)
endif ! WITH_QEMU
960

P
Peter Krempa 已提交
961 962 963 964 965
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

966 967 968 969 970
virerrortest_SOURCES = \
	virerrortest.c \
	testutils.c testutils.h
virerrortest_LDADD = $(LDADDS)

S
Simon Kobyda 已提交
971 972 973 974 975 976 977
vshtabletest_SOURCES = \
	vshtabletest.c \
	testutils.c testutils.h
vshtabletest_LDADD = \
	$(LDADDS) \
	../tools/libvirt_shell.la

978 979 980 981 982
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

983
virconftest_SOURCES = \
984
	virconftest.c testutils.h testutils.c
985
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
986

987
virhostcputest_SOURCES = \
988
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
989
virhostcputest_LDADD = $(LDADDS)
990

991 992 993 994
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

995 996 997 998
# 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
999 1000
commandhelper_SOURCES = \
	commandhelper.c
1001 1002 1003 1004
commandhelper_LDADD = \
	$(NO_INDIRECT_LDFLAGS) \
	$(GNULIB_LIBS)

1005
commandhelper_LDFLAGS = -static
1006

1007

1008 1009 1010 1011
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

1012
vircapstest_SOURCES = \
1013 1014 1015 1016 1017 1018 1019
	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
1020
if WITH_QEMU
1021
vircapstest_LDADD = $(qemu_LDADDS)
1022 1023 1024
else ! WITH_QEMU
vircapstest_LDADD = $(LDADDS)
endif ! WITH_QEMU
1025

1026 1027 1028 1029
domaincapsmock_la_SOURCES = domaincapsmock.c
domaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
domaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1030
domaincapstest_SOURCES = \
1031 1032 1033
	domaincapstest.c testutils.h testutils.c \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
M
Michal Privoznik 已提交
1034 1035
domaincapstest_LDADD = $(LDADDS)

1036 1037
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
1038
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
1039 1040
endif WITH_QEMU

1041 1042
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
1043
domaincapstest_LDADD += libxltestdriver.la $(GNULIB_LIBS)
1044 1045
endif WITH_LIBXL

1046 1047 1048 1049
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

1050 1051
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1052
virnetmessagetest_LDADD = $(LDADDS)
1053

1054 1055
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1056
virnetsockettest_LDADD = $(LDADDS)
1057

1058 1059
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1060
	testutils.h testutils.c
1061
virnetdaemontest_LDADD = $(LDADDS)
1062

1063 1064 1065 1066 1067
virnetdaemonmock_la_SOURCES = \
	virnetdaemonmock.c
virnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)

1068 1069 1070 1071 1072 1073 1074
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
1075
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1076
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1077

1078
virnettlscontexttest_SOURCES = \
1079 1080 1081
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1082
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
1083 1084 1085 1086
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1087
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
1088 1089 1090
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
1091 1092
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
1093
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
1094
EXTRA_DIST += pkix_asn1_tab.c
1095
endif ! HAVE_LIBTASN1
1096

1097 1098
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1099
virtimetest_LDADD = $(LDADDS)
1100

J
Ján Tomko 已提交
1101 1102
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1103
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1104

1105 1106 1107 1108
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1109 1110
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1111 1112 1113 1114 1115 1116 1117
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)
1118

1119 1120 1121
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1122
if WITH_SELINUX
1123
viridentitytest_LDADD += $(SELINUX_LIBS)
1124 1125 1126
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1127

J
Ján Tomko 已提交
1128 1129 1130 1131
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1132 1133 1134 1135
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1136 1137 1138 1139
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1140 1141 1142 1143
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1144 1145 1146 1147
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1148
virportallocatormock_la_SOURCES = \
1149
	virportallocatormock.c
1150 1151
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1152

1153 1154 1155 1156 1157 1158
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
1159
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1160
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1161

1162 1163 1164 1165
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1166 1167 1168 1169
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1170 1171 1172 1173 1174 1175
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
1176
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1177
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1178

J
John Ferlan 已提交
1179 1180 1181 1182 1183
virrandommock_la_SOURCES = \
	virrandommock.c
virrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virrandommock_la_LIBADD = $(MOCKLIBS_LIBS)

1184 1185 1186 1187
virhostcpumock_la_SOURCES = \
	virhostcpumock.c
virhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1188

P
Pavel Hrdina 已提交
1189 1190 1191 1192 1193
virfilecachemock_la_SOURCES = \
	virfilecachemock.c
virfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)

1194 1195
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1196
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1197 1198
vircaps2xmltest_LDADD = $(LDADDS)

M
Martin Kletzander 已提交
1199 1200 1201 1202
virnumamock_la_SOURCES = \
	virnumamock.c
virnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1203

M
Martin Kletzander 已提交
1204 1205 1206 1207
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

1208 1209 1210 1211
virfilemock_la_SOURCES = \
	virfilemock.c
virfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilemock_la_LIBADD = $(MOCKLIBS_LIBS)
1212
else ! WITH_LINUX
M
Martin Kletzander 已提交
1213
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \
1214
			  virfilewrapper.h virresctrltest.c virfilemock.c
1215
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1216

1217
if WITH_NSS
M
Michal Privoznik 已提交
1218 1219 1220
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
1221
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1222 1223
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
1224
	$(LDADDS) \
M
Michal Privoznik 已提交
1225 1226
	../tools/nss/libnss_libvirt_impl.la

1227 1228 1229
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
1230 1231
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1232 1233
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
1234
	$(LDADDS) \
1235 1236
	../tools/nss/libnss_libvirt_guest_impl.la

M
Michal Privoznik 已提交
1237 1238 1239 1240 1241
nssmock_la_SOURCES = \
	nssmock.c
nssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
nssmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1242 1243 1244
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
1245 1246
nsslinktest_CFLAGS = \
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1247 1248 1249 1250
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

1251
nssguestlinktest_SOURCES = nsslinktest.c
1252 1253 1254
nssguestlinktest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1255 1256 1257
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1258 1259 1260
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1261

1262 1263 1264 1265 1266 1267
virdeterministichashmock_la_SOURCES = \
	virdeterministichashmock.c
virdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)

test_libraries += virdeterministichashmock.la
1268

1269
if WITH_YAJL
1270 1271 1272 1273
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

1274
test_programs += virmacmaptest
1275
else ! WITH_YAJL
1276
EXTRA_DIST +=  virmacmaptest.c
1277
endif ! WITH_YAJL
1278

M
Michal Privoznik 已提交
1279 1280 1281 1282 1283 1284 1285 1286
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)
1287
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1288
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1289

1290 1291 1292 1293
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

1294 1295 1296 1297 1298
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1299 1300 1301 1302
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1303
virusbmock_la_SOURCES = virusbmock.c
1304
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1305
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1306
	$(PROBES_O) \
1307
	../src/libvirt_util.la
1308 1309 1310

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
1311
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1312
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1313

1314 1315 1316
virtestmock_la_SOURCES = \
	virtestmock.c
virtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1317 1318
virtestmock_la_LIBADD = \
	$(MOCKLIBS_LIBS) \
1319
	$(PROBES_O) \
1320
	../src/libvirt_util.la
1321
else ! WITH_LINUX
1322
	EXTRA_DIST += virusbtest.c virusbmock.c \
1323 1324
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1325 1326
endif ! WITH_LINUX

1327 1328 1329 1330
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1331
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1332

1333 1334 1335 1336 1337
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1338

1339 1340 1341 1342 1343
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1344 1345
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1346
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1347
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1348

1349
else ! WITH_DBUS
1350
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1351
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1352

1353 1354
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1355
viruritest_LDADD = $(LDADDS)
1356

1357 1358
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1359
virkeyfiletest_LDADD = $(LDADDS)
1360

1361 1362 1363 1364
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1365 1366
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1367
virauthconfigtest_LDADD = $(LDADDS)
1368

1369
seclabeltest_SOURCES = \
1370
	seclabeltest.c testutils.h testutils.c
1371
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1372

1373
if WITH_SECDRIVER_SELINUX
1374
if WITH_ATTR
1375 1376
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1377
else ! WITH_TESTS
1378
check_LTLIBRARIES += libsecurityselinuxhelper.la
1379
endif ! WITH_TESTS
1380 1381 1382

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1383
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1384 1385 1386

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1387
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1388 1389
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1390 1391 1392 1393 1394

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1395
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
1396 1397
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1398 1399 1400
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1401 1402
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1403

1404 1405 1406 1407
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1408 1409 1410
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1411

1412
viratomictest_SOURCES = \
L
Laine Stump 已提交
1413
	viratomictest.c testutils.h testutils.c
1414 1415
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1416 1417 1418 1419
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1420 1421 1422 1423
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1424 1425 1426 1427
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1428 1429 1430 1431
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1432 1433
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1434
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1435 1436
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1437 1438 1439
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1440

M
Matthias Bolte 已提交
1441 1442 1443 1444
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1445
if WITH_LIBVIRTD
1446 1447 1448
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1449
endif WITH_LIBVIRTD
1450

1451 1452
if WITH_LIBVIRTD
eventtest_SOURCES = \
1453
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1454
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1455
endif WITH_LIBVIRTD
1456

1457 1458
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1459
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1460 1461 1462

shunloadtest_SOURCES = \
	shunloadtest.c
1463
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1464 1465
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1466 1467 1468 1469
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1470 1471 1472 1473
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1474 1475 1476 1477
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1478 1479 1480 1481 1482
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1483 1484 1485 1486 1487
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1488
if WITH_LINUX
O
Osier Yang 已提交
1489 1490 1491 1492
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1493 1494 1495 1496
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1497 1498
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1499
EXTRA_DIST += scsihosttest.c
1500 1501
endif  ! WITH_LINUX

O
Osier Yang 已提交
1502 1503 1504 1505 1506 1507 1508 1509 1510
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1511 1512 1513 1514 1515 1516
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1517
objectlocking_SOURCES = objectlocking.ml
1518 1519 1520 1521

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

1522
objectlocking: objectlocking.cmx objectlocking-files.txt
1523 1524
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1525

1526
objectlocking-files.txt:
1527 1528
	find $(top_builddir)/src/ -name '*.i' > $@

1529
else ! WITH_CIL
1530
EXTRA_DIST += objectlocking.ml
1531
endif ! WITH_CIL
1532

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