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

3
## Copyright (C) 2005-2015 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
# old automake does not provide abs_{src,build}dir variables
abs_builddir = $(shell pwd)
21
abs_top_builddir = $(shell cd .. && pwd)
22
abs_srcdir = $(shell cd $(srcdir) && pwd)
23
abs_top_srcdir = $(shell cd $(top_srcdir) && pwd)
24

25 26
SHELL = $(PREFERABLY_POSIX_SHELL)

27
AM_CPPFLAGS = \
28
	-I$(top_builddir) -I$(top_srcdir) \
29 30 31
	-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 \
32
	-I$(top_srcdir)/src/util \
33
	-I$(top_srcdir)/src/conf \
34
	$(NULL)
E
Eric Blake 已提交
35

36 37
WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)

E
Eric Blake 已提交
38
AM_CFLAGS = \
39
	-Dabs_builddir="\"$(abs_builddir)\"" \
40
	-Dabs_top_builddir="\"$(abs_top_builddir)\"" \
41
	-Dabs_srcdir="\"$(abs_srcdir)\"" \
42
	-Dabs_top_srcdir="\"$(abs_top_srcdir)\"" \
43
	$(LIBXML_CFLAGS) \
44
	$(LIBNL_CFLAGS) \
45
	$(GNUTLS_CFLAGS) \
46
	$(SASL_CFLAGS) \
47
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
48
	$(APPARMOR_CFLAGS) \
49
	$(YAJL_CFLAGS) \
E
Eric Blake 已提交
50
	$(COVERAGE_CFLAGS) \
51
	$(XDR_CFLAGS) \
E
Eric Blake 已提交
52
	$(WARN_CFLAGS)
53

54 55 56
AM_LDFLAGS = \
	-export-dynamic

57 58 59 60
MOCKLIBS_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
	$(MINGW_EXTRA_LDFLAGS)

61
DRIVERLIB_LDFLAGS = \
62 63 64 65
	-avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
	$(MINGW_EXTRA_LDFLAGS)

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

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

K
Karel Zak 已提交
74
LDADDS = \
75
	$(NO_INDIRECT_LDFLAGS) \
76
	$(PROBES_O) \
77 78
	$(GNULIB_LIBS) \
	../src/libvirt.la
K
Karel Zak 已提交
79

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

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

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

212 213 214 215 216 217 218 219 220 221
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 已提交
222
	virfilecachemock.la \
223 224
	$(NULL)

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

236 237
if WITH_LINUX
test_programs += fchosttest
238
test_programs += scsihosttest
239
test_programs += vircaps2xmltest
M
Martin Kletzander 已提交
240
test_programs += virresctrltest
241 242
test_libraries += virusbmock.la \
	virnetdevbandwidthmock.la \
243
	virnumamock.la \
244
	virtestmock.la \
245
	virfilemock.la \
246
	$(NULL)
247 248
endif WITH_LINUX

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

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

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

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

277
if WITH_LIBXL
278
test_programs += xlconfigtest xml2sexprtest sexpr2xmltest \
279
	xmconfigtest libxlxml2domconfigtest
280
test_libraries += libxltestdriver.la libxlmock.la
281 282
endif WITH_LIBXL

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

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

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

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

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

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

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

R
Roman Bogorodskiy 已提交
329
if WITH_BHYVE
330
test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest
331
test_libraries += bhyvexml2argvmock.la bhyveargv2xmlmock.la
R
Roman Bogorodskiy 已提交
332 333
endif WITH_BHYVE

334
if WITH_CIL
335
test_programs += objectlocking
336
endif WITH_CIL
337

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

342 343 344 345
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
		$(NULL)
346

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

354 355
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
356
endif WITH_STORAGE_SHEEPDOG
357

358
test_programs += nwfilterxml2xmltest
359
test_programs += virnwfilterbindingxml2xmltest
360

361 362
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
363
test_programs += nwfilterxml2firewalltest
364 365
endif WITH_NWFILTER

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

374 375
if WITH_STORAGE_FS
test_programs += virstoragetest
376
endif WITH_STORAGE_FS
377

O
Osier Yang 已提交
378 379 380 381
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

382
if WITH_NSS
383 384
test_helpers += nsslinktest nssguestlinktest
test_programs += nsstest nssguesttest
385
test_libraries += nssmock.la
386 387
endif WITH_NSS

388
test_programs += storagevolxml2xmltest
389

390
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
391

392
test_programs += interfacexml2xmltest
393

394
test_programs += cputest
395

P
Peter Krempa 已提交
396 397
test_programs += metadatatest

J
Ján Tomko 已提交
398 399
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
400 401
test_programs += genericxml2xmltest

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

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

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

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

437 438
test_programs += objecteventtest

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

446 447
EXTRA_DIST += $(test_scripts)

448 449 450 451 452 453 454 455 456 457 458 459 460
if WITH_LINUX
check-access: file-access-clean
	VIR_TEST_FILE_ACCESS=1 $(MAKE) $(AM_MAKEFLAGS) check
	$(PERL) check-file-access.pl | sort -u

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

EXTRA_DIST += \
	check-file-access.pl \
	file_access_whitelist.txt

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

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

472
# NB, automake < 1.10 does not provide the real
473
# abs_top_{src/build}dir or builddir variables, so don't rely
474
# on them here. Fake them with 'pwd'
475 476 477
# Also, BSD sh doesn't like 'a=b b=$$a', so we can't use an
# intermediate shell variable, but must do all the expansion in make

478
lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd)
479

480
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
481 482 483 484 485 486 487 488 489
TESTS_ENVIRONMENT = \
  abs_top_builddir=$(lv_abs_top_builddir) \
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd` \
  abs_builddir=$(abs_builddir) \
  abs_srcdir=$(abs_srcdir) \
  SHELL="$(SHELL)" \
  LIBVIRT_AUTOSTART=0 \
  LC_ALL=C \
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \
490 491
  $(VG)

492

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

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

504 505
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
506 507 508
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
509 510
libxl_LDADDS += $(LDADDS)

511 512 513 514
libxltestdriver_la_SOURCES =
libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
libxltestdriver_la_LIBADD = $(libxl_LDADDS)

515 516 517 518
xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
519

520 521 522 523 524
xml2sexprtest_SOURCES = \
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xml2sexprtest_LDADD = $(libxl_LDADDS)

525 526 527 528 529
sexpr2xmltest_SOURCES = \
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
sexpr2xmltest_LDADD = $(libxl_LDADDS)

530 531 532 533 534
xmconfigtest_SOURCES = \
	xmconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xmconfigtest_LDADD = $(libxl_LDADDS)

535 536 537 538 539
libxlxml2domconfigtest_SOURCES = \
	libxlxml2domconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
libxlxml2domconfigtest_LDADD = $(libxl_LDADDS) $(LIBXML_LIBS)

540 541 542 543 544
libxlmock_la_SOURCES = \
	libxlmock.c
libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS)
libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libxlmock_la_LIBADD = $(MOCKLIBS_LIBS)
545

546
else ! WITH_LIBXL
547
EXTRA_DIST += xlconfigtest.c xml2sexprtest.c sexpr2xmltest.c \
548
	xmconfigtest.c libxlxml2domconfigtest.c
549 550
endif ! WITH_LIBXL

551 552 553
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
554
	testutilsqemuschema.h testutilsqemuschema.c \
555 556
	$(NULL)

557
if WITH_QEMU
558

559 560
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

561
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
562
if WITH_NETWORK
E
Eric Blake 已提交
563
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
564
endif WITH_NETWORK
565 566 567
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
568
if WITH_DTRACE_PROBES
569
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
570
endif WITH_DTRACE_PROBES
571

572
libqemutestdriver_la_SOURCES =
573
libqemutestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
574 575
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)

576
qemucpumock_la_SOURCES = \
577
	qemucpumock.c testutilshostcpus.h
578 579 580
qemucpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
qemucpumock_la_LIBADD = $(MOCKLIBS_LIBS)

581
qemuxml2argvtest_SOURCES = \
582
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
583 584 585
	testutils.c testutils.h \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
586 587
qemuxml2argvtest_LDADD = libqemutestdriver.la \
	$(LDADDS) $(LIBXML_LIBS)
588

589 590
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
591
qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
592
qemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
593

594
qemuxml2xmltest_SOURCES = \
595
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
596
	testutils.c testutils.h
597
qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
598 599 600 601

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
602
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
603

604 605 606 607 608
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
609 610
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
611

612 613 614 615 616
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
617 618
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
619

J
Jiri Denemark 已提交
620 621 622 623 624 625 626 627 628 629
qemucapsprobe_SOURCES = \
	qemucapsprobe.c
qemucapsprobe_LDADD = \
	libqemutestdriver.la $(LDADDS)

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

630 631 632 633 634 635 636 637
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)

638 639 640
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
641
	testutilsqemu.c testutilsqemu.h \
642
	$(NULL)
643
qemucaps2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
644

P
Pavel Hrdina 已提交
645 646
qemucaps2xmlmock_la_SOURCES = \
	qemucaps2xmlmock.c
647
qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
648
qemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
649

P
Peter Krempa 已提交
650 651 652 653 654
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
655
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
P
Peter Krempa 已提交
656

657 658 659 660 661
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
662
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
663

664
qemublocktest_SOURCES = \
665 666
	qemublocktest.c \
	testutils.h testutils.c \
667
	testutilsqemu.h testutilsqemu.c \
668 669
	$(NULL)
qemublocktest_LDADD = \
670
	libqemumonitortestutils.la \
671 672 673
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(qemu_LDADDS) \
674
	$(LDADDS) \
675 676
	$(NULL)

677 678 679
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
680
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
681 682 683 684 685 686

qemumemlocktest_SOURCES = \
	qemumemlocktest.c \
	testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemumemlocktest_LDADD = $(qemu_LDADDS) $(LDADDS)
687 688 689 690 691 692 693 694 695

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

696 697 698 699 700 701 702
qemusecuritytest_SOURCES = \
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
	testutils.h testutils.c \
	testutilsqemu.h testutilsqemu.c
qemusecuritytest_LDADD = $(qemu_LDADDS) $(LDADDS)

703 704 705
qemufirmwaretest_SOURCES = \
	qemufirmwaretest.c \
	testutils.h testutils.c \
706
	virfilewrapper.c virfilewrapper.h \
707 708 709
	$(NULL)
qemufirmwaretest_LDADD = $(qemu_LDADDS) $(LDADDS)

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

727 728
if WITH_LXC

E
Eric Blake 已提交
729
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
730
if WITH_NETWORK
E
Eric Blake 已提交
731
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
732
endif WITH_NETWORK
733
lxc_LDADDS += $(LDADDS)
734 735 736 737

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

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

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

758 759 760 761
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
762
esxutilstest_LDADD = $(LDADDS)
763
else ! WITH_ESX
764
EXTRA_DIST += esxutilstest.c
765
endif ! WITH_ESX
766

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

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

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

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

806 807 808 809 810
bhyveargv2xmlmock_la_SOURCES = \
	bhyveargv2xmlmock.c
bhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
bhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)

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

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

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

839 840 841 842 843
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
844 845 846 847 848
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

849
if WITH_NETWORK
850 851
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
852
	testutils.c testutils.h
853
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
854 855 856 857 858 859

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

860
else ! WITH_NETWORK
861
EXTRA_DIST += networkxml2conftest.c
862
endif !	WITH_NETWORK
863

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

876 877 878 879
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
880

881 882 883 884 885
virnwfilterbindingxml2xmltest_SOURCES = \
	virnwfilterbindingxml2xmltest.c \
	testutils.c testutils.h
virnwfilterbindingxml2xmltest_LDADD = $(LDADDS)

886 887 888 889 890
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
891 892 893 894 895 896

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

J
Ján Tomko 已提交
899 900 901 902 903
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
904 905 906 907 908
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
909

910
if WITH_STORAGE
911 912 913 914 915 916 917 918 919 920
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

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

931 932 933 934 935 936 937 938 939 940
storagepoolxml2argvtest_SOURCES = \
    storagepoolxml2argvtest.c \
    testutils.c testutils.h
storagepoolxml2argvtest_LDADD = \
	$(LIBXML_LIBS) \
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(LDADDS)

941 942 943 944 945 946 947
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS) \
	../src/libvirt_driver_storage_impl.la \
	$(GNULIB_LIBS)

948 949 950 951
storagepoolcapstest_SOURCES = \
        storagepoolcapstest.c testutils.h testutils.c
storagepoolcapstest_LDADD = $(LDADDS)

952
else ! WITH_STORAGE
953
EXTRA_DIST += storagevolxml2argvtest.c
954
EXTRA_DIST += virstorageutiltest.c
955
EXTRA_DIST += storagepoolxml2argvtest.c
956
EXTRA_DIST += storagepoolxml2xmltest.c
957
EXTRA_DIST += storagepoolcapstest.c
958
endif ! WITH_STORAGE
959

960 961 962 963 964
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
965 966 967
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
968
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
969

970 971 972 973 974
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

975 976 977
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
978
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Jiri Denemark 已提交
979 980 981 982
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS) $(GNULIB_LIBS)
endif WITH_QEMU
983

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

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

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

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

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

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

1014 1015 1016 1017
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

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

1028
commandhelper_LDFLAGS = -static
1029

1030

1031 1032 1033 1034
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

1035
vircapstest_SOURCES = \
1036 1037 1038 1039 1040 1041 1042
	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
1043
vircapstest_LDADD = $(qemu_LDADDS) $(LDADDS)
1044

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

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

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

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

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

1067 1068
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1069
virnetmessagetest_LDADD = $(LDADDS)
1070

1071 1072
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1073
virnetsockettest_LDADD = $(LDADDS)
1074

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

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

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

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
1092
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1093
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1094

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

1114 1115
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1116
virtimetest_LDADD = $(LDADDS)
1117

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

1122 1123 1124 1125
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

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

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

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

1149 1150 1151 1152
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1153 1154 1155 1156
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1157 1158 1159 1160
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

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

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

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

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
1176
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1177
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1178

1179 1180 1181 1182
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1183 1184 1185 1186
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

test_libraries += virdeterministichashmock.la
1285

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

1291
test_programs += virmacmaptest
1292
else ! WITH_YAJL
1293
EXTRA_DIST +=  virmacmaptest.c
1294
endif ! WITH_YAJL
1295

M
Michal Privoznik 已提交
1296 1297 1298 1299 1300 1301 1302 1303
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)
1304
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1305
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1306

1307 1308 1309 1310
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

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

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

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

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
1328
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1329
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1330

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

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

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

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

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

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

1370 1371
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1372
viruritest_LDADD = $(LDADDS)
1373

1374 1375
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1376
virkeyfiletest_LDADD = $(LDADDS)
1377

1378 1379 1380 1381
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1382 1383
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1384
virauthconfigtest_LDADD = $(LDADDS)
1385

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

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

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1400
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1401 1402 1403

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

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

1421 1422 1423 1424
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

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

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

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

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

1441 1442 1443 1444
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

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

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

1454 1455 1456
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1457

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

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

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

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

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

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

1487 1488 1489 1490
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1491 1492 1493 1494
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

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

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


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

1510 1511 1512 1513
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1514 1515
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1516
EXTRA_DIST += scsihosttest.c
1517 1518
endif  ! WITH_LINUX

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

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

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

M
Martin Kletzander 已提交
1534
objectlocking_SOURCES = objectlocking.ml
1535 1536 1537 1538

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

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

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

1546
else ! WITH_CIL
1547
EXTRA_DIST += objectlocking.ml
1548
endif ! WITH_CIL
1549

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