Makefile.am 27.3 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
if WITH_STORAGE
276
test_programs += storagevolxml2argvtest
277
endif WITH_STORAGE
278

O
Osier Yang 已提交
279 280 281 282
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

283
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
284

285
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
286

287
test_programs += interfacexml2xmltest
288

289
test_programs += cputest
290

P
Peter Krempa 已提交
291 292
test_programs += metadatatest

J
Ján Tomko 已提交
293 294
test_programs += secretxml2xmltest

295 296 297 298
if WITH_LINUX
test_programs += virusbtest
endif WITH_LINUX

299 300
test_scripts = \
	capabilityschematest \
301
	interfaceschematest \
302 303 304 305
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
306
	nodedevschematest \
307
	nwfilterschematest \
J
Ján Tomko 已提交
308 309
	domainsnapshotschematest \
	secretschematest
310

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

331 332 333
test_programs += 			\
	eventtest			\
	libvirtdconftest
334
else ! WITH_LIBVIRTD
335 336 337 338 339 340 341 342 343 344 345 346 347 348
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			\
349 350 351
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
352
endif ! WITH_LIBVIRTD
353

354 355
test_programs += objecteventtest

J
Jamie Strandboge 已提交
356 357
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
358
else ! WITH_SECDRIVER_APPARMOR
359
EXTRA_DIST += virt-aa-helper-test
360
endif ! WITH_SECDRIVER_APPARMOR
361

362 363
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
364 365
test_libraries = libshunload.la \
		libvirportallocatormock.la \
366
		virnetserverclientmock.la \
367
		vircgroupmock.la \
M
Michal Privoznik 已提交
368
		virpcimock.la \
D
Daniel P. Berrange 已提交
369
		$(NULL)
370
if WITH_QEMU
371 372 373
test_libraries += libqemumonitortestutils.la \
		qemuxml2argvmock.la \
		$(NULL)
374
endif WITH_QEMU
375

R
Roman Bogorodskiy 已提交
376 377 378 379
if WITH_BHYVE
test_libraries += bhyvexml2argvmock.la
endif WITH_BHYVE

380
if WITH_DBUS
381
test_libraries += \
382
		virmockdbus.la
383
endif WITH_DBUS
384

385 386 387 388
if WITH_LINUX
test_libraries += virusbmock.la
endif WITH_LINUX

389 390
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
391
noinst_LTLIBRARIES = $(test_libraries)
392
else ! WITH_TESTS
393
check_PROGRAMS = $(test_programs) $(test_helpers)
394
check_LTLIBRARIES = $(test_libraries)
395
endif ! WITH_TESTS
396

397 398
TESTS = $(test_programs) \
	$(test_scripts)
399

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

406
lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd)
407 408
path_add = $(subst :,$(PATH_SEPARATOR),\
	$(subst !,$(lv_abs_top_builddir)/,!daemon:!tools:!tests))
409

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

425

426 427
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(srcdir)/.valgrind.supp
428
valgrind:
429
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
430

431 432 433
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
434
sockettest_LDADD = $(LDADDS)
435

436
if WITH_XEN
E
Eric Blake 已提交
437
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
438 439
xen_LDADDS += $(LDADDS)

440
xml2sexprtest_SOURCES = \
441
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
442
	testutils.c testutils.h
443
xml2sexprtest_LDADD = $(xen_LDADDS)
444 445

sexpr2xmltest_SOURCES = \
446
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
447
	testutils.c testutils.h
448
sexpr2xmltest_LDADD = $(xen_LDADDS)
449

450
xmconfigtest_SOURCES = \
451
	xmconfigtest.c testutilsxen.c testutilsxen.h \
452
	testutils.c testutils.h
453
xmconfigtest_LDADD = $(xen_LDADDS)
454

455 456
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
457
xencapstest_LDADD = $(xen_LDADDS)
458 459

reconnect_SOURCES = \
460
	reconnect.c testutils.h testutils.c
461 462
reconnect_LDADD = $(LDADDS)

463 464
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
465
statstest_LDADD = $(xen_LDADDS)
466

467
else ! WITH_XEN
468 469 470
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
471
endif ! WITH_XEN
472

473 474 475 476 477
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

478
if WITH_QEMU
479

480 481
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

482
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
483
if WITH_NETWORK
E
Eric Blake 已提交
484
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
485
endif WITH_NETWORK
486 487 488
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
489
if WITH_DTRACE_PROBES
490
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
491
endif WITH_DTRACE_PROBES
492
qemu_LDADDS += $(LDADDS)
493

494
qemuxml2argvtest_SOURCES = \
495
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
496
	testutils.c testutils.h
497
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LIBXML_LIBS)
498

499 500 501 502 503 504
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

505
qemuxml2xmltest_SOURCES = \
506
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
507
	testutils.c testutils.h
508
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
509

P
Philipp Hahn 已提交
510 511 512
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
513
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
514

515 516 517
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
518
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
519 520

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
521
qemuhelptest_LDADD = $(qemu_LDADDS)
522

523
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
524
qemumonitortest_LDADD = $(qemu_LDADDS)
525

526 527 528 529 530
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
531
qemumonitorjsontest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
532

533 534 535 536 537 538 539
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucapabilitiestest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)

540 541 542 543 544 545
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
	$(NULL)
qemucaps2xmltest_LDADD = $(qemu_LDADDS)

P
Peter Krempa 已提交
546 547 548 549 550
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
551
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
P
Peter Krempa 已提交
552

553 554 555 556 557
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
558
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
559

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

574 575
if WITH_LXC

E
Eric Blake 已提交
576
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
577
if WITH_NETWORK
E
Eric Blake 已提交
578
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
579
endif WITH_NETWORK
580
lxc_LDADDS += $(LDADDS)
581 582 583 584

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
585
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
586 587 588 589 590

lxcconf2xmltest_SOURCES = \
	lxcconf2xmltest.c \
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
591
else ! WITH_LXC
592
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
593
endif ! WITH_LXC
594

595 596 597 598
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
599
openvzutilstest_LDADD = $(LDADDS)
600
else ! WITH_OPENVZ
601
EXTRA_DIST += openvzutilstest.c
602
endif ! WITH_OPENVZ
603 604
EXTRA_DIST += openvzutilstest.conf

605 606 607 608
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
609
esxutilstest_LDADD = $(LDADDS)
610
else ! WITH_ESX
611
EXTRA_DIST += esxutilstest.c
612
endif ! WITH_ESX
613

614
if WITH_VMX
615 616 617
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
618
vmx2xmltest_LDADD = $(LDADDS)
619 620 621 622

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
623
xml2vmxtest_LDADD = $(LDADDS)
624
else ! WITH_VMX
625
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
626
endif ! WITH_VMX
627

628 629 630 631 632 633 634 635 636
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 已提交
637 638 639 640 641 642 643 644 645 646 647 648 649
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)
650 651 652 653 654

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
655
else ! WITH_BHYVE
656
EXTRA_DIST += bhyvexml2argvtest.c bhyvexml2xmltest.c bhyvexml2argvmock.c
R
Roman Bogorodskiy 已提交
657 658
endif ! WITH_BHYVE

659 660 661 662 663
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
664 665 666 667 668
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

669
if WITH_NETWORK
670 671
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
672
	testutils.c testutils.h
673
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
674 675 676 677 678 679

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

680
else ! WITH_NETWORK
681
EXTRA_DIST += networkxml2conftest.c
682
endif !	WITH_NETWORK
683

684 685 686 687
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
688 689
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
690
else ! WITH_STORAGE_SHEEPDOG
691
EXTRA_DIST += storagebackendsheepdogtest.c
692
endif ! WITH_STORAGE_SHEEPDOG
693

694 695 696 697
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
698

J
Ján Tomko 已提交
699 700 701 702 703 704
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)


705
if WITH_STORAGE
706 707 708 709
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
710
	$(LIBXML_LIBS) \
711
	../src/libvirt_driver_storage_impl.la $(LDADDS)
J
Ján Tomko 已提交
712

713
else ! WITH_STORAGE
714
EXTRA_DIST += storagevolxml2argvtest.c
715
endif ! WITH_STORAGE
716

717 718 719 720 721
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

722 723 724 725 726
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
727 728 729
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
730
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
731

732 733 734 735 736
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

737 738 739
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
740
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
741

P
Peter Krempa 已提交
742 743 744 745 746
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

747 748 749 750 751
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
752 753 754
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
755

756 757 758 759
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

760 761 762 763 764 765 766
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
767
commandhelper_LDFLAGS = -static
768

769 770
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
771
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)
772

773 774 775 776
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

777 778 779 780
vircapstest_SOURCES = \
	vircapstest.c testutils.h testutils.c
vircapstest_LDADD = $(LDADDS)

781 782 783
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
784 785
	$(NULL)
libvirtdconftest_LDADD = ../daemon/libvirtd_conf.la $(LDADDS)
786
else ! WITH_LIBVIRTD
787
EXTRA_DIST += libvirtdconftest.c
788
endif ! WITH_LIBVIRTD
789

790 791
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
792
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
793
virnetmessagetest_LDADD = $(LDADDS)
794

795 796
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
797
virnetsockettest_LDADD = $(LDADDS)
798

799 800 801
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
802
virnetserverclienttest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
803 804 805 806 807 808 809 810
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

811
if WITH_GNUTLS
812
virnettlscontexttest_SOURCES = \
813 814 815
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
816
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
817 818 819 820
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
821
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
822 823 824
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
825 826
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
827
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
828
EXTRA_DIST += pkix_asn1_tab.c
829 830
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
831
EXTRA_DIST += \
832 833 834
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
835
endif ! WITH_GNUTLS
836

837 838
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
839
virtimetest_LDADD = $(LDADDS)
840

841 842 843 844
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

845 846 847 848
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

849 850 851
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
852 853 854 855
if WITH_SELINUX
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
856

J
Ján Tomko 已提交
857 858 859 860
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

861 862 863 864
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

865 866 867 868
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

869 870 871 872
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
873 874 875 876 877 878 879 880 881 882
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

883 884 885 886 887 888 889 890 891 892
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

893 894 895 896
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

897 898 899 900
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
901 902 903 904 905 906 907
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
908 909
virpcimock_la_LIBADD = $(GNULIB_LIBS) \
					   ../src/libvirt.la
M
Michal Privoznik 已提交
910 911 912
virpcimock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

913 914 915 916 917 918 919 920 921 922 923 924 925
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

926 927 928 929
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
930
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
931

932 933 934 935 936 937
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

938 939
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
940
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
941 942
virsystemdtest_LDADD = $(LDADDS)

943
else ! WITH_DBUS
944
EXTRA_DIST += virdbustest.c virmockdbus.c virsystemdtest.c
945
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
946

947 948
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
949
viruritest_LDADD = $(LDADDS)
950

951 952
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
953
virkeyfiletest_LDADD = $(LDADDS)
954

955 956 957 958
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

959 960
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
961
virauthconfigtest_LDADD = $(LDADDS)
962

963 964
seclabeltest_SOURCES = \
	seclabeltest.c
965
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
966

967
if WITH_SECDRIVER_SELINUX
968
if WITH_ATTR
969 970
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
971
else ! WITH_TESTS
972
check_LTLIBRARIES += libsecurityselinuxhelper.la
973
endif ! WITH_TESTS
974 975 976 977 978 979 980 981

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
982
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
983 984
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
985 986 987 988 989

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
990
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
991 992
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
993 994 995
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
996 997
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
998

999 1000 1001 1002
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1003 1004 1005
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1006

1007
viratomictest_SOURCES = \
L
Laine Stump 已提交
1008
	viratomictest.c testutils.h testutils.c
1009 1010
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1011 1012 1013 1014
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1015 1016 1017 1018
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1019 1020 1021 1022
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

1023 1024 1025 1026 1027
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
virfirewalltest_LDADD = $(LDADDS)
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1028
jsontest_SOURCES = \
1029
	jsontest.c testutils.h testutils.c
1030 1031
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
1032 1033 1034 1035
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1036 1037 1038 1039
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1040
endif WITH_DRIVER_MODULES
1041

1042 1043
if WITH_LIBVIRTD
eventtest_SOURCES = \
1044
	eventtest.c testutils.h testutils.c
1045
eventtest_LDADD = -lrt $(LDADDS)
1046
endif WITH_LIBVIRTD
1047

1048 1049
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1050 1051
libshunload_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation
1052 1053 1054

shunloadtest_SOURCES = \
	shunloadtest.c
1055
shunloadtest_LDADD = $(LIB_PTHREAD)
1056 1057
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1058 1059 1060 1061
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1062 1063 1064 1065
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1066 1067 1068 1069
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1070 1071 1072 1073 1074
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1075
if WITH_LINUX
O
Osier Yang 已提交
1076 1077 1078 1079
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1080 1081 1082 1083
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
endif  ! WITH_LINUX

O
Osier Yang 已提交
1084 1085 1086 1087 1088 1089 1090 1091 1092
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1093 1094 1095 1096 1097 1098
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1099
objectlocking_SOURCES = objectlocking.ml
1100 1101 1102 1103

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

1104
objectlocking: objectlocking.cmx objectlocking-files.txt
1105 1106
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1107

1108
objectlocking-files.txt:
1109 1110
	find $(top_builddir)/src/ -name '*.i' > $@

1111
else ! WITH_CIL
1112
EXTRA_DIST += objectlocking.ml
1113
endif ! WITH_CIL
1114

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