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

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

23 24
SHELL = $(PREFERABLY_POSIX_SHELL)

K
Karel Zak 已提交
25
INCLUDES = \
26
	-I$(top_builddir) -I$(top_srcdir) \
27 28 29
	-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 \
30
	-I$(top_srcdir)/src/util \
31 32
	-I$(top_srcdir)/src/conf \
	$(GETTEXT_CPPFLAGS)
E
Eric Blake 已提交
33 34

AM_CFLAGS = \
35 36
	-Dabs_builddir="\"$(abs_builddir)\"" \
	-Dabs_srcdir="\"$(abs_srcdir)\"" \
37 38
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
39
	$(SASL_CFLAGS) \
40
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
41
	$(APPARMOR_CFLAGS) \
42
	$(YAJL_CFLAGS) \
E
Eric Blake 已提交
43 44
	$(COVERAGE_CFLAGS) \
	$(WARN_CFLAGS)
45

46 47 48
AM_LDFLAGS = \
	-export-dynamic

49 50 51
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
52
endif WITH_DRIVER_MODULES
53

54
PROBES_O =
55
if WITH_DTRACE_PROBES
56
PROBES_O += ../src/libvirt_probes.lo
57
endif WITH_DTRACE_PROBES
58

59 60 61
GNULIB_LIBS = \
       ../gnulib/lib/libgnu.la

K
Karel Zak 已提交
62
LDADDS = \
63
        $(WARN_CFLAGS) \
64
	$(NO_INDIRECT_LDFLAGS) \
65
	$(PROBES_O) \
66 67
	$(GNULIB_LIBS) \
	../src/libvirt.la
K
Karel Zak 已提交
68

69
EXTRA_DIST =		\
R
Roman Bogorodskiy 已提交
70
	bhyvexml2argvdata \
71
	bhyvexml2xmloutdata \
72
	capabilityschemadata \
E
Eric Blake 已提交
73 74 75 76
	capabilityschematest \
	commanddata \
	confdata \
	cputestdata \
77
	domainconfdata \
78
	domainschemadata \
E
Eric Blake 已提交
79 80 81 82
	domainschematest \
	domainsnapshotschematest \
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
O
Osier Yang 已提交
83
	fchostdata \
84
	interfaceschemadata \
85
	lxcconf2xmldata \
86
	lxcxml2xmldata \
87
	lxcxml2xmloutdata \
E
Eric Blake 已提交
88 89 90
	networkschematest \
	networkxml2xmlin \
	networkxml2xmlout \
91
	networkxml2confdata \
J
Ján Tomko 已提交
92 93
	networkxml2xmlupdatein \
	networkxml2xmlupdateout \
94
	networkxml2firewalldata \
E
Eric Blake 已提交
95 96 97 98 99 100 101
	nodedevschemadata \
	nodedevschematest \
	nodeinfodata     \
	nwfilterschematest \
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
102
	qemucapabilitiesdata \
103
	qemucaps2xmldata \
E
Eric Blake 已提交
104
	qemuhelpdata \
105
	qemuhotplugtestdata \
106
	qemumonitorjsondata \
E
Eric Blake 已提交
107 108
	qemuxml2argvdata \
	qemuxml2xmloutdata \
P
Philipp Hahn 已提交
109
	qemuxmlnsdata \
J
Ján Tomko 已提交
110
	secretxml2xmlin \
111
	securityselinuxhelperdata \
112
	securityselinuxlabeldata \
E
Eric Blake 已提交
113 114
	schematestutils.sh \
	sexpr2xmldata \
115
	storagepoolschemadata \
116
	storagepoolschematest \
117
	storagepoolxml2xmlin \
E
Eric Blake 已提交
118
	storagepoolxml2xmlout \
119
	storagevolxml2argvdata \
120
	storagevolschemadata \
121
	storagevolschematest \
122
	storagevolxml2xmlin \
E
Eric Blake 已提交
123
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
124
	sysinfodata \
E
Eric Blake 已提交
125
	test-lib.sh	\
126
	virsh-uriprecedence \
127
	virfiledata \
128
	virpcitestdata \
O
Osier Yang 已提交
129
	virscsidata \
130
	virusbtestdata \
131
	vmx2xmldata \
E
Eric Blake 已提交
132 133 134
	xencapsdata \
	xmconfigdata \
	xml2sexprdata \
135
	xml2vmxdata \
136
	vmwareverdata \
137 138
	.valgrind.supp \
	virmock.h
K
Karel Zak 已提交
139

G
Gene Czarcinski 已提交
140
test_helpers = commandhelper ssh test_conf
141
test_programs = virshtest sockettest \
E
Eric Blake 已提交
142
	nodeinfotest virbuftest \
143
	commandtest seclabeltest \
E
Eric Blake 已提交
144 145
	virhashtest \
	viratomictest \
146
	utiltest shunloadtest \
147
	virtimetest viruritest virkeyfiletest \
148
	viralloctest \
H
Hu Tao 已提交
149
	virauthconfigtest \
150 151
	virbitmaptest \
	vircgrouptest \
152
	vircryptotest \
M
Michal Privoznik 已提交
153
	virpcitest \
154
	virendiantest \
155
	virfiletest \
156
	virfirewalltest \
J
Ján Tomko 已提交
157
	viriscsitest \
158
	virkeycodetest \
159
	virlockspacetest \
160
	virlogtest \
161
	virstringtest \
162
	virportallocatortest \
V
Viktor Mihajlovski 已提交
163
	sysinfotest \
164
	virstoragetest \
165
	virnetdevbandwidthtest \
166
	virkmodtest \
167
	vircapstest \
168
	domainconftest \
169
	virhostdevtest \
170
	$(NULL)
171

E
Eric Blake 已提交
172 173 174 175 176 177 178 179 180 181 182
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
	virnetserverclienttest \
	$(NULL)
if WITH_GNUTLS
test_programs += virnettlscontexttest virnettlssessiontest
endif WITH_GNUTLS
endif WITH_REMOTE

183 184 185 186
if WITH_LINUX
test_programs += fchosttest
endif WITH_LINUX

187 188 189 190
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

191
if WITH_DBUS
192 193
test_programs += virdbustest \
                 virsystemdtest
194
endif WITH_DBUS
195

196
if WITH_SECDRIVER_SELINUX
197
if WITH_ATTR
198 199
test_programs += securityselinuxtest \
                 viridentitytest
200
if WITH_QEMU
201
test_programs += securityselinuxlabeltest
202 203 204
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
205

206 207
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
208
endif WITH_DRIVER_MODULES
209

210 211 212
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
213

214
if WITH_XEN
215
test_programs += xml2sexprtest sexpr2xmltest \
216
	xmconfigtest xencapstest statstest reconnect
217
endif WITH_XEN
218
if WITH_QEMU
219
test_programs += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
220
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
221
	qemumonitortest qemumonitorjsontest qemuhotplugtest \
222
	qemuagenttest qemucapabilitiestest qemucaps2xmltest
223
endif WITH_QEMU
224

225
if WITH_LXC
226
test_programs += lxcxml2xmltest lxcconf2xmltest
227
endif WITH_LXC
228

229
if WITH_OPENVZ
230
test_programs += openvzutilstest
231
endif WITH_OPENVZ
232

233
if WITH_ESX
234
test_programs += esxutilstest
235
endif WITH_ESX
236 237

if WITH_VMX
238
test_programs += vmx2xmltest xml2vmxtest
239
endif WITH_VMX
240

241 242 243 244
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
245
if WITH_BHYVE
246
test_programs += bhyvexml2argvtest bhyvexml2xmltest
R
Roman Bogorodskiy 已提交
247 248
endif WITH_BHYVE

249
if WITH_CIL
250
test_programs += objectlocking
251
endif WITH_CIL
252

253
if WITH_YAJL
254
test_programs += jsontest
255
endif WITH_YAJL
256

257 258 259 260
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
		$(NULL)
261

262
if WITH_NETWORK
263 264 265 266
test_programs += \
		networkxml2conftest \
		networkxml2firewalltest \
		$(NULL)
267
endif WITH_NETWORK
268

269 270
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
271
endif WITH_STORAGE_SHEEPDOG
272

273
test_programs += nwfilterxml2xmltest
274

275 276
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
277
test_programs += nwfilterxml2firewalltest
278 279
endif WITH_NWFILTER

280
if WITH_STORAGE
281
test_programs += storagevolxml2argvtest
282
endif WITH_STORAGE
283

O
Osier Yang 已提交
284 285 286 287
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

288
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
289

290
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
291

292
test_programs += interfacexml2xmltest
293

294
test_programs += cputest
295

P
Peter Krempa 已提交
296 297
test_programs += metadatatest

J
Ján Tomko 已提交
298 299
test_programs += secretxml2xmltest

300 301 302 303
if WITH_LINUX
test_programs += virusbtest
endif WITH_LINUX

304 305
test_scripts = \
	capabilityschematest \
306
	interfaceschematest \
307 308 309 310
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
311
	nodedevschematest \
312
	nwfilterschematest \
J
Ján Tomko 已提交
313 314
	domainsnapshotschematest \
	secretschematest
315

A
Atsushi SAKAI 已提交
316
if WITH_LIBVIRTD
317 318 319 320 321
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
322 323
	libvirtd-fail			\
	libvirtd-pool			\
324 325 326
	read-bufsiz			\
	read-non-seekable		\
	start				\
327
	virsh-uriprecedence		\
328 329
	vcpupin				\
	virsh-all			\
330
	virsh-optparse			\
331
	virsh-schedinfo			\
332 333 334
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
335

336 337 338
test_programs += 			\
	eventtest			\
	libvirtdconftest
339
else ! WITH_LIBVIRTD
340 341 342 343 344 345 346 347 348 349 350 351 352 353
EXTRA_DIST += 				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
	libvirtd-fail			\
	libvirtd-pool			\
	read-bufsiz			\
	read-non-seekable		\
	start				\
	vcpupin				\
	virsh-all			\
	virsh-optparse			\
	virsh-schedinfo			\
354 355 356
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
357
endif ! WITH_LIBVIRTD
358

359 360
test_programs += objecteventtest

J
Jamie Strandboge 已提交
361 362
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
363
else ! WITH_SECDRIVER_APPARMOR
364
EXTRA_DIST += virt-aa-helper-test
365
endif ! WITH_SECDRIVER_APPARMOR
366

367 368
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
369 370
test_libraries = libshunload.la \
		libvirportallocatormock.la \
371
		virnetserverclientmock.la \
372
		vircgroupmock.la \
M
Michal Privoznik 已提交
373
		virpcimock.la \
D
Daniel P. Berrange 已提交
374
		$(NULL)
375
if WITH_QEMU
376 377 378
test_libraries += libqemumonitortestutils.la \
		qemuxml2argvmock.la \
		$(NULL)
379
endif WITH_QEMU
380

R
Roman Bogorodskiy 已提交
381 382 383 384
if WITH_BHYVE
test_libraries += bhyvexml2argvmock.la
endif WITH_BHYVE

385
if WITH_DBUS
386
test_libraries += \
387
		virmockdbus.la
388
endif WITH_DBUS
389

390 391 392 393
if WITH_LINUX
test_libraries += virusbmock.la
endif WITH_LINUX

394 395
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
396
noinst_LTLIBRARIES = $(test_libraries)
397
else ! WITH_TESTS
398
check_PROGRAMS = $(test_programs) $(test_helpers)
399
check_LTLIBRARIES = $(test_libraries)
400
endif ! WITH_TESTS
401

402 403
TESTS = $(test_programs) \
	$(test_scripts)
404

405
# NB, automake < 1.10 does not provide the real
406
# abs_top_{src/build}dir or builddir variables, so don't rely
407
# on them here. Fake them with 'pwd'
408 409 410
# 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

411
lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd)
412 413
path_add = $(subst :,$(PATH_SEPARATOR),\
	$(subst !,$(lv_abs_top_builddir)/,!daemon:!tools:!tests))
414

415
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
416
TESTS_ENVIRONMENT =				\
417
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
418
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
419 420 421
  abs_builddir=$(abs_builddir)			\
  abs_srcdir=$(abs_srcdir)			\
  CONFIG_HEADER="$(lv_abs_top_builddir)/config.h"	\
J
Jim Meyering 已提交
422
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
423
  SHELL="$(SHELL)"				\
424
  LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \
425
  LIBVIRT_AUTOSTART=0				\
426
  LC_ALL=C					\
427
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE)	\
428 429
  $(VG)

430

431 432
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(srcdir)/.valgrind.supp
433
valgrind:
434
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
435

436 437 438
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
439
sockettest_LDADD = $(LDADDS)
440

441
if WITH_XEN
E
Eric Blake 已提交
442
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
443 444
xen_LDADDS += $(LDADDS)

445
xml2sexprtest_SOURCES = \
446
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
447
	testutils.c testutils.h
448
xml2sexprtest_LDADD = $(xen_LDADDS)
449 450

sexpr2xmltest_SOURCES = \
451
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
452
	testutils.c testutils.h
453
sexpr2xmltest_LDADD = $(xen_LDADDS)
454

455
xmconfigtest_SOURCES = \
456
	xmconfigtest.c testutilsxen.c testutilsxen.h \
457
	testutils.c testutils.h
458
xmconfigtest_LDADD = $(xen_LDADDS)
459

460 461
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
462
xencapstest_LDADD = $(xen_LDADDS)
463 464

reconnect_SOURCES = \
465
	reconnect.c testutils.h testutils.c
466 467
reconnect_LDADD = $(LDADDS)

468 469
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
470
statstest_LDADD = $(xen_LDADDS)
471

472
else ! WITH_XEN
473 474 475
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
476
endif ! WITH_XEN
477

478 479 480 481 482
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

483
if WITH_QEMU
484

485 486
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

487
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
488
if WITH_NETWORK
E
Eric Blake 已提交
489
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
490
endif WITH_NETWORK
491 492 493
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
494
if WITH_DTRACE_PROBES
495
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
496
endif WITH_DTRACE_PROBES
497
qemu_LDADDS += $(LDADDS)
498

499
qemuxml2argvtest_SOURCES = \
500
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
501
	testutils.c testutils.h
502
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LIBXML_LIBS)
503

504 505 506 507 508 509
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
qemuxml2argvmock_la_CFLAGS = $(AM_CFLAGS)
qemuxml2argvmock_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation

510
qemuxml2xmltest_SOURCES = \
511
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
512
	testutils.c testutils.h
513
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
514

P
Philipp Hahn 已提交
515 516 517
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
518
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
519

520 521 522
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
523
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
524 525

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
526
qemuhelptest_LDADD = $(qemu_LDADDS)
527

528
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
529
qemumonitortest_LDADD = $(qemu_LDADDS)
530

531 532 533 534 535
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
536
qemumonitorjsontest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
537

538 539 540 541 542 543 544
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucapabilitiestest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)

545 546 547 548 549 550
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
	$(NULL)
qemucaps2xmltest_LDADD = $(qemu_LDADDS)

P
Peter Krempa 已提交
551 552 553 554 555
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
556
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
P
Peter Krempa 已提交
557

558 559 560 561 562
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
563
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
564

565 566 567
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
568
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
569
else ! WITH_QEMU
570 571
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
572
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
573
	qemumonitorjsontest.c qemuhotplugtest.c \
574
	qemuagenttest.c qemucapabilitiestest.c \
575
	qemucaps2xmltest.c \
576
	$(QEMUMONITORTESTUTILS_SOURCES)
577
endif ! WITH_QEMU
578

579 580
if WITH_LXC

E
Eric Blake 已提交
581
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
582
if WITH_NETWORK
E
Eric Blake 已提交
583
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
584
endif WITH_NETWORK
585
lxc_LDADDS += $(LDADDS)
586 587 588 589

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
590
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
591 592 593 594 595

lxcconf2xmltest_SOURCES = \
	lxcconf2xmltest.c \
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
596
else ! WITH_LXC
597
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
598
endif ! WITH_LXC
599

600 601 602 603
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
604
openvzutilstest_LDADD = $(LDADDS)
605
else ! WITH_OPENVZ
606
EXTRA_DIST += openvzutilstest.c
607
endif ! WITH_OPENVZ
608 609
EXTRA_DIST += openvzutilstest.conf

610 611 612 613
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
614
esxutilstest_LDADD = $(LDADDS)
615
else ! WITH_ESX
616
EXTRA_DIST += esxutilstest.c
617
endif ! WITH_ESX
618

619
if WITH_VMX
620 621 622
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
623
vmx2xmltest_LDADD = $(LDADDS)
624 625 626 627

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
628
xml2vmxtest_LDADD = $(LDADDS)
629
else ! WITH_VMX
630
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
631
endif ! WITH_VMX
632

633 634 635 636 637 638 639 640 641
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 已提交
642 643 644 645 646 647 648 649 650 651 652 653 654
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
bhyvexml2argvmock_la_CFLAGS = $(AM_CFLAGS)
bhyvexml2argvmock_la_LDFLAGS = -module -avoid-version \
			-rpath /evil/libtool/hack/to/force/shared/lib/creation

bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
655 656 657 658 659

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
660
else ! WITH_BHYVE
661
EXTRA_DIST += bhyvexml2argvtest.c bhyvexml2xmltest.c bhyvexml2argvmock.c
R
Roman Bogorodskiy 已提交
662 663
endif ! WITH_BHYVE

664 665 666 667 668
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
669 670 671 672 673
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

674
if WITH_NETWORK
675 676
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
677
	testutils.c testutils.h
678
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
679 680 681 682 683 684

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

685
else ! WITH_NETWORK
686
EXTRA_DIST += networkxml2conftest.c
687
endif !	WITH_NETWORK
688

689 690 691 692
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
693 694
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
695
else ! WITH_STORAGE_SHEEPDOG
696
EXTRA_DIST += storagebackendsheepdogtest.c
697
endif ! WITH_STORAGE_SHEEPDOG
698

699 700 701 702
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
703

704 705 706 707 708
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
709 710 711 712 713 714

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

J
Ján Tomko 已提交
717 718 719 720 721 722
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)


723
if WITH_STORAGE
724 725 726 727
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
728
	$(LIBXML_LIBS) \
729
	../src/libvirt_driver_storage_impl.la $(LDADDS)
J
Ján Tomko 已提交
730

731
else ! WITH_STORAGE
732
EXTRA_DIST += storagevolxml2argvtest.c
733
endif ! WITH_STORAGE
734

735 736 737 738 739
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

740 741 742 743 744
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
745 746 747
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
748
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
749

750 751 752 753 754
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

755 756 757
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
758
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
759

P
Peter Krempa 已提交
760 761 762 763 764
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

765 766 767 768 769
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
770 771 772
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
773

774 775 776 777
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

778 779 780 781 782 783 784
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
785
commandhelper_LDFLAGS = -static
786

787 788
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
789
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)
790

791 792 793 794
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

795 796 797 798
vircapstest_SOURCES = \
	vircapstest.c testutils.h testutils.c
vircapstest_LDADD = $(LDADDS)

799 800 801
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
802 803
	$(NULL)
libvirtdconftest_LDADD = ../daemon/libvirtd_conf.la $(LDADDS)
804
else ! WITH_LIBVIRTD
805
EXTRA_DIST += libvirtdconftest.c
806
endif ! WITH_LIBVIRTD
807

808 809
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
810
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
811
virnetmessagetest_LDADD = $(LDADDS)
812

813 814
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
815
virnetsockettest_LDADD = $(LDADDS)
816

817 818 819
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
820
virnetserverclienttest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
821 822 823 824 825 826 827 828
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
virnetserverclientmock_la_CFLAGS = $(AM_CFLAGS)
virnetserverclientmock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

829
if WITH_GNUTLS
830
virnettlscontexttest_SOURCES = \
831 832 833
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
834
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
835 836 837 838
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
839
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
840 841 842
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
843 844
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
845
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
846
EXTRA_DIST += pkix_asn1_tab.c
847 848
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
849
EXTRA_DIST += \
850 851 852
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
853
endif ! WITH_GNUTLS
854

855 856
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
857
virtimetest_LDADD = $(LDADDS)
858

859 860 861 862
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

863 864 865 866
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

867 868 869
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
870 871 872 873
if WITH_SELINUX
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
874

J
Ján Tomko 已提交
875 876 877 878
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

879 880 881 882
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

883 884 885 886
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

887 888 889 890
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
891 892 893 894 895 896 897 898 899 900
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

libvirportallocatormock_la_SOURCES = \
	virportallocatortest.c
libvirportallocatormock_la_CFLAGS = $(AM_CFLAGS) -DMOCK_HELPER=1
libvirportallocatormock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

901 902 903 904 905 906 907 908 909 910
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
vircgroupmock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

911 912 913 914
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

915 916 917 918
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
919 920 921 922 923 924 925
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
926 927
virpcimock_la_LIBADD = $(GNULIB_LIBS) \
					   ../src/libvirt.la
M
Michal Privoznik 已提交
928 929 930
virpcimock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

931 932 933 934 935 936 937 938 939 940 941 942 943
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

virusbmock_la_SOURCES = virusbmock.c
virusbmock_la_CFLAGS = $(AM_CFLAGS)
virusbmock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation
else ! WITH_LINUX
	EXTRA_DIST += virusbtest.c virusbmock.c
endif ! WITH_LINUX

944 945 946 947
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
948
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
949

950 951 952 953 954 955
virmockdbus_la_SOURCES = \
	virmockdbus.c
virmockdbus_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virmockdbus_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

956 957
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
958
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
959 960
virsystemdtest_LDADD = $(LDADDS)

961
else ! WITH_DBUS
962
EXTRA_DIST += virdbustest.c virmockdbus.c virsystemdtest.c
963
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
964

965 966
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
967
viruritest_LDADD = $(LDADDS)
968

969 970
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
971
virkeyfiletest_LDADD = $(LDADDS)
972

973 974 975 976
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

977 978
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
979
virauthconfigtest_LDADD = $(LDADDS)
980

981 982
seclabeltest_SOURCES = \
	seclabeltest.c
983
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
984

985
if WITH_SECDRIVER_SELINUX
986
if WITH_ATTR
987 988
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
989
else ! WITH_TESTS
990
check_LTLIBRARIES += libsecurityselinuxhelper.la
991
endif ! WITH_TESTS
992 993 994 995 996 997 998 999

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
libsecurityselinuxhelper_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1000
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1001 1002
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1003 1004 1005 1006 1007

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1008
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
1009 1010
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1011 1012 1013
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1014 1015
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1016

1017 1018 1019 1020
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1021 1022 1023
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1024

1025
viratomictest_SOURCES = \
L
Laine Stump 已提交
1026
	viratomictest.c testutils.h testutils.c
1027 1028
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1029 1030 1031 1032
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1033 1034 1035 1036
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1037 1038 1039 1040
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

1041 1042 1043 1044 1045
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
virfirewalltest_LDADD = $(LDADDS)
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1046
jsontest_SOURCES = \
1047
	jsontest.c testutils.h testutils.c
1048 1049
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
1050 1051 1052 1053
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1054 1055 1056 1057
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1058
endif WITH_DRIVER_MODULES
1059

1060 1061
if WITH_LIBVIRTD
eventtest_SOURCES = \
1062
	eventtest.c testutils.h testutils.c
1063
eventtest_LDADD = -lrt $(LDADDS)
1064
endif WITH_LIBVIRTD
1065

1066 1067
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1068 1069
libshunload_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation
1070 1071 1072

shunloadtest_SOURCES = \
	shunloadtest.c
1073
shunloadtest_LDADD = $(LIB_PTHREAD)
1074 1075
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1076 1077 1078 1079
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1080 1081 1082 1083
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1084 1085 1086 1087
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1088 1089 1090 1091 1092
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1093
if WITH_LINUX
O
Osier Yang 已提交
1094 1095 1096 1097
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1098 1099 1100 1101
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
endif  ! WITH_LINUX

O
Osier Yang 已提交
1102 1103 1104 1105 1106 1107 1108 1109 1110
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1111 1112 1113 1114 1115 1116
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1117
objectlocking_SOURCES = objectlocking.ml
1118 1119 1120 1121

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

1122
objectlocking: objectlocking.cmx objectlocking-files.txt
1123 1124
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1125

1126
objectlocking-files.txt:
1127 1128
	find $(top_builddir)/src/ -name '*.i' > $@

1129
else ! WITH_CIL
1130
EXTRA_DIST += objectlocking.ml
1131
endif ! WITH_CIL
1132

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