Makefile.am 25.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
SHELL = $(PREFERABLY_POSIX_SHELL)

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

AM_CFLAGS = \
31
	-Dabs_builddir="\"`pwd`\"" \
32
	-Dabs_srcdir="\"`cd '$(srcdir)'; pwd`\"" \
33 34
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
35
	$(SASL_CFLAGS) \
36
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
37
	$(APPARMOR_CFLAGS) \
38
	$(YAJL_CFLAGS) \
E
Eric Blake 已提交
39 40
	$(COVERAGE_CFLAGS) \
	$(WARN_CFLAGS)
41

42 43 44
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
45
endif WITH_DRIVER_MODULES
46

47
PROBES_O =
48
if WITH_DTRACE_PROBES
49
PROBES_O += ../src/libvirt_probes.lo
50
endif WITH_DTRACE_PROBES
51

52 53 54
GNULIB_LIBS = \
       ../gnulib/lib/libgnu.la

K
Karel Zak 已提交
55
LDADDS = \
56
        $(WARN_CFLAGS) \
57
	$(NO_INDIRECT_LDFLAGS) \
58
	$(PROBES_O) \
59 60
	$(GNULIB_LIBS) \
	../src/libvirt.la
K
Karel Zak 已提交
61

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

G
Gene Czarcinski 已提交
127
test_helpers = commandhelper ssh test_conf
128
test_programs = virshtest sockettest \
E
Eric Blake 已提交
129
	nodeinfotest virbuftest \
130
	commandtest seclabeltest \
E
Eric Blake 已提交
131 132
	virhashtest \
	viratomictest \
133
	utiltest shunloadtest \
134
	virtimetest viruritest virkeyfiletest \
H
Hu Tao 已提交
135
	virauthconfigtest \
136 137
	virbitmaptest \
	vircgrouptest \
138
	vircryptotest \
M
Michal Privoznik 已提交
139
	virpcitest \
140
	virendiantest \
141
	virfiletest \
142
	viridentitytest \
143
	virkeycodetest \
144
	virlockspacetest \
145
	virlogtest \
146
	virstringtest \
147
	virportallocatortest \
V
Viktor Mihajlovski 已提交
148
	sysinfotest \
149
	virstoragetest \
150
	virnetdevbandwidthtest \
151
	virkmodtest \
152
	vircapstest \
153
	domainconftest \
154
	$(NULL)
155

E
Eric Blake 已提交
156 157 158 159 160 161 162 163 164 165 166
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
	virnetserverclienttest \
	$(NULL)
if WITH_GNUTLS
test_programs += virnettlscontexttest virnettlssessiontest
endif WITH_GNUTLS
endif WITH_REMOTE

167 168 169 170
if WITH_LINUX
test_programs += fchosttest
endif WITH_LINUX

171 172 173 174
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

175
if WITH_DBUS
176 177
test_programs += virdbustest \
                 virsystemdtest
178
endif WITH_DBUS
179

180
if WITH_SECDRIVER_SELINUX
181
if WITH_ATTR
182
test_programs += securityselinuxtest
183
if WITH_QEMU
184
test_programs += securityselinuxlabeltest
185 186 187
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
188

189 190
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
191
endif WITH_DRIVER_MODULES
192

193 194 195
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
196

197
if WITH_XEN
198
test_programs += xml2sexprtest sexpr2xmltest \
199
	xmconfigtest xencapstest statstest reconnect
200
endif WITH_XEN
201
if WITH_QEMU
202
test_programs += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
203
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
204
	qemumonitortest qemumonitorjsontest qemuhotplugtest \
205
	qemuagenttest qemucapabilitiestest
206
endif WITH_QEMU
207

208
if WITH_LXC
209
test_programs += lxcxml2xmltest lxcconf2xmltest
210
endif WITH_LXC
211

212
if WITH_OPENVZ
213
test_programs += openvzutilstest
214
endif WITH_OPENVZ
215

216
if WITH_ESX
217
test_programs += esxutilstest
218
endif WITH_ESX
219 220

if WITH_VMX
221
test_programs += vmx2xmltest xml2vmxtest
222
endif WITH_VMX
223

224 225 226 227
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

228
if WITH_CIL
229
test_programs += object-locking
230
endif WITH_CIL
231

232
if WITH_YAJL
233
test_programs += jsontest
234
endif WITH_YAJL
235

J
Ján Tomko 已提交
236
test_programs += networkxml2xmltest networkxml2xmlupdatetest
237

238
if WITH_NETWORK
239
test_programs += networkxml2conftest
240
endif WITH_NETWORK
241

242 243
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
244
endif WITH_STORAGE_SHEEPDOG
245

246
test_programs += nwfilterxml2xmltest
247

248
if WITH_STORAGE
249
test_programs += storagevolxml2argvtest
250
endif WITH_STORAGE
251

O
Osier Yang 已提交
252 253 254 255
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

256
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
257

258
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
259

260
test_programs += interfacexml2xmltest
261

262
test_programs += cputest
263

P
Peter Krempa 已提交
264 265
test_programs += metadatatest

J
Ján Tomko 已提交
266 267
test_programs += secretxml2xmltest

268 269 270 271
if WITH_LINUX
test_programs += virusbtest
endif WITH_LINUX

272 273
test_scripts = \
	capabilityschematest \
274
	interfaceschematest \
275 276 277 278
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
279
	nodedevschematest \
280
	nwfilterschematest \
J
Ján Tomko 已提交
281 282
	domainsnapshotschematest \
	secretschematest
283

A
Atsushi SAKAI 已提交
284
if WITH_LIBVIRTD
285 286 287 288 289
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
290 291
	libvirtd-fail			\
	libvirtd-pool			\
292 293 294
	read-bufsiz			\
	read-non-seekable		\
	start				\
295
	virsh-uriprecedence		\
296 297
	vcpupin				\
	virsh-all			\
298
	virsh-optparse			\
299
	virsh-schedinfo			\
300 301 302
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
303

304 305 306
test_programs += 			\
	eventtest			\
	libvirtdconftest
307
else ! WITH_LIBVIRTD
308 309 310 311 312 313 314 315 316 317 318 319 320 321
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			\
322 323 324
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
325
endif ! WITH_LIBVIRTD
326

327 328
test_programs += objecteventtest

J
Jamie Strandboge 已提交
329 330
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
331
else ! WITH_SECDRIVER_APPARMOR
332
EXTRA_DIST += virt-aa-helper-test
333
endif ! WITH_SECDRIVER_APPARMOR
334

335 336
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
337 338
test_libraries = libshunload.la \
		libvirportallocatormock.la \
339
		virnetserverclientmock.la \
340
		vircgroupmock.la \
M
Michal Privoznik 已提交
341
		virpcimock.la \
D
Daniel P. Berrange 已提交
342
		$(NULL)
343
if WITH_QEMU
344 345 346
test_libraries += libqemumonitortestutils.la \
		qemuxml2argvmock.la \
		$(NULL)
347
endif WITH_QEMU
348

349 350
if WITH_DBUS
test_libraries += virsystemdmock.la
351
endif WITH_DBUS
352

353 354 355 356
if WITH_LINUX
test_libraries += virusbmock.la
endif WITH_LINUX

357 358
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
359
noinst_LTLIBRARIES = $(test_libraries)
360
else ! WITH_TESTS
361
check_PROGRAMS = $(test_programs) $(test_helpers)
362
check_LTLIBRARIES = $(test_libraries)
363
endif ! WITH_TESTS
364

365 366
TESTS = $(test_programs) \
	$(test_scripts)
367

368
# NB, automake < 1.10 does not provide the real
369
# abs_top_{src/build}dir or builddir variables, so don't rely
370
# on them here. Fake them with 'pwd'
371 372 373 374
# 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

lv_abs_top_builddir=`cd '$(top_builddir)'; pwd`
375 376
path_add = $(subst :,$(PATH_SEPARATOR),\
	$(subst !,$(lv_abs_top_builddir)/,!daemon:!tools:!tests))
377

378
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
379
TESTS_ENVIRONMENT =				\
380
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
381
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
382
  abs_builddir=`pwd`				\
383
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
384
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
385
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
386
  SHELL="$(SHELL)"				\
387
  LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \
388
  LIBVIRT_AUTOSTART=0				\
389
  LC_ALL=C					\
390
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE)	\
391 392
  $(VG)

393

394 395
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(srcdir)/.valgrind.supp
396
valgrind:
397
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
398

399 400 401
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
402
sockettest_LDADD = $(LDADDS)
403

404
if WITH_XEN
E
Eric Blake 已提交
405
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
406 407
xen_LDADDS += $(LDADDS)

408
xml2sexprtest_SOURCES = \
409
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
410
	testutils.c testutils.h
411
xml2sexprtest_LDADD = $(xen_LDADDS)
412 413

sexpr2xmltest_SOURCES = \
414
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
415
	testutils.c testutils.h
416
sexpr2xmltest_LDADD = $(xen_LDADDS)
417

418
xmconfigtest_SOURCES = \
419
	xmconfigtest.c testutilsxen.c testutilsxen.h \
420
	testutils.c testutils.h
421
xmconfigtest_LDADD = $(xen_LDADDS)
422

423 424
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
425
xencapstest_LDADD = $(xen_LDADDS)
426 427

reconnect_SOURCES = \
428
	reconnect.c testutils.h testutils.c
429 430
reconnect_LDADD = $(LDADDS)

431 432
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
433
statstest_LDADD = $(xen_LDADDS)
434

435
else ! WITH_XEN
436 437 438
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
439
endif ! WITH_XEN
440

441 442 443 444 445
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

446
if WITH_QEMU
447

448 449
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

450
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
451
if WITH_NETWORK
E
Eric Blake 已提交
452
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
453
endif WITH_NETWORK
454 455 456
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
457
if WITH_DTRACE_PROBES
458
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
459
endif WITH_DTRACE_PROBES
460
qemu_LDADDS += $(LDADDS)
461

462
qemuxml2argvtest_SOURCES = \
463
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
464
	testutils.c testutils.h
465
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LIBXML_LIBS)
466

467 468 469 470 471 472
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

473
qemuxml2xmltest_SOURCES = \
474
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
475
	testutils.c testutils.h
476
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
477

P
Philipp Hahn 已提交
478 479 480
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
481
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
482

483 484 485
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
486
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
487 488

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
489
qemuhelptest_LDADD = $(qemu_LDADDS)
490

491
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
492
qemumonitortest_LDADD = $(qemu_LDADDS)
493

494 495 496 497 498
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
499
qemumonitorjsontest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
500

501 502 503 504 505 506 507
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucapabilitiestest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)

P
Peter Krempa 已提交
508 509 510 511 512
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
513
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
P
Peter Krempa 已提交
514

515 516 517 518 519
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
520
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
521

522 523 524
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
525
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
526
else ! WITH_QEMU
527 528
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
529
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
530
	qemumonitorjsontest.c qemuhotplugtest.c \
531
	qemuagenttest.c qemucapabilitiestest.c \
532
	$(QEMUMONITORTESTUTILS_SOURCES)
533
endif ! WITH_QEMU
534

535 536
if WITH_LXC

E
Eric Blake 已提交
537
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
538
if WITH_NETWORK
E
Eric Blake 已提交
539
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
540
endif WITH_NETWORK
541
lxc_LDADDS += $(LDADDS)
542 543 544 545

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
546
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
547 548 549 550 551

lxcconf2xmltest_SOURCES = \
	lxcconf2xmltest.c \
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
552
else ! WITH_LXC
553
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
554
endif ! WITH_LXC
555

556 557 558 559
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
560
openvzutilstest_LDADD = $(LDADDS)
561
else ! WITH_OPENVZ
562
EXTRA_DIST += openvzutilstest.c
563
endif ! WITH_OPENVZ
564 565
EXTRA_DIST += openvzutilstest.conf

566 567 568 569
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
570
esxutilstest_LDADD = $(LDADDS)
571
else ! WITH_ESX
572
EXTRA_DIST += esxutilstest.c
573
endif ! WITH_ESX
574

575
if WITH_VMX
576 577 578
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
579
vmx2xmltest_LDADD = $(LDADDS)
580 581 582 583

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
584
xml2vmxtest_LDADD = $(LDADDS)
585
else ! WITH_VMX
586
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
587
endif ! WITH_VMX
588

589 590 591 592 593 594 595 596 597
if WITH_VMWARE
vmwarevertest_SOURCES = \
    vmwarevertest.c \
    testutils.c testutils.h
vmwarevertest_LDADD = $(LDADDS)
else ! WITH_VMWARE
EXTRA_DIST += vmwarevertest.c
endif ! WITH_VMWARE

598 599 600 601 602
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
603 604 605 606 607
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

608
if WITH_NETWORK
609 610
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
611
	testutils.c testutils.h
612
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
613
else ! WITH_NETWORK
614
EXTRA_DIST += networkxml2conftest.c
615
endif !	WITH_NETWORK
616

617 618 619 620
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
621 622
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
623
else ! WITH_STORAGE_SHEEPDOG
624
EXTRA_DIST += storagebackendsheepdogtest.c
625
endif ! WITH_STORAGE_SHEEPDOG
626

627 628 629 630
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
631

J
Ján Tomko 已提交
632 633 634 635 636 637
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)


638
if WITH_STORAGE
639 640 641 642 643
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
644
else ! WITH_STORAGE
645
EXTRA_DIST += storagevolxml2argvtest.c
646
endif ! WITH_STORAGE
647

648 649 650 651 652
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

653 654 655 656 657
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
658 659 660
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
661
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
662

663 664 665 666 667
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

668 669 670
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
671
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
672

P
Peter Krempa 已提交
673 674 675 676 677
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

678 679 680 681 682
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
683 684 685
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
686

687 688 689 690
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

691 692 693 694 695 696 697
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
698
commandhelper_LDFLAGS = -static
699

700 701
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
702
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)
703

704 705 706 707
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

708 709 710 711
vircapstest_SOURCES = \
	vircapstest.c testutils.h testutils.c
vircapstest_LDADD = $(LDADDS)

712 713 714
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
715 716
	$(NULL)
libvirtdconftest_LDADD = ../daemon/libvirtd_conf.la $(LDADDS)
717
else ! WITH_LIBVIRTD
718
EXTRA_DIST += libvirtdconftest.c
719
endif ! WITH_LIBVIRTD
720

721 722
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
723
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
724
virnetmessagetest_LDADD = $(LDADDS)
725

726 727
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
728
virnetsockettest_LDADD = $(LDADDS)
729

730 731 732
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
733
virnetserverclienttest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
734 735 736 737 738 739 740 741
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

742
if WITH_GNUTLS
743
virnettlscontexttest_SOURCES = \
744 745 746
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
747
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
748 749 750 751
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
752
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
753 754 755
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
756 757
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
758
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
759
EXTRA_DIST += pkix_asn1_tab.c
760 761
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
762
EXTRA_DIST += \
763 764 765
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
766
endif ! WITH_GNUTLS
767

768 769
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
770
virtimetest_LDADD = $(LDADDS)
771

772 773 774 775
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

776 777 778 779
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

780 781 782
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
783 784 785 786
if WITH_SELINUX
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
787

788 789 790 791
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

792 793 794 795
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

796 797 798 799
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
800 801 802 803 804 805 806 807 808 809
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

810 811 812 813 814 815 816 817 818 819
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

820 821 822 823
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
824 825 826 827 828 829 830
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
831 832
virpcimock_la_LIBADD = $(GNULIB_LIBS) \
					   ../src/libvirt.la
M
Michal Privoznik 已提交
833 834 835
virpcimock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

836 837 838 839 840 841 842 843 844 845 846 847 848
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

849 850 851 852
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
853
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
854 855 856 857 858 859 860 861 862 863 864 865

virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
virsystemdtest_CFLAGS = $(AM_CFLAGS)
virsystemdtest_LDADD = $(LDADDS)

virsystemdmock_la_SOURCES = \
	virsystemdmock.c
virsystemdmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virsystemdmock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

866
else ! WITH_DBUS
867
EXTRA_DIST += virdbustest.c virsystemdtest.c virsystemdmock.c
868
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
869

870 871
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
872
viruritest_LDADD = $(LDADDS)
873

874 875
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
876
virkeyfiletest_LDADD = $(LDADDS)
877

878 879
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
880
virauthconfigtest_LDADD = $(LDADDS)
881

882 883
seclabeltest_SOURCES = \
	seclabeltest.c
884
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
885

886
if WITH_SECDRIVER_SELINUX
887
if WITH_ATTR
888 889
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
890
else ! WITH_TESTS
891
check_LTLIBRARIES += libsecurityselinuxhelper.la
892
endif ! WITH_TESTS
893 894 895 896 897 898 899 900

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
901
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
902 903
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
904 905 906 907 908

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
909
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
910 911
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
912 913 914
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
915 916
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
917

918 919 920 921
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

922 923 924
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
925

926
viratomictest_SOURCES = \
L
Laine Stump 已提交
927
	viratomictest.c testutils.h testutils.c
928 929
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
930 931 932 933
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
934 935 936 937
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

938 939 940 941
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

942
jsontest_SOURCES = \
943
	jsontest.c testutils.h testutils.c
944 945
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
946 947 948 949
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

950 951 952 953
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
954
endif WITH_DRIVER_MODULES
955

956 957
if WITH_LIBVIRTD
eventtest_SOURCES = \
958
	eventtest.c testutils.h testutils.c
959
eventtest_LDADD = -lrt $(LDADDS)
960
endif WITH_LIBVIRTD
961

962 963
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
964 965
libshunload_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation
966 967 968

shunloadtest_SOURCES = \
	shunloadtest.c
969
shunloadtest_LDADD = $(LIB_PTHREAD)
970 971
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
972 973 974 975
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

976 977 978 979
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

980 981 982 983
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

984 985 986 987 988
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

989
if WITH_LINUX
O
Osier Yang 已提交
990 991 992 993
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

994 995 996 997
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
endif  ! WITH_LINUX

O
Osier Yang 已提交
998 999 1000 1001 1002 1003 1004 1005 1006
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

object_locking_SOURCES = object-locking.ml

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

object-locking: object-locking.cmx object-locking-files.txt
1019 1020
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1021 1022 1023 1024

object-locking-files.txt:
	find $(top_builddir)/src/ -name '*.i' > $@

1025
else ! WITH_CIL
1026
EXTRA_DIST += object-locking.ml
1027
endif ! WITH_CIL
1028

1029 1030
CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx \
	object-locking-files.txt