Makefile.am 25.1 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 \
M
Michal Privoznik 已提交
138
	virpcitest \
139
	virendiantest \
140
	virfiletest \
141
	viridentitytest \
142
	virkeycodetest \
143
	virlockspacetest \
144
	virlogtest \
145
	virstringtest \
146
	virportallocatortest \
V
Viktor Mihajlovski 已提交
147
	sysinfotest \
148
	virstoragetest \
149
	virnetdevbandwidthtest \
150
	virkmodtest \
151
	vircapstest \
152
	domainconftest \
153
	$(NULL)
154

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

245
test_programs += nwfilterxml2xmltest
246

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

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

255
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
256

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

259
test_programs += interfacexml2xmltest
260

261
test_programs += cputest
262

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

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

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

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

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

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

326 327
test_programs += objecteventtest

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

334 335
EXTRA_DIST += $(test_scripts)

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

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

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

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

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

367
# NB, automake < 1.10 does not provide the real
368
# abs_top_{src/build}dir or builddir variables, so don't rely
369
# on them here. Fake them with 'pwd'
370 371 372 373
# 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`
374 375
path_add = $(subst :,$(PATH_SEPARATOR),\
	$(subst !,$(lv_abs_top_builddir)/,!daemon:!tools:!tests))
376

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

392

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

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

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

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

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

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

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

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

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

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

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

445
if WITH_QEMU
446

447 448
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

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

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

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

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

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

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

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

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

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

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

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

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

534 535
if WITH_LXC

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

M
Michal Privoznik 已提交
819 820 821 822 823 824 825
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
826 827
virpcimock_la_LIBADD = $(GNULIB_LIBS) \
					   ../src/libvirt.la
M
Michal Privoznik 已提交
828 829 830
virpcimock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

831 832 833 834 835 836 837 838 839 840 841 842 843
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

844 845 846 847
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
848
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
849 850 851 852 853 854 855 856 857 858 859 860

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

861
else ! WITH_DBUS
862
EXTRA_DIST += virdbustest.c virsystemdtest.c virsystemdmock.c
863
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
864

865 866
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
867
viruritest_LDADD = $(LDADDS)
868

869 870
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
871
virkeyfiletest_LDADD = $(LDADDS)
872

873 874
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
875
virauthconfigtest_LDADD = $(LDADDS)
876

877 878
seclabeltest_SOURCES = \
	seclabeltest.c
879
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
880

881
if WITH_SECDRIVER_SELINUX
882
if WITH_ATTR
883 884
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
885
else ! WITH_TESTS
886
check_LTLIBRARIES += libsecurityselinuxhelper.la
887
endif ! WITH_TESTS
888 889 890 891 892 893 894 895

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
896
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
897 898
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
899 900 901 902 903

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
904
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
905 906
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
907 908 909
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
910 911
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
912

913 914 915 916
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

917 918 919
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
920

921
viratomictest_SOURCES = \
L
Laine Stump 已提交
922
	viratomictest.c testutils.h testutils.c
923 924
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
925 926 927 928
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
929 930 931 932
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

933 934 935 936
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

937
jsontest_SOURCES = \
938
	jsontest.c testutils.h testutils.c
939 940
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
941 942 943 944
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

945 946 947 948
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
949
endif WITH_DRIVER_MODULES
950

951 952
if WITH_LIBVIRTD
eventtest_SOURCES = \
953
	eventtest.c testutils.h testutils.c
954
eventtest_LDADD = -lrt $(LDADDS)
955
endif WITH_LIBVIRTD
956

957 958
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
959 960
libshunload_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation
961 962 963

shunloadtest_SOURCES = \
	shunloadtest.c
964
shunloadtest_LDADD = $(LIB_PTHREAD)
965 966
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
967 968 969 970
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

971 972 973 974
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

975 976 977 978
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

979 980 981 982 983
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

984
if WITH_LINUX
O
Osier Yang 已提交
985 986 987 988
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

989 990 991 992
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
endif  ! WITH_LINUX

O
Osier Yang 已提交
993 994 995 996 997 998 999 1000 1001
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013
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
1014 1015
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1016 1017 1018 1019

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

1020
else ! WITH_CIL
1021
EXTRA_DIST += object-locking.ml
1022
endif ! WITH_CIL
1023

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