Makefile.am 37.2 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 51
	$(COVERAGE_CFLAGS) \
	$(WARN_CFLAGS)
52

53 54 55
AM_LDFLAGS = \
	-export-dynamic

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

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

65 66 67
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
68
endif WITH_DRIVER_MODULES
69

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

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

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

84 85 86
MOCKLIBS_LIBS = \
	$(GNULIB_LIBS)

87
EXTRA_DIST =		\
88
	.valgrind.supp \
R
Roman Bogorodskiy 已提交
89
	bhyvexml2argvdata \
90
	bhyveargv2xmldata \
91
	bhyvexml2xmloutdata \
92
	capabilityschemadata \
E
Eric Blake 已提交
93 94
	commanddata \
	cputestdata \
M
Michal Privoznik 已提交
95
	domaincapsschemadata \
96
	domainconfdata \
97
	domainschemadata \
E
Eric Blake 已提交
98 99
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
O
Osier Yang 已提交
100
	fchostdata \
C
Cole Robinson 已提交
101 102
	genericxml2xmlindata \
	genericxml2xmloutdata \
103
	interfaceschemadata \
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 \
E
Eric Blake 已提交
124
	qemuhelpdata \
125
	qemuhotplugtestcpus \
126 127
	qemuhotplugtestdevices \
	qemuhotplugtestdomains \
128
	qemumonitorjsondata \
E
Eric Blake 已提交
129 130
	qemuxml2argvdata \
	qemuxml2xmloutdata \
131
	qemumemlockdata \
J
Ján Tomko 已提交
132
	secretxml2xmlin \
133
	securityselinuxhelperdata \
134
	securityselinuxlabeldata \
E
Eric Blake 已提交
135
	sexpr2xmldata \
136
	storagepoolschemadata \
137
	storagepoolxml2xmlin \
E
Eric Blake 已提交
138
	storagepoolxml2xmlout \
139
	storagevolschemadata \
140
	storagevolxml2argvdata \
141
	storagevolxml2xmlin \
E
Eric Blake 已提交
142
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
143
	sysinfodata \
E
Eric Blake 已提交
144
	test-lib.sh	\
Y
Yohan BELLEGUIC 已提交
145
	vboxsnapshotxmldata \
146
	vircaps2xmldata \
147
	vircgroupdata \
148
	virconfdata \
149
	virfiledata \
150
	virjsondata \
151
	virmacmaptestdata \
152
	virmock.h \
153
	virnetdaemondata \
154
	virnetdevtestdata \
155
	virpcitestdata \
O
Osier Yang 已提交
156
	virscsidata \
157
	virsh-uriprecedence \
158
	virusbtestdata \
159
	vmwareverdata \
160
	vmx2xmldata \
E
Eric Blake 已提交
161
	xencapsdata \
162
	xlconfigdata \
163
	xmconfigdata \
E
Eric Blake 已提交
164
	xml2sexprdata \
165 166 167
	xml2vmxdata \
	virstorageutildata \
	$(NULL)
K
Karel Zak 已提交
168

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

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

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

230 231
if WITH_LINUX
test_programs += fchosttest
232
test_programs += scsihosttest
233
test_programs += vircaps2xmltest
234 235
test_libraries += virusbmock.la \
	virnetdevbandwidthmock.la \
236
	virnumamock.la \
237 238
	virtestmock.la \
	$(NULL)
239 240
endif WITH_LINUX

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

245
if WITH_DBUS
246
test_programs += virdbustest \
247 248
                 virsystemdtest \
                 $(NULL)
249
test_libraries += virdbusmock.la
250 251 252
if WITH_POLKIT1
test_programs += virpolkittest
endif WITH_POLKIT1
253
endif WITH_DBUS
254

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

265 266
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
267
endif WITH_DRIVER_MODULES
268

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

273
if WITH_XEN
274
test_programs += xml2sexprtest sexpr2xmltest \
275
	xmconfigtest xencapstest
276
endif WITH_XEN
277 278 279 280 281

if WITH_LIBXL
test_programs += xlconfigtest
endif WITH_LIBXL

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

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

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

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

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

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

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

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

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

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

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

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

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

352
test_programs += nwfilterxml2xmltest
353

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

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

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

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

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

378
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
379

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

382
test_programs += interfacexml2xmltest
383

384
test_programs += cputest
385

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

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

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

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

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

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

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

426 427
test_programs += objecteventtest

J
Jamie Strandboge 已提交
428 429
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
430
else ! WITH_SECDRIVER_APPARMOR
431
EXTRA_DIST += virt-aa-helper-test
432
endif ! WITH_SECDRIVER_APPARMOR
433

434 435
EXTRA_DIST += $(test_scripts)

436 437 438 439 440 441 442 443 444 445 446 447 448
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

449 450
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
451
noinst_LTLIBRARIES = $(test_libraries)
452
else ! WITH_TESTS
453
check_PROGRAMS = $(test_programs) $(test_helpers)
454
check_LTLIBRARIES = $(test_libraries)
455
endif ! WITH_TESTS
456

457 458
TESTS = $(test_programs) \
	$(test_scripts)
459

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

466
lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd)
467

468
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
469
TESTS_ENVIRONMENT =				\
470
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
471
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
472 473 474
  abs_builddir=$(abs_builddir)			\
  abs_srcdir=$(abs_srcdir)			\
  CONFIG_HEADER="$(lv_abs_top_builddir)/config.h"	\
475
  SHELL="$(SHELL)"				\
476
  LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \
477
  LIBVIRT_AUTOSTART=0				\
478
  LC_ALL=C					\
479
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE)	\
480 481
  $(VG)

482

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

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

494
if WITH_XEN
E
Eric Blake 已提交
495
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
496 497
xen_LDADDS += $(LDADDS)

498
xml2sexprtest_SOURCES = \
499
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
500
	testutils.c testutils.h
501
xml2sexprtest_LDADD = $(xen_LDADDS)
502 503

sexpr2xmltest_SOURCES = \
504
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
505
	testutils.c testutils.h
506
sexpr2xmltest_LDADD = $(xen_LDADDS)
507

508
xmconfigtest_SOURCES = \
509
	xmconfigtest.c testutilsxen.c testutilsxen.h \
510
	testutils.c testutils.h
511
xmconfigtest_LDADD = $(xen_LDADDS)
512

513 514
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
515
xencapstest_LDADD = $(xen_LDADDS)
516

517
else ! WITH_XEN
518
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
519
	xencapstest.c \
520
	testutilsxen.c testutilsxen.h
521
endif ! WITH_XEN
522

523 524
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
525 526 527
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
528 529 530 531 532 533 534 535 536 537
libxl_LDADDS += $(LDADDS)

xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
else ! WITH_LIBXL
EXTRA_DIST += xlconfigtest.c
endif ! WITH_LIBXL

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

543
if WITH_QEMU
544

545 546
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

558 559 560 561
libqemutestdriver_la_SOURCES =
libqemutestdriver_la_LDFLAGS = $(QEMULIB_LDFLAGS)
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)

562
qemucpumock_la_SOURCES = \
563
	qemucpumock.c testutilshostcpus.h
564 565 566 567
qemucpumock_la_CFLAGS = $(AM_CFLAGS)
qemucpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
qemucpumock_la_LIBADD = $(MOCKLIBS_LIBS)

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

573 574 575
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
qemuxml2argvmock_la_CFLAGS = $(AM_CFLAGS)
576
qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
577
qemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
578

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

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

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
590
qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
591

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

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

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

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

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

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

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

P
Pavel Hrdina 已提交
640 641 642
qemucaps2xmlmock_la_SOURCES = \
	qemucaps2xmlmock.c
qemucaps2xmlmock_la_CFLAGS = $(AM_CFLAGS)
643
qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
644
qemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
645

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

653 654 655 656 657
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
658
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
659

660 661 662
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
663
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
664 665 666 667 668 669

qemumemlocktest_SOURCES = \
	qemumemlocktest.c \
	testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemumemlocktest_LDADD = $(qemu_LDADDS) $(LDADDS)
670
else ! WITH_QEMU
671
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
J
Jiri Denemark 已提交
672
	qemuhelptest.c domainsnapshotxml2xmltest.c \
673
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
674
	qemumonitorjsontest.c qemuhotplugtest.c \
675
	qemuagenttest.c qemucapabilitiestest.c \
676
	qemucaps2xmltest.c qemucommandutiltest.c \
677
	qemumemlocktest.c qemucpumock.c testutilshostcpus.h \
678
	$(QEMUMONITORTESTUTILS_SOURCES)
679
endif ! WITH_QEMU
680

681 682
if WITH_LXC

E
Eric Blake 已提交
683
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
684
if WITH_NETWORK
E
Eric Blake 已提交
685
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
686
endif WITH_NETWORK
687
lxc_LDADDS += $(LDADDS)
688 689 690 691

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
692
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
693 694

lxcconf2xmltest_SOURCES = \
695
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
696 697
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
698
else ! WITH_LXC
699
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
700
endif ! WITH_LXC
701

702 703 704 705
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
706
openvzutilstest_LDADD = $(LDADDS)
707
else ! WITH_OPENVZ
708
EXTRA_DIST += openvzutilstest.c
709
endif ! WITH_OPENVZ
710 711
EXTRA_DIST += openvzutilstest.conf

712 713 714 715
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
716
esxutilstest_LDADD = $(LDADDS)
717
else ! WITH_ESX
718
EXTRA_DIST += esxutilstest.c
719
endif ! WITH_ESX
720

Y
Yohan BELLEGUIC 已提交
721 722 723 724 725 726 727 728 729 730
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

731
if WITH_VMX
732 733 734
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
735
vmx2xmltest_LDADD = $(LDADDS)
736 737 738 739

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
740
xml2vmxtest_LDADD = $(LDADDS)
741
else ! WITH_VMX
742
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
743
endif ! WITH_VMX
744

745 746 747 748 749 750 751 752 753
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 已提交
754 755 756 757
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
bhyvexml2argvmock_la_CFLAGS = $(AM_CFLAGS)
758
bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
759
bhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
760

761 762 763 764 765 766
bhyveargv2xmlmock_la_SOURCES = \
	bhyveargv2xmlmock.c
bhyveargv2xmlmock_la_CFLAGS = $(AM_CFLAGS)
bhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
bhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)

R
Roman Bogorodskiy 已提交
767
bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
R
Roman Bogorodskiy 已提交
768 769 770
if WITH_STORAGE
bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
R
Roman Bogorodskiy 已提交
771 772 773 774 775
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
776 777 778 779 780

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
781 782 783 784 785

bhyveargv2xmltest_SOURCES = \
	bhyveargv2xmltest.c \
	testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
786
else ! WITH_BHYVE
787 788 789 790 791 792
EXTRA_DIST += \
	bhyvexml2argvtest.c \
	bhyveargv2xmltest.c \
	bhyvexml2xmltest.c \
	bhyvexml2argvmock.c \
	bhyveargv2xmlmock.c
R
Roman Bogorodskiy 已提交
793 794
endif ! WITH_BHYVE

795 796 797 798 799
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
800 801 802 803 804
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

805
if WITH_NETWORK
806 807
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
808
	testutils.c testutils.h
809
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
810 811 812 813 814 815

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

816
else ! WITH_NETWORK
817
EXTRA_DIST += networkxml2conftest.c
818
endif !	WITH_NETWORK
819

820 821 822 823
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
824
storagebackendsheepdogtest_LDADD = \
825 826 827
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_storage_backend_sheepdog_priv.la \
	$(LDADDS)
828
else ! WITH_STORAGE_SHEEPDOG
829
EXTRA_DIST += storagebackendsheepdogtest.c
830
endif ! WITH_STORAGE_SHEEPDOG
831

832 833 834 835
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
836

837 838 839 840 841
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
842 843 844 845 846 847

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

J
Ján Tomko 已提交
850 851 852 853 854
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
855 856 857 858 859
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
860

861
if WITH_STORAGE
862 863 864 865 866 867 868 869 870 871
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

872 873 874 875
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
876
	$(LIBXML_LIBS) \
877
	../src/libvirt_driver_storage_impl.la $(LDADDS)
J
Ján Tomko 已提交
878

879
else ! WITH_STORAGE
880
EXTRA_DIST += storagevolxml2argvtest.c
881
EXTRA_DIST += virstorageutiltest.c
882
endif ! WITH_STORAGE
883

884 885 886 887 888
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

889 890 891 892 893
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
894 895 896
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
897
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
898

899 900 901 902 903
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

904 905 906
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
907
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Jiri Denemark 已提交
908 909 910 911
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS) $(GNULIB_LIBS)
endif WITH_QEMU
912

P
Peter Krempa 已提交
913 914 915 916 917
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

918 919 920 921 922
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

923
virconftest_SOURCES = \
924
	virconftest.c testutils.h testutils.c
925
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
926

927
virhostcputest_SOURCES = \
928
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
929
virhostcputest_LDADD = $(LDADDS)
930

931 932 933 934 935 936
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
937 938 939 940 941 942
commandhelper_LDADD = \
	$(NO_INDIRECT_LDFLAGS) \
	$(PROBES_O) \
	../src/libvirt_util.la \
	$(GNULIB_LIBS)

943
commandhelper_LDFLAGS = -static
944

945

946 947 948 949
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

950
vircapstest_SOURCES = \
951 952 953 954 955 956 957 958 959 960
	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
if WITH_XEN
vircapstest_SOURCES += testutilsxen.c testutilsxen.h
endif WITH_XEN
961
vircapstest_LDADD = $(qemu_LDADDS) $(LDADDS)
962

963 964 965 966 967
domaincapsmock_la_SOURCES = domaincapsmock.c
domaincapsmock_la_CFLAGS = $(AM_CFLAGS)
domaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
domaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
968 969 970 971
domaincapstest_SOURCES = \
	domaincapstest.c testutils.h testutils.c
domaincapstest_LDADD = $(LDADDS)

972 973
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
974
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
975 976
endif WITH_QEMU

977 978
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
979
domaincapstest_LDADD += ../src/libvirt_driver_libxl_impl.la $(GNULIB_LIBS)
980 981
endif WITH_LIBXL

982 983 984 985
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

986 987
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
988
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
989
virnetmessagetest_LDADD = $(LDADDS)
990

991 992
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
993
virnetsockettest_LDADD = $(LDADDS)
994

995 996
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
997
	testutils.h testutils.c
998 999
virnetdaemontest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
virnetdaemontest_LDADD = $(LDADDS)
1000

1001 1002 1003 1004 1005 1006
virnetdaemonmock_la_SOURCES = \
	virnetdaemonmock.c
virnetdaemonmock_la_CFLAGS = $(AM_CFLAGS)
virnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)

1007 1008 1009
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
1010
virnetserverclienttest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
1011 1012 1013 1014 1015
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
virnetserverclientmock_la_CFLAGS = $(AM_CFLAGS)
1016
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1017
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1018

1019
if WITH_GNUTLS
1020
virnettlscontexttest_SOURCES = \
1021 1022 1023
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1024
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
1025 1026 1027 1028
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1029
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
1030 1031 1032
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
1033 1034
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
1035
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
1036
EXTRA_DIST += pkix_asn1_tab.c
1037 1038
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
1039
EXTRA_DIST += \
1040 1041 1042
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
1043
endif ! WITH_GNUTLS
1044

1045 1046
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1047
virtimetest_LDADD = $(LDADDS)
1048

J
Ján Tomko 已提交
1049 1050
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1051
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1052

1053 1054 1055 1056
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1057 1058
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1059 1060 1061 1062 1063 1064 1065
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)
1066

1067 1068 1069
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1070
if WITH_SELINUX
1071
viridentitytest_LDADD += $(SELINUX_LIBS)
1072 1073 1074
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1075

J
Ján Tomko 已提交
1076 1077 1078 1079
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1080 1081 1082 1083
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1084 1085 1086 1087
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1088 1089 1090 1091
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1092 1093 1094 1095
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1096
virportallocatormock_la_SOURCES = \
1097
	virportallocatormock.c
1098 1099 1100
virportallocatormock_la_CFLAGS = $(AM_CFLAGS)
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1101

1102 1103 1104 1105 1106 1107 1108
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
1109
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1110
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1111

1112 1113 1114 1115
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1116 1117 1118 1119
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1120 1121 1122 1123 1124 1125 1126
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
1127
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1128
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1129

J
John Ferlan 已提交
1130 1131 1132 1133 1134 1135
virrandommock_la_SOURCES = \
	virrandommock.c
virrandommock_la_CFLAGS = $(AM_CFLAGS)
virrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virrandommock_la_LIBADD = $(MOCKLIBS_LIBS)

1136 1137 1138 1139 1140
virhostcpumock_la_SOURCES = \
	virhostcpumock.c
virhostcpumock_la_CFLAGS = $(AM_CFLAGS)
virhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1141

P
Pavel Hrdina 已提交
1142 1143 1144 1145 1146 1147
virfilecachemock_la_SOURCES = \
	virfilecachemock.c
virfilecachemock_la_CFLAGS = $(AM_CFLAGS)
virfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)

1148 1149
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1150
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1151 1152
vircaps2xmltest_LDADD = $(LDADDS)

M
Martin Kletzander 已提交
1153 1154 1155 1156 1157
virnumamock_la_SOURCES = \
	virnumamock.c
virnumamock_la_CFLAGS = $(AM_CFLAGS)
virnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1158

1159
else ! WITH_LINUX
1160
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c virfilewrapper.h
1161
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1162

1163
if WITH_NSS
M
Michal Privoznik 已提交
1164 1165 1166 1167 1168 1169 1170 1171 1172
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
	$(AM_CFLAGS)	\
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
	$(LDADDS)	\
	../tools/nss/libnss_libvirt_impl.la

1173 1174 1175 1176 1177 1178 1179 1180 1181 1182
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST	\
	$(AM_CFLAGS)	\
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
	$(LDADDS)	\
	../tools/nss/libnss_libvirt_guest_impl.la

M
Michal Privoznik 已提交
1183 1184 1185 1186 1187 1188
nssmock_la_SOURCES = \
	nssmock.c
nssmock_la_CFLAGS = $(AM_CFLAGS)
nssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
nssmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1189 1190 1191 1192 1193 1194 1195 1196 1197
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
nsslinktest_CFLAGS = 	\
	$(AM_CFLAGS)		\
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

1198 1199 1200 1201 1202 1203 1204
nssguestlinktest_SOURCES = nsslinktest.c
nssguestlinktest_CFLAGS = 	\
	-DLIBVIRT_NSS_GUEST	\
	$(AM_CFLAGS)		\
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1205 1206 1207
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1208

1209 1210 1211 1212 1213 1214 1215
virdeterministichashmock_la_SOURCES = \
	virdeterministichashmock.c
virdeterministichashmock_la_CFLAGS = $(AM_CFLAGS)
virdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)

test_libraries += virdeterministichashmock.la
1216

1217
if WITH_YAJL
1218 1219
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
1220
virmacmaptest_CLFAGS = $(AM_CFLAGS)
1221 1222
virmacmaptest_LDADD = $(LDADDS)

1223 1224
test_programs += virmacmaptest
else ! WITH_YAJL
1225
EXTRA_DIST +=  virmacmaptest.c
1226 1227
endif ! WITH_YAJL

M
Michal Privoznik 已提交
1228 1229 1230 1231 1232 1233 1234 1235
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)
1236
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1237
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1238

1239 1240 1241 1242 1243
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_CFLAGS = $(AM_CFLAGS)
virrotatingfiletest_LDADD = $(LDADDS)

1244 1245 1246 1247 1248
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1249 1250 1251 1252
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1253 1254
virusbmock_la_SOURCES = virusbmock.c
virusbmock_la_CFLAGS = $(AM_CFLAGS)
1255
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1256
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1257
	$(PROBES_O) \
1258
	../src/libvirt_util.la
1259 1260 1261 1262

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
virnetdevbandwidthmock_la_CFLAGS = $(AM_CFLAGS)
1263
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1264
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1265

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

1280 1281 1282 1283
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1284
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1285

1286 1287 1288 1289 1290
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1291

1292 1293 1294 1295 1296
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1297 1298
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1299
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1300
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1301

1302
else ! WITH_DBUS
1303
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1304
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1305

1306 1307
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1308
viruritest_LDADD = $(LDADDS)
1309

1310 1311
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1312
virkeyfiletest_LDADD = $(LDADDS)
1313

1314 1315 1316 1317
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1318 1319
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1320
virauthconfigtest_LDADD = $(LDADDS)
1321

1322
seclabeltest_SOURCES = \
1323
	seclabeltest.c testutils.h testutils.c
1324
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1325

1326
if WITH_SECDRIVER_SELINUX
1327
if WITH_ATTR
1328 1329
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1330
else ! WITH_TESTS
1331
check_LTLIBRARIES += libsecurityselinuxhelper.la
1332
endif ! WITH_TESTS
1333 1334 1335

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1336
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1337 1338 1339

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

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

1357 1358 1359 1360
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1361 1362 1363
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1364

1365
viratomictest_SOURCES = \
L
Laine Stump 已提交
1366
	viratomictest.c testutils.h testutils.c
1367 1368
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1369 1370 1371 1372
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1373 1374 1375 1376
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1377 1378 1379 1380
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1381 1382 1383 1384
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1385 1386
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1387
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1388 1389
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1390 1391 1392
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1393

M
Matthias Bolte 已提交
1394 1395 1396 1397
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1398 1399 1400 1401
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1402
endif WITH_DRIVER_MODULES
1403

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

1410 1411
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1412
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1413 1414 1415

shunloadtest_SOURCES = \
	shunloadtest.c
1416
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1417 1418
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1419 1420 1421 1422
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1423 1424 1425 1426
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1427 1428 1429 1430
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1431 1432 1433 1434 1435
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1436 1437 1438 1439 1440
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1441
if WITH_LINUX
O
Osier Yang 已提交
1442 1443 1444 1445
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1446 1447 1448 1449
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1450 1451
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1452
EXTRA_DIST += scsihosttest.c
1453 1454
endif  ! WITH_LINUX

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

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

1464 1465 1466 1467 1468 1469
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1470
objectlocking_SOURCES = objectlocking.ml
1471 1472 1473 1474

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

1475
objectlocking: objectlocking.cmx objectlocking-files.txt
1476 1477
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1478

1479
objectlocking-files.txt:
1480 1481
	find $(top_builddir)/src/ -name '*.i' > $@

1482
else ! WITH_CIL
1483
EXTRA_DIST += objectlocking.ml
1484
endif ! WITH_CIL
1485

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