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

E
Eric Blake 已提交
3
## Copyright (C) 2005-2013 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 33
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
34
	$(SASL_CFLAGS) \
35
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
36
	$(APPARMOR_CFLAGS) \
37
	$(YAJL_CFLAGS) \
E
Eric Blake 已提交
38 39
	$(COVERAGE_CFLAGS) \
	$(WARN_CFLAGS)
40

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

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

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

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

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

G
Gene Czarcinski 已提交
120
test_helpers = commandhelper ssh test_conf
121
test_programs = virshtest sockettest \
E
Eric Blake 已提交
122
	nodeinfotest virbuftest \
123
	commandtest seclabeltest \
E
Eric Blake 已提交
124 125
	virhashtest \
	viratomictest \
126
	utiltest shunloadtest \
127
	virtimetest viruritest virkeyfiletest \
H
Hu Tao 已提交
128
	virauthconfigtest \
129 130
	virbitmaptest \
	vircgrouptest \
M
Michal Privoznik 已提交
131
	virpcitest \
132
	virendiantest \
133
	viridentitytest \
134
	virkeycodetest \
135
	virlockspacetest \
136
	virlogtest \
137
	virstringtest \
D
Daniel P. Berrange 已提交
138
        virportallocatortest \
V
Viktor Mihajlovski 已提交
139
	sysinfotest \
140
	virstoragetest \
141
	$(NULL)
142

E
Eric Blake 已提交
143 144 145 146 147 148 149 150 151 152 153
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
	virnetserverclienttest \
	$(NULL)
if WITH_GNUTLS
test_programs += virnettlscontexttest virnettlssessiontest
endif WITH_GNUTLS
endif WITH_REMOTE

154 155 156 157
if WITH_LINUX
test_programs += fchosttest
endif WITH_LINUX

158 159 160 161
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

162
if WITH_DBUS
163 164
test_programs += virdbustest \
                 virsystemdtest
165
endif WITH_DBUS
166

167
if WITH_SECDRIVER_SELINUX
168
if WITH_ATTR
169
test_programs += securityselinuxtest
170
if WITH_QEMU
171
test_programs += securityselinuxlabeltest
172 173 174
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
175

176 177
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
178
endif WITH_DRIVER_MODULES
179

180 181 182
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
183

184
if WITH_XEN
185
test_programs += xml2sexprtest sexpr2xmltest \
186
	xmconfigtest xencapstest statstest reconnect
187
endif WITH_XEN
188
if WITH_QEMU
189
test_programs += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
190
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
191
	qemumonitortest qemumonitorjsontest qemuhotplugtest \
192
	qemuagenttest qemucapabilitiestest
193
endif WITH_QEMU
194

195
if WITH_LXC
196
test_programs += lxcxml2xmltest
197
endif WITH_LXC
198

199
if WITH_OPENVZ
200
test_programs += openvzutilstest
201
endif WITH_OPENVZ
202

203
if WITH_ESX
204
test_programs += esxutilstest
205
endif WITH_ESX
206 207

if WITH_VMX
208
test_programs += vmx2xmltest xml2vmxtest
209
endif WITH_VMX
210

211 212 213 214
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

215
if WITH_CIL
216
test_programs += object-locking
217
endif WITH_CIL
218

219
if WITH_YAJL
220
test_programs += jsontest
221
endif WITH_YAJL
222

J
Ján Tomko 已提交
223
test_programs += networkxml2xmltest networkxml2xmlupdatetest
224

225
if WITH_NETWORK
226
test_programs += networkxml2conftest
227
endif WITH_NETWORK
228

229 230
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
231
endif WITH_STORAGE_SHEEPDOG
232

233
test_programs += nwfilterxml2xmltest
234

235
if WITH_STORAGE
236
test_programs += storagevolxml2argvtest
237
endif WITH_STORAGE
238

239
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
240

241
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
242

243
test_programs += interfacexml2xmltest
244

245
test_programs += cputest
246

P
Peter Krempa 已提交
247 248
test_programs += metadatatest

249 250
test_scripts = \
	capabilityschematest \
251
	interfaceschematest \
252 253 254 255
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
256
	nodedevschematest \
257 258
	nwfilterschematest \
	domainsnapshotschematest
259

A
Atsushi SAKAI 已提交
260
if WITH_LIBVIRTD
261 262 263 264 265
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
266 267
	libvirtd-fail			\
	libvirtd-pool			\
268 269 270
	read-bufsiz			\
	read-non-seekable		\
	start				\
271
	virsh-uriprecedence		\
272 273
	vcpupin				\
	virsh-all			\
274
	virsh-optparse			\
275
	virsh-schedinfo			\
276 277 278
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
279

280 281 282
test_programs += 			\
	eventtest			\
	libvirtdconftest
283
else ! WITH_LIBVIRTD
284 285 286 287 288 289 290 291 292 293 294 295 296 297
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			\
298 299 300
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
301
endif ! WITH_LIBVIRTD
302

J
Jamie Strandboge 已提交
303 304
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
305
else ! WITH_SECDRIVER_APPARMOR
306
EXTRA_DIST += virt-aa-helper-test
307
endif ! WITH_SECDRIVER_APPARMOR
308

309 310
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
311 312
test_libraries = libshunload.la \
		libvirportallocatormock.la \
313
		virnetserverclientmock.la \
314
		vircgroupmock.la \
M
Michal Privoznik 已提交
315
		virpcimock.la \
D
Daniel P. Berrange 已提交
316
		$(NULL)
317 318
if WITH_QEMU
test_libraries += libqemumonitortestutils.la
319
endif WITH_QEMU
320

321 322
if WITH_DBUS
test_libraries += virsystemdmock.la
323
endif WITH_DBUS
324

325 326
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
327
noinst_LTLIBRARIES = $(test_libraries)
328
else ! WITH_TESTS
329
check_PROGRAMS = $(test_programs) $(test_helpers)
330
check_LTLIBRARIES = $(test_libraries)
331
endif ! WITH_TESTS
332

333 334
TESTS = $(test_programs) \
	$(test_scripts)
335

336
# NB, automake < 1.10 does not provide the real
337
# abs_top_{src/build}dir or builddir variables, so don't rely
338
# on them here. Fake them with 'pwd'
339 340 341 342
# 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`
343 344
path_add = $(subst :,$(PATH_SEPARATOR),\
	$(subst !,$(lv_abs_top_builddir)/,!daemon:!tools:!tests))
345

346
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
347
TESTS_ENVIRONMENT =				\
348
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
349
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
350
  abs_builddir=`pwd`				\
351
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
352
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
353
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
354
  SHELL="$(SHELL)"				\
355
  LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \
356
  LIBVIRT_AUTOSTART=0				\
357
  LC_ALL=C					\
358
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE)	\
359 360
  $(VG)

361

362 363
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(srcdir)/.valgrind.supp
364
valgrind:
365
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
366

367 368 369
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
370
sockettest_LDADD = $(LDADDS)
371

372
if WITH_XEN
E
Eric Blake 已提交
373
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
374 375
xen_LDADDS += $(LDADDS)

376
xml2sexprtest_SOURCES = \
377
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
378
	testutils.c testutils.h
379
xml2sexprtest_LDADD = $(xen_LDADDS)
380 381

sexpr2xmltest_SOURCES = \
382
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
383
	testutils.c testutils.h
384
sexpr2xmltest_LDADD = $(xen_LDADDS)
385

386
xmconfigtest_SOURCES = \
387
	xmconfigtest.c testutilsxen.c testutilsxen.h \
388
	testutils.c testutils.h
389
xmconfigtest_LDADD = $(xen_LDADDS)
390

391 392
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
393
xencapstest_LDADD = $(xen_LDADDS)
394 395

reconnect_SOURCES = \
396
	reconnect.c testutils.h testutils.c
397 398
reconnect_LDADD = $(LDADDS)

399 400
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
401
statstest_LDADD = $(xen_LDADDS)
402

403
else ! WITH_XEN
404 405 406
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
407
endif ! WITH_XEN
408

409 410 411 412 413
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

414
if WITH_QEMU
415

416 417
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

418
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
419
if WITH_NETWORK
E
Eric Blake 已提交
420
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
421
endif WITH_NETWORK
422
if WITH_DTRACE_PROBES
423
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
424
endif WITH_DTRACE_PROBES
425
qemu_LDADDS += $(LDADDS)
426

427
qemuxml2argvtest_SOURCES = \
428
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
429
	testutils.c testutils.h
430
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LIBXML_LIBS)
431 432

qemuxml2xmltest_SOURCES = \
433
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
434
	testutils.c testutils.h
435
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
436

P
Philipp Hahn 已提交
437 438 439
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
440
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
441

442 443 444
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
445
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
446 447

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
448
qemuhelptest_LDADD = $(qemu_LDADDS)
449

450
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
451
qemumonitortest_LDADD = $(qemu_LDADDS)
452

453 454 455 456 457
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
458
qemumonitorjsontest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
459

460 461 462 463 464 465 466
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucapabilitiestest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)

P
Peter Krempa 已提交
467 468 469 470 471
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
472
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
P
Peter Krempa 已提交
473

474 475 476 477 478
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
479
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
480

481 482 483
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
484
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
485
else ! WITH_QEMU
486 487
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
488
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
489
	qemumonitorjsontest.c qemuhotplugtest.c \
490
	qemuagenttest.c qemucapabilitiestest.c \
491
	$(QEMUMONITORTESTUTILS_SOURCES)
492
endif ! WITH_QEMU
493

494 495
if WITH_LXC

E
Eric Blake 已提交
496
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
497
if WITH_NETWORK
E
Eric Blake 已提交
498
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
499
endif WITH_NETWORK
500
lxc_LDADDS += $(LDADDS)
501 502 503 504

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
505
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
506
else ! WITH_LXC
507
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
508
endif ! WITH_LXC
509

510 511 512 513
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
514
openvzutilstest_LDADD = $(LDADDS)
515
else ! WITH_OPENVZ
516
EXTRA_DIST += openvzutilstest.c
517
endif ! WITH_OPENVZ
518 519
EXTRA_DIST += openvzutilstest.conf

520 521 522 523
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
524
esxutilstest_LDADD = $(LDADDS)
525
else ! WITH_ESX
526
EXTRA_DIST += esxutilstest.c
527
endif ! WITH_ESX
528

529
if WITH_VMX
530 531 532
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
533
vmx2xmltest_LDADD = $(LDADDS)
534 535 536 537

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
538
xml2vmxtest_LDADD = $(LDADDS)
539
else ! WITH_VMX
540
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
541
endif ! WITH_VMX
542

543 544 545 546 547 548 549 550 551
if WITH_VMWARE
vmwarevertest_SOURCES = \
    vmwarevertest.c \
    testutils.c testutils.h
vmwarevertest_LDADD = $(LDADDS)
else ! WITH_VMWARE
EXTRA_DIST += vmwarevertest.c
endif ! WITH_VMWARE

552 553 554 555 556
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
557 558 559 560 561
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

562
if WITH_NETWORK
563 564
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
565
	testutils.c testutils.h
566
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
567
else ! WITH_NETWORK
568
EXTRA_DIST += networkxml2conftest.c
569
endif !	WITH_NETWORK
570

571 572 573 574
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
575 576
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
577
else ! WITH_STORAGE_SHEEPDOG
578
EXTRA_DIST += storagebackendsheepdogtest.c
579
endif ! WITH_STORAGE_SHEEPDOG
580

581 582 583 584
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
585

586
if WITH_STORAGE
587 588 589 590 591
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
592
else ! WITH_STORAGE
593
EXTRA_DIST += storagevolxml2argvtest.c
594
endif ! WITH_STORAGE
595

596 597 598 599 600
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

601 602 603 604 605
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
606 607 608
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
609
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
610

611 612 613 614 615
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

616 617 618
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
619
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
620

P
Peter Krempa 已提交
621 622 623 624 625
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

626 627 628 629 630
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
631 632 633
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
634

635 636 637 638
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

639 640 641 642 643 644 645
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
646
commandhelper_LDFLAGS = -static
647

648 649 650
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
651 652
	$(NULL)
libvirtdconftest_LDADD = ../daemon/libvirtd_conf.la $(LDADDS)
653
else ! WITH_LIBVIRTD
654
EXTRA_DIST += libvirtdconftest.c
655
endif ! WITH_LIBVIRTD
656

657 658
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
659
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
660
virnetmessagetest_LDADD = $(LDADDS)
661

662 663
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
664
virnetsockettest_LDADD = $(LDADDS)
665

666 667 668
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
669
virnetserverclienttest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
670 671 672 673 674 675 676 677
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

678
if WITH_GNUTLS
679
virnettlscontexttest_SOURCES = \
680 681 682
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
683
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
684 685 686 687
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
688
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
689 690 691
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
692 693
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
694
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
695
EXTRA_DIST += pkix_asn1_tab.c
696 697
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
698
EXTRA_DIST += \
699 700 701
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
702
endif ! WITH_GNUTLS
703

704 705
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
706
virtimetest_LDADD = $(LDADDS)
707

708 709 710 711
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

712 713 714 715
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

716 717 718 719
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

720 721 722 723
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

724 725 726 727
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

728 729 730 731
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
732 733 734 735 736 737 738 739 740 741
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

742 743 744 745 746 747 748 749 750 751
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 已提交
752 753 754 755 756 757 758
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
759 760
virpcimock_la_LIBADD = $(GNULIB_LIBS) \
					   ../src/libvirt.la
M
Michal Privoznik 已提交
761 762 763
virpcimock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

764 765 766 767
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
768
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
769 770 771 772 773 774 775 776 777 778 779 780

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

781
else ! WITH_DBUS
782
EXTRA_DIST += virdbustest.c virsystemdtest.c virsystemdmock.c
783
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
784

785 786
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
787
viruritest_LDADD = $(LDADDS)
788

789 790
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
791
virkeyfiletest_LDADD = $(LDADDS)
792

793 794
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
795
virauthconfigtest_LDADD = $(LDADDS)
796

797 798
seclabeltest_SOURCES = \
	seclabeltest.c
799
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
800

801
if WITH_SECDRIVER_SELINUX
802
if WITH_ATTR
803 804
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
805
else ! WITH_TESTS
806
check_LTLIBRARIES += libsecurityselinuxhelper.la
807
endif ! WITH_TESTS
808 809 810 811 812 813 814 815

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
816
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
817 818
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
819 820 821 822 823

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
824
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
825 826
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
827 828 829
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
830 831
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
832

833 834 835 836
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

837 838 839
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
840

841
viratomictest_SOURCES = \
L
Laine Stump 已提交
842
	viratomictest.c testutils.h testutils.c
843 844
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
845 846 847 848
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
849 850 851 852
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

853
jsontest_SOURCES = \
854
	jsontest.c testutils.h testutils.c
855 856
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
857 858 859 860
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

861 862 863 864
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
865
endif WITH_DRIVER_MODULES
866

867 868
if WITH_LIBVIRTD
eventtest_SOURCES = \
869
	eventtest.c testutils.h testutils.c
870
eventtest_LDADD = -lrt $(LDADDS)
871
endif WITH_LIBVIRTD
872

873 874
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
875 876
libshunload_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation
877 878 879

shunloadtest_SOURCES = \
	shunloadtest.c
880
shunloadtest_LDADD = $(LIB_PTHREAD)
881 882
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
883 884 885 886
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

887 888 889 890
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

891
if WITH_LINUX
O
Osier Yang 已提交
892 893 894 895
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

896 897 898 899
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
endif  ! WITH_LINUX

900 901 902 903 904 905 906 907 908 909 910 911
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
912 913
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
914 915 916 917

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

918
else ! WITH_CIL
919
EXTRA_DIST += object-locking.ml
920
endif ! WITH_CIL
921

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