Makefile.am 17.3 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.
4 5
## See COPYING.LIB for the License of this software

6 7
SHELL = $(PREFERABLY_POSIX_SHELL)

K
Karel Zak 已提交
8
INCLUDES = \
9
	-I$(top_builddir) -I$(top_srcdir) \
10 11 12
	-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 \
13
	-I$(top_srcdir)/src/util \
14 15
	-I$(top_srcdir)/src/conf \
	$(GETTEXT_CPPFLAGS)
E
Eric Blake 已提交
16 17

AM_CFLAGS = \
18
	-Dabs_builddir="\"`pwd`\"" \
19 20
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
21
	$(SASL_CFLAGS) \
22
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
23
	$(APPARMOR_CFLAGS) \
24
	$(YAJL_CFLAGS) \
E
Eric Blake 已提交
25 26
	$(COVERAGE_CFLAGS) \
	$(WARN_CFLAGS)
27

28 29 30 31 32
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
endif

33
PROBES_O =
34
if WITH_DTRACE_PROBES
35
PROBES_O += ../src/libvirt_probes.lo
36 37
endif

K
Karel Zak 已提交
38
LDADDS = \
39
        $(WARN_CFLAGS) \
40
	$(PROBES_O) \
41 42
	../src/libvirt.la \
	../gnulib/lib/libgnu.la
K
Karel Zak 已提交
43

44
EXTRA_DIST =		\
45
	capabilityschemadata \
E
Eric Blake 已提交
46 47 48 49
	capabilityschematest \
	commanddata \
	confdata \
	cputestdata \
50
	domainschemadata \
E
Eric Blake 已提交
51 52 53 54
	domainschematest \
	domainsnapshotschematest \
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
55
	interfaceschemadata \
56
	lxcxml2xmldata \
E
Eric Blake 已提交
57 58 59
	networkschematest \
	networkxml2xmlin \
	networkxml2xmlout \
60
	networkxml2confdata \
E
Eric Blake 已提交
61 62 63 64 65 66 67 68 69 70
	nodedevschemadata \
	nodedevschematest \
	nodeinfodata     \
	nwfilterschematest \
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
	qemuhelpdata \
	qemuxml2argvdata \
	qemuxml2xmloutdata \
P
Philipp Hahn 已提交
71
	qemuxmlnsdata \
72
	securityselinuxlabeldata \
E
Eric Blake 已提交
73 74
	schematestutils.sh \
	sexpr2xmldata \
75
	storagepoolschematest \
76
	storagepoolxml2xmlin \
E
Eric Blake 已提交
77
	storagepoolxml2xmlout \
78
	storagevolxml2argvdata \
79
	storagevolschematest \
80
	storagevolxml2xmlin \
E
Eric Blake 已提交
81
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
82
	sysinfodata \
E
Eric Blake 已提交
83
	test-lib.sh	\
84
	vmx2xmldata \
E
Eric Blake 已提交
85 86 87
	xencapsdata \
	xmconfigdata \
	xml2sexprdata \
88
	xml2vmxdata \
O
Osier Yang 已提交
89 90
	.valgrind.supp \
	fchostdata
K
Karel Zak 已提交
91

G
Gene Czarcinski 已提交
92
test_helpers = commandhelper ssh test_conf
93
test_programs = virshtest sockettest \
E
Eric Blake 已提交
94
	nodeinfotest virbuftest \
95 96
	commandtest seclabeltest \
	virhashtest virnetmessagetest virnetsockettest \
97
	viratomictest \
98
	utiltest shunloadtest \
99
	virtimetest viruritest virkeyfiletest \
H
Hu Tao 已提交
100
	virauthconfigtest \
101 102 103
	virbitmaptest \
	vircgrouptest \
	virendiantest \
104
	viridentitytest \
105
	virkeycodetest \
106
	virlockspacetest \
107
	virstringtest \
D
Daniel P. Berrange 已提交
108
        virportallocatortest \
V
Viktor Mihajlovski 已提交
109
	sysinfotest \
110
	virstoragetest \
111
        fdstreamtest \
O
Osier Yang 已提交
112
        fchosttest \
113
	$(NULL)
114

115
if WITH_GNUTLS
116 117 118
test_programs += virnettlscontexttest
endif

119 120
if WITH_SECDRIVER_SELINUX
test_programs += securityselinuxtest
121
if WITH_QEMU
122 123 124
if WITH_ATTR
test_programs += securityselinuxlabeltest
endif
125
endif
126
endif
127

128 129 130 131
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
endif

132 133 134
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
135

136
if WITH_XEN
137
test_programs += xml2sexprtest sexpr2xmltest \
138
	xmconfigtest xencapstest statstest reconnect
139
endif
140
if WITH_QEMU
141
test_programs += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
142
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
143
	qemumonitortest qemumonitorjsontest
144 145
endif

146
if WITH_LXC
147
test_programs += lxcxml2xmltest
148 149
endif

150
if WITH_OPENVZ
151
test_programs += openvzutilstest
152 153
endif

154
if WITH_ESX
155
test_programs += esxutilstest
156 157 158
endif

if WITH_VMX
159
test_programs += vmx2xmltest xml2vmxtest
160 161
endif

162
if WITH_CIL
163
test_programs += object-locking
164 165
endif

166
if WITH_YAJL
167
test_programs += jsontest
168 169
endif

170
test_programs += networkxml2xmltest
171

172
if WITH_NETWORK
173
test_programs += networkxml2conftest
174
endif
175

176 177 178 179
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
endif

180
test_programs += nwfilterxml2xmltest
181

182
if WITH_STORAGE
183
test_programs += storagevolxml2argvtest
184
endif
185

186
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
187

188
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
189

190
test_programs += interfacexml2xmltest
191

192
test_programs += cputest
193

194 195
test_scripts = \
	capabilityschematest \
196
	interfaceschematest \
197 198 199 200
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
201
	nodedevschematest \
202 203
	nwfilterschematest \
	domainsnapshotschematest
204

A
Atsushi SAKAI 已提交
205
if WITH_LIBVIRTD
206 207 208 209 210
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
211 212
	libvirtd-fail			\
	libvirtd-pool			\
213 214 215 216 217
	read-bufsiz			\
	read-non-seekable		\
	start				\
	vcpupin				\
	virsh-all			\
218
	virsh-optparse			\
219
	virsh-schedinfo			\
220 221 222
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
223

224 225 226
test_programs += 			\
	eventtest			\
	libvirtdconftest
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
else
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			\
242 243 244
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
A
Atsushi SAKAI 已提交
245
endif
246

J
Jamie Strandboge 已提交
247 248
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
249 250
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
251
endif
252

253 254
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
255 256
test_libraries = libshunload.la \
		libvirportallocatormock.la \
257
		vircgroupmock.la \
D
Daniel P. Berrange 已提交
258
		$(NULL)
259 260 261 262
if WITH_QEMU
test_libraries += libqemumonitortestutils.la
endif

263 264
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
265
noinst_LTLIBRARIES = $(test_libraries)
266 267
else
check_PROGRAMS = $(test_programs) $(test_helpers)
268
check_LTLIBRARIES = $(test_libraries)
269
endif
270

271 272
TESTS = $(test_programs) \
	$(test_scripts)
273

274
# NB, automake < 1.10 does not provide the real
275
# abs_top_{src/build}dir or builddir variables, so don't rely
276
# on them here. Fake them with 'pwd'
277 278 279 280 281 282
# 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`
path_add = $(lv_abs_top_builddir)/daemon$(PATH_SEPARATOR)$(lv_abs_top_builddir)/tools$(PATH_SEPARATOR)$(lv_abs_top_builddir)/tests

283
TESTS_ENVIRONMENT =				\
284
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
285
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
286
  abs_builddir=`pwd`				\
287
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
288
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
289
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
290
  SHELL="$(SHELL)"				\
291
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
292
  LIBVIRT_AUTOSTART=0				\
293
  LC_ALL=C					\
294 295
  $(VG)

296

297
valgrind:
298
	$(MAKE) check VG="libtool --mode=execute valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
299

300 301 302
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
303
sockettest_LDADD = $(LDADDS)
304

305
if WITH_XEN
E
Eric Blake 已提交
306
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
307 308
xen_LDADDS += $(LDADDS)

309
xml2sexprtest_SOURCES = \
310
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
311
	testutils.c testutils.h
312
xml2sexprtest_LDADD = $(xen_LDADDS)
313 314

sexpr2xmltest_SOURCES = \
315
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
316
	testutils.c testutils.h
317
sexpr2xmltest_LDADD = $(xen_LDADDS)
318

319
xmconfigtest_SOURCES = \
320
	xmconfigtest.c testutilsxen.c testutilsxen.h \
321
	testutils.c testutils.h
322
xmconfigtest_LDADD = $(xen_LDADDS)
323

324 325
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
326
xencapstest_LDADD = $(xen_LDADDS)
327 328

reconnect_SOURCES = \
329
	reconnect.c testutils.h testutils.c
330 331
reconnect_LDADD = $(LDADDS)

332 333
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
334
statstest_LDADD = $(xen_LDADDS)
335

336 337 338 339 340 341
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

342 343 344 345 346
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

347
if WITH_QEMU
348

349 350
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

351
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
352
if WITH_NETWORK
E
Eric Blake 已提交
353
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
354
endif
355
if WITH_DTRACE_PROBES
356
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
357
endif
358
qemu_LDADDS += $(LDADDS)
359

360
qemuxml2argvtest_SOURCES = \
361
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
362
	testutils.c testutils.h
363
qemuxml2argvtest_LDADD = $(qemu_LDADDS)
364 365

qemuxml2xmltest_SOURCES = \
366
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
367
	testutils.c testutils.h
368
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
369

P
Philipp Hahn 已提交
370 371 372
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
373
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
374

375 376 377
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
378
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
379 380

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
381
qemuhelptest_LDADD = $(qemu_LDADDS)
382

383
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
384
qemumonitortest_LDADD = $(qemu_LDADDS)
385

386 387 388 389 390 391 392
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemumonitorjsontest_LDADD = $(qemu_LDADDS) libqemumonitortestutils.la

393 394 395
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
396
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
397
else
398 399
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
400
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
401
	qemumonitorjsontest.c \
402
	$(QEMUMONITORTESTUTILS_SOURCES)
403
endif
404

405 406
if WITH_LXC

E
Eric Blake 已提交
407
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
408
if WITH_NETWORK
E
Eric Blake 已提交
409
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
410 411
endif
lxc_LDADDS += $(LDADDS)
412 413 414 415

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
416
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
417 418 419 420
else
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
endif

421 422 423 424
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
425
openvzutilstest_LDADD = $(LDADDS)
426 427 428 429 430
else
EXTRA_DIST += openvzutilstest.c
endif
EXTRA_DIST += openvzutilstest.conf

431 432 433 434
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
435
esxutilstest_LDADD = $(LDADDS)
436 437 438
else
EXTRA_DIST += esxutilstest.c
endif
439

440
if WITH_VMX
441 442 443
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
444
vmx2xmltest_LDADD = $(LDADDS)
445 446 447 448

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
449
xml2vmxtest_LDADD = $(LDADDS)
450
else
451
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
452 453
endif

454 455 456 457 458
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

459
if WITH_NETWORK
460 461
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
462
	testutils.c testutils.h
463
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
464
else
465
EXTRA_DIST += networkxml2conftest.c
466
endif
467

468 469 470 471
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
472 473
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
474 475 476 477
else
EXTRA_DIST += storagebackendsheepdogtest.c
endif

478 479 480 481
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
482

483
if WITH_STORAGE
484 485 486 487 488
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
489 490 491
else
EXTRA_DIST += storagevolxml2argvtest.c
endif
492

493 494 495 496 497
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

498 499 500 501 502
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
503 504 505
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
506
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
507

508 509 510 511 512
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

513 514 515 516 517
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

518 519 520 521 522
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
523 524 525
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
526

527 528 529 530
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

531 532 533 534 535 536 537
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
538
commandhelper_LDFLAGS = -static
539

540 541 542 543 544 545 546 547 548
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
	../daemon/libvirtd-config.c
libvirtdconftest_LDADD = $(LDADDS)
else
EXTRA_DIST += libvirtdconftest.c
endif

549 550
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
551
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
552
virnetmessagetest_LDADD = $(LDADDS)
553

554 555
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
556
virnetsockettest_LDADD = $(LDADDS)
557

558
if WITH_GNUTLS
559
virnettlscontexttest_SOURCES = \
E
Eric Blake 已提交
560
	virnettlscontexttest.c testutils.h testutils.c
561
virnettlscontexttest_LDADD = $(LDADDS)
E
Eric Blake 已提交
562 563 564 565 566 567
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
else
EXTRA_DIST += pkix_asn1_tab.c
endif
568 569 570 571
else
EXTRA_DIST += \
	virnettlscontexttest.c testutils.h testutils.c pkix_asn1_tab.c
endif
572

573 574
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
575
virtimetest_LDADD = $(LDADDS)
576

577 578 579 580
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

581 582 583 584
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

585 586 587 588
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

589 590 591 592
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

593 594 595 596
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
597 598 599 600 601 602 603 604 605 606
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

607 608 609 610 611 612 613 614 615 616
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

D
Daniel P. Berrange 已提交
617

618 619
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
620
viruritest_LDADD = $(LDADDS)
621

622 623
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
624
virkeyfiletest_LDADD = $(LDADDS)
625

626 627
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
628
virauthconfigtest_LDADD = $(LDADDS)
629

630 631
seclabeltest_SOURCES = \
	seclabeltest.c
632
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
633

634 635 636 637 638 639 640 641 642 643 644 645 646 647 648
if WITH_SECDRIVER_SELINUX
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
else
check_LTLIBRARIES += libsecurityselinuxhelper.la
endif

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
securityselinuxtest_LDADD = $(LDADDS)
649 650 651 652 653 654 655 656 657 658 659
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la ../src/libvirt.la

if WITH_QEMU
if WITH_ATTR
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
securityselinuxlabeltest_LDADD = $(qemu_LDADDS)
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la ../src/libvirt.la
endif
endif
660
endif
661
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c securityselinuxhelper.c
662

663 664 665 666
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

667 668 669
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
670

671
viratomictest_SOURCES = \
L
Laine Stump 已提交
672
	viratomictest.c testutils.h testutils.c
673 674
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
675 676 677 678
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
679 680 681 682
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

683
jsontest_SOURCES = \
684
	jsontest.c testutils.h testutils.c
685 686
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
687 688 689 690
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

691 692 693 694 695 696
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
endif

697 698
if WITH_LIBVIRTD
eventtest_SOURCES = \
699
	eventtest.c testutils.h testutils.c
700 701 702
eventtest_LDADD = -lrt $(LDADDS)
endif

703 704 705 706 707 708
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
libshunload_la_LDFLAGS = -module -avoid-version -rpath /evil/libtool/hack/to/force/shared/lib/creation

shunloadtest_SOURCES = \
	shunloadtest.c
709
shunloadtest_LDADD = $(LIB_PTHREAD)
710 711
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
712 713 714 715
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

716 717 718 719
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

O
Osier Yang 已提交
720 721 722 723
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744
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
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) $(CILOPTLIBS) $< -o $@

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

else
EXTRA_DIST += object-locking.ml
endif

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