Makefile.am 37.0 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_topbuilddir = $(shell cd .. && pwd)
22
abs_srcdir = $(shell cd $(srcdir) && pwd)
23
abs_topsrcdir = $(shell cd $(top_srcdir) && pwd)
24

25 26
SHELL = $(PREFERABLY_POSIX_SHELL)

K
Karel Zak 已提交
27
INCLUDES = \
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 34
	-I$(top_srcdir)/src/conf \
	$(GETTEXT_CPPFLAGS)
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_topbuilddir="\"$(abs_topbuilddir)\"" \
41
	-Dabs_srcdir="\"$(abs_srcdir)\"" \
42
	-Dabs_topsrcdir="\"$(abs_topsrcdir)\"" \
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 62 63 64 65
QEMULIB_LDFLAGS = \
	-avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
	$(MINGW_EXTRA_LDFLAGS)

66 67 68
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"

69
PROBES_O =
70
if WITH_DTRACE_PROBES
71
PROBES_O += ../src/libvirt_probes.lo
72
endif WITH_DTRACE_PROBES
73

74 75 76
GNULIB_LIBS = \
       ../gnulib/lib/libgnu.la

K
Karel Zak 已提交
77
LDADDS = \
78
	$(NO_INDIRECT_LDFLAGS) \
79
	$(PROBES_O) \
80 81
	$(GNULIB_LIBS) \
	../src/libvirt.la
K
Karel Zak 已提交
82

83 84 85
MOCKLIBS_LIBS = \
	$(GNULIB_LIBS)

86
EXTRA_DIST = \
87
	.valgrind.supp \
R
Roman Bogorodskiy 已提交
88
	bhyvexml2argvdata \
89
	bhyveargv2xmldata \
90
	bhyvexml2xmloutdata \
91
	capabilityschemadata \
E
Eric Blake 已提交
92 93
	commanddata \
	cputestdata \
M
Michal Privoznik 已提交
94
	domaincapsschemadata \
95
	domainconfdata \
96
	domainschemadata \
E
Eric Blake 已提交
97 98
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
O
Osier Yang 已提交
99
	fchostdata \
C
Cole Robinson 已提交
100 101
	genericxml2xmlindata \
	genericxml2xmloutdata \
102
	interfaceschemadata \
103
	libxlxml2domconfigdata \
104
	lxcconf2xmldata \
105
	lxcxml2xmldata \
106
	lxcxml2xmloutdata \
107 108
	networkxml2confdata \
	networkxml2firewalldata \
E
Eric Blake 已提交
109 110
	networkxml2xmlin \
	networkxml2xmlout \
J
Ján Tomko 已提交
111 112
	networkxml2xmlupdatein \
	networkxml2xmlupdateout \
E
Eric Blake 已提交
113
	nodedevschemadata \
114
	virhostcpudata \
M
Michal Privoznik 已提交
115
	nssdata \
116
	nwfilterxml2firewalldata \
E
Eric Blake 已提交
117 118 119
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
120
	qemuagentdata \
121
	qemuargv2xmldata \
122
	qemucapabilitiesdata \
123
	qemucaps2xmldata \
124
	qemuhotplugtestcpus \
125 126
	qemuhotplugtestdevices \
	qemuhotplugtestdomains \
127
	qemumigparamsdata \
128
	qemumonitorjsondata \
E
Eric Blake 已提交
129
	qemuxml2argvdata \
130
	qemuxml2startupxmloutdata \
E
Eric Blake 已提交
131
	qemuxml2xmloutdata \
132
	qemustatusxml2xmldata \
133
	qemuqapischema.json \
134
	qemumemlockdata \
J
Ján Tomko 已提交
135
	secretxml2xmlin \
136
	securityselinuxhelperdata \
137
	securityselinuxlabeldata \
E
Eric Blake 已提交
138
	sexpr2xmldata \
139
	storagepoolschemadata \
140
	storagepoolxml2xmlin \
E
Eric Blake 已提交
141
	storagepoolxml2xmlout \
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
	virpcitestdata \
O
Osier Yang 已提交
159
	virscsidata \
160
	virsh-uriprecedence \
161
	virusbtestdata \
162
	vmwareverdata \
163
	vmx2xmldata \
164
	xlconfigdata \
165
	xmconfigdata \
E
Eric Blake 已提交
166
	xml2sexprdata \
167 168
	xml2vmxdata \
	virstorageutildata \
169
	virfilecachedata \
M
Martin Kletzander 已提交
170
	virresctrldata \
171
	$(NULL)
K
Karel Zak 已提交
172

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

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

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

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

246 247 248 249
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

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

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

270 271 272
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
273

274
if WITH_LIBXL
275
test_programs += xlconfigtest xml2sexprtest sexpr2xmltest \
276
	xmconfigtest libxlxml2domconfigtest
277
test_libraries += virmocklibxl.la
278 279
endif WITH_LIBXL

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

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

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

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

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

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

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

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

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

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

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

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

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

353
test_programs += nwfilterxml2xmltest
354

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

360
if WITH_STORAGE
361
test_programs += storagevolxml2argvtest
362
test_programs += virstorageutiltest
363
endif WITH_STORAGE
364

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

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

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

379
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
380

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

383
test_programs += interfacexml2xmltest
384

385
test_programs += cputest
386

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

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

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

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

J
Ján Tomko 已提交
399
test_scripts =
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415
libvirtd_test_scripts = \
	libvirtd-fail \
	libvirtd-pool \
	virsh-cpuset \
	virsh-define-dev-segfault \
	virsh-int-overflow \
	virsh-optparse \
	virsh-read-bufsiz \
	virsh-read-non-seekable \
	virsh-schedinfo \
	virsh-self-test \
	virt-admin-self-test \
	virsh-start \
	virsh-undefine \
	virsh-uriprecedence \
	virsh-vcpupin \
416
	$(NULL)
417

418 419 420
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

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

428 429
test_programs += objecteventtest

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

437 438
EXTRA_DIST += $(test_scripts)

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

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

460 461
TESTS = $(test_programs) \
	$(test_scripts)
462

463
# NB, automake < 1.10 does not provide the real
464
# abs_top_{src/build}dir or builddir variables, so don't rely
465
# on them here. Fake them with 'pwd'
466 467 468
# 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

469
lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd)
470

471
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
472 473 474 475 476 477 478
TESTS_ENVIRONMENT = \
  abs_top_builddir=$(lv_abs_top_builddir) \
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd` \
  abs_builddir=$(abs_builddir) \
  abs_srcdir=$(abs_srcdir) \
  CONFIG_HEADER="$(lv_abs_top_builddir)/config.h" \
  SHELL="$(SHELL)" \
479
  LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \
480 481 482
  LIBVIRT_AUTOSTART=0 \
  LC_ALL=C \
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \
483 484
  $(VG)

485

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

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

497 498
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
499 500 501
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
502 503 504 505 506 507
libxl_LDADDS += $(LDADDS)

xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
508

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

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

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

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

virmocklibxl_la_SOURCES = \
	virmocklibxl.c
531
virmocklibxl_la_CFLAGS = $(LIBXL_CFLAGS)
532 533 534
virmocklibxl_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virmocklibxl_la_LIBADD = $(MOCKLIBS_LIBS)

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

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

546
if WITH_QEMU
547

548 549
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

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

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

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

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

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

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
589
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
590

591 592 593 594 595 596
qemumonitortest_SOURCES = \
	qemumonitortest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h
qemumonitortest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
597

598 599 600 601 602
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
603 604
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
605

606 607 608 609 610
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
611 612
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
613

J
Jiri Denemark 已提交
614 615 616 617 618 619 620 621 622 623
qemucapsprobe_SOURCES = \
	qemucapsprobe.c
qemucapsprobe_LDADD = \
	libqemutestdriver.la $(LDADDS)

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

624 625 626 627 628 629 630 631
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)

632 633 634 635
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
	$(NULL)
636
qemucaps2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
637

P
Pavel Hrdina 已提交
638 639
qemucaps2xmlmock_la_SOURCES = \
	qemucaps2xmlmock.c
640
qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
641
qemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
642

P
Peter Krempa 已提交
643 644 645 646 647
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
648
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
P
Peter Krempa 已提交
649

650 651 652 653 654
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
655
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
656

657 658 659 660 661 662 663 664 665
qemublocktest_SOURCES = \
	qemublocktest.c testutils.h testutils.c
qemublocktest_LDADD = $(LDADDS) \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(qemu_LDADDS) \
	../gnulib/lib/libgnu.la \
	$(NULL)

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

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

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

685
else ! WITH_QEMU
686
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
J
Ján Tomko 已提交
687
	domainsnapshotxml2xmltest.c \
688
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
689
	testutilsqemuschema.c testutilsqemuschema.h \
690
	qemumonitorjsontest.c qemuhotplugtest.c \
691
	qemuagenttest.c qemucapabilitiestest.c \
692
	qemucaps2xmltest.c qemucommandutiltest.c \
693
	qemumemlocktest.c qemucpumock.c testutilshostcpus.h \
694
	qemublocktest.c \
695
	qemumigparamstest.c \
696
	$(QEMUMONITORTESTUTILS_SOURCES)
697
endif ! WITH_QEMU
698

699 700
if WITH_LXC

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

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
710
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
711 712

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

832
else ! WITH_NETWORK
833
EXTRA_DIST += networkxml2conftest.c
834
endif !	WITH_NETWORK
835

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

848 849 850 851
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
852

853 854 855 856 857
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
858 859 860 861 862 863

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

J
Ján Tomko 已提交
866 867 868 869 870
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
871 872 873 874 875
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
876

877
if WITH_STORAGE
878 879 880 881 882 883 884 885 886 887
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

888 889 890 891
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
892
	$(LIBXML_LIBS) \
893 894 895 896
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(LDADDS)
J
Ján Tomko 已提交
897

898
else ! WITH_STORAGE
899
EXTRA_DIST += storagevolxml2argvtest.c
900
EXTRA_DIST += virstorageutiltest.c
901
endif ! WITH_STORAGE
902

903 904 905 906 907
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

908 909 910 911 912
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
913 914 915
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
916
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
917

918 919 920 921 922
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

923 924 925
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
926
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Jiri Denemark 已提交
927 928 929 930
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS) $(GNULIB_LIBS)
endif WITH_QEMU
931

P
Peter Krempa 已提交
932 933 934 935 936
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

937 938 939 940 941
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

942
virconftest_SOURCES = \
943
	virconftest.c testutils.h testutils.c
944
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
945

946
virhostcputest_SOURCES = \
947
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
948
virhostcputest_LDADD = $(LDADDS)
949

950 951 952 953
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

954 955 956 957
# 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
958 959
commandhelper_SOURCES = \
	commandhelper.c
960 961 962 963
commandhelper_LDADD = \
	$(NO_INDIRECT_LDFLAGS) \
	$(GNULIB_LIBS)

964
commandhelper_LDFLAGS = -static
965

966

967 968 969 970
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

971
vircapstest_SOURCES = \
972 973 974 975 976 977 978
	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
979
vircapstest_LDADD = $(qemu_LDADDS) $(LDADDS)
980

981 982 983 984
domaincapsmock_la_SOURCES = domaincapsmock.c
domaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
domaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
985 986 987 988
domaincapstest_SOURCES = \
	domaincapstest.c testutils.h testutils.c
domaincapstest_LDADD = $(LDADDS)

989 990
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
991
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
992 993
endif WITH_QEMU

994 995
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
996
domaincapstest_LDADD += ../src/libvirt_driver_libxl_impl.la $(GNULIB_LIBS)
997 998
endif WITH_LIBXL

999 1000 1001 1002
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

1003 1004
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1005
virnetmessagetest_LDADD = $(LDADDS)
1006

1007 1008
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1009
virnetsockettest_LDADD = $(LDADDS)
1010

1011 1012
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1013
	testutils.h testutils.c
1014
virnetdaemontest_LDADD = $(LDADDS)
1015

1016 1017 1018 1019 1020
virnetdaemonmock_la_SOURCES = \
	virnetdaemonmock.c
virnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)

1021 1022 1023 1024 1025 1026 1027
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
1028
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1029
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1030

1031
if WITH_GNUTLS
1032
virnettlscontexttest_SOURCES = \
1033 1034 1035
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1036
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
1037 1038 1039 1040
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1041
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
1042 1043 1044
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
1045 1046
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
1047
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
1048
EXTRA_DIST += pkix_asn1_tab.c
1049 1050
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
1051
EXTRA_DIST += \
1052 1053 1054
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
1055
endif ! WITH_GNUTLS
1056

1057 1058
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1059
virtimetest_LDADD = $(LDADDS)
1060

J
Ján Tomko 已提交
1061 1062
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1063
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1064

1065 1066 1067 1068
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1069 1070
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1071 1072 1073 1074 1075 1076 1077
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)
1078

1079 1080 1081
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1082
if WITH_SELINUX
1083
viridentitytest_LDADD += $(SELINUX_LIBS)
1084 1085 1086
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1087

J
Ján Tomko 已提交
1088 1089 1090 1091
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1092 1093 1094 1095
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1096 1097 1098 1099
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1100 1101 1102 1103
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1104 1105 1106 1107
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1108
virportallocatormock_la_SOURCES = \
1109
	virportallocatormock.c
1110 1111
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1112

1113 1114 1115 1116 1117 1118
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
1119
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1120
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1121

1122 1123 1124 1125
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1126 1127 1128 1129
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1130 1131 1132 1133 1134 1135
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
1136
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1137
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1138

J
John Ferlan 已提交
1139 1140 1141 1142 1143
virrandommock_la_SOURCES = \
	virrandommock.c
virrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virrandommock_la_LIBADD = $(MOCKLIBS_LIBS)

1144 1145 1146 1147
virhostcpumock_la_SOURCES = \
	virhostcpumock.c
virhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1148

P
Pavel Hrdina 已提交
1149 1150 1151 1152 1153
virfilecachemock_la_SOURCES = \
	virfilecachemock.c
virfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)

1154 1155
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1156
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1157 1158
vircaps2xmltest_LDADD = $(LDADDS)

M
Martin Kletzander 已提交
1159 1160 1161 1162
virnumamock_la_SOURCES = \
	virnumamock.c
virnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1163

M
Martin Kletzander 已提交
1164 1165 1166 1167
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

1168
else ! WITH_LINUX
M
Martin Kletzander 已提交
1169 1170
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \
			  virfilewrapper.h virresctrltest.c
1171
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1172

1173
if WITH_NSS
M
Michal Privoznik 已提交
1174 1175 1176
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
1177
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1178 1179
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
1180
	$(LDADDS) \
M
Michal Privoznik 已提交
1181 1182
	../tools/nss/libnss_libvirt_impl.la

1183 1184 1185
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
1186 1187
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1188 1189
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
1190
	$(LDADDS) \
1191 1192
	../tools/nss/libnss_libvirt_guest_impl.la

M
Michal Privoznik 已提交
1193 1194 1195 1196 1197
nssmock_la_SOURCES = \
	nssmock.c
nssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
nssmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1198 1199 1200
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
1201 1202
nsslinktest_CFLAGS = \
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1203 1204 1205 1206
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

1207
nssguestlinktest_SOURCES = nsslinktest.c
1208 1209 1210
nssguestlinktest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1211 1212 1213
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1214 1215 1216
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1217

1218 1219 1220 1221 1222 1223
virdeterministichashmock_la_SOURCES = \
	virdeterministichashmock.c
virdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)

test_libraries += virdeterministichashmock.la
1224

1225
if WITH_YAJL
1226 1227 1228 1229
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

1230 1231
test_programs += virmacmaptest
else ! WITH_YAJL
1232
EXTRA_DIST +=  virmacmaptest.c
1233 1234
endif ! WITH_YAJL

M
Michal Privoznik 已提交
1235 1236 1237 1238 1239 1240 1241 1242
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)
1243
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1244
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1245

1246 1247 1248 1249
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

1250 1251 1252 1253 1254
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1255 1256 1257 1258
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1259
virusbmock_la_SOURCES = virusbmock.c
1260
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1261
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1262
	$(PROBES_O) \
1263
	../src/libvirt_util.la
1264 1265 1266

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
1267
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1268
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1269

1270 1271 1272
virtestmock_la_SOURCES = \
	virtestmock.c
virtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1273 1274
virtestmock_la_LIBADD = \
	$(MOCKLIBS_LIBS) \
1275
	$(PROBES_O) \
1276
	../src/libvirt_util.la
1277
else ! WITH_LINUX
1278
	EXTRA_DIST += virusbtest.c virusbmock.c \
1279 1280
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1281 1282
endif ! WITH_LINUX

1283 1284 1285 1286
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1287
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1288

1289 1290 1291 1292 1293
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1294

1295 1296 1297 1298 1299
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1300 1301
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1302
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1303
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1304

1305
else ! WITH_DBUS
1306
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1307
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1308

1309 1310
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1311
viruritest_LDADD = $(LDADDS)
1312

1313 1314
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1315
virkeyfiletest_LDADD = $(LDADDS)
1316

1317 1318 1319 1320
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1321 1322
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1323
virauthconfigtest_LDADD = $(LDADDS)
1324

1325
seclabeltest_SOURCES = \
1326
	seclabeltest.c testutils.h testutils.c
1327
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1328

1329
if WITH_SECDRIVER_SELINUX
1330
if WITH_ATTR
1331 1332
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1333
else ! WITH_TESTS
1334
check_LTLIBRARIES += libsecurityselinuxhelper.la
1335
endif ! WITH_TESTS
1336 1337 1338

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1339
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1340 1341 1342

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1343
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1344 1345
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1346 1347 1348 1349 1350

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1351
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(LDADDS) $(SELINUX_LIBS)
1352 1353
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1354 1355 1356
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1357 1358
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1359

1360 1361 1362 1363
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1364 1365 1366
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1367

1368
viratomictest_SOURCES = \
L
Laine Stump 已提交
1369
	viratomictest.c testutils.h testutils.c
1370 1371
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1372 1373 1374 1375
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1376 1377 1378 1379
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1380 1381 1382 1383
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1384 1385 1386 1387
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1388 1389
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1390
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1391 1392
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1393 1394 1395
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1396

M
Matthias Bolte 已提交
1397 1398 1399 1400
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1401
if WITH_LIBVIRTD
1402 1403 1404
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1405
endif WITH_LIBVIRTD
1406

1407 1408
if WITH_LIBVIRTD
eventtest_SOURCES = \
1409
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1410
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1411
endif WITH_LIBVIRTD
1412

1413 1414
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1415
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1416 1417 1418

shunloadtest_SOURCES = \
	shunloadtest.c
1419
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1420 1421
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1422 1423 1424 1425
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1426 1427 1428 1429
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1430 1431 1432 1433
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1434 1435 1436 1437 1438
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1439 1440 1441 1442 1443
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1444
if WITH_LINUX
O
Osier Yang 已提交
1445 1446 1447 1448
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1449 1450 1451 1452
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1453 1454
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1455
EXTRA_DIST += scsihosttest.c
1456 1457
endif  ! WITH_LINUX

O
Osier Yang 已提交
1458 1459 1460 1461 1462 1463 1464 1465 1466
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1467 1468 1469 1470 1471 1472
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1473
objectlocking_SOURCES = objectlocking.ml
1474 1475 1476 1477

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

1478
objectlocking: objectlocking.cmx objectlocking-files.txt
1479 1480
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1481

1482
objectlocking-files.txt:
1483 1484
	find $(top_builddir)/src/ -name '*.i' > $@

1485
else ! WITH_CIL
1486
EXTRA_DIST += objectlocking.ml
1487
endif ! WITH_CIL
1488

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