Makefile.am 17.2 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 89
	xml2vmxdata \
	.valgrind.supp
K
Karel Zak 已提交
90

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

113
if WITH_GNUTLS
114 115 116
test_programs += virnettlscontexttest
endif

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

126 127 128 129
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
endif

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

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

144
if WITH_LXC
145
test_programs += lxcxml2xmltest
146 147
endif

148
if WITH_OPENVZ
149
test_programs += openvzutilstest
150 151
endif

152
if WITH_ESX
153
test_programs += esxutilstest
154 155 156
endif

if WITH_VMX
157
test_programs += vmx2xmltest xml2vmxtest
158 159
endif

160
if WITH_CIL
161
test_programs += object-locking
162 163
endif

164
if WITH_YAJL
165
test_programs += jsontest
166 167
endif

168
test_programs += networkxml2xmltest
169

170
if WITH_NETWORK
171
test_programs += networkxml2conftest
172
endif
173

174 175 176 177
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
endif

178
test_programs += nwfilterxml2xmltest
179

180
if WITH_STORAGE
181
test_programs += storagevolxml2argvtest
182
endif
183

184
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
185

186
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
187

188
test_programs += interfacexml2xmltest
189

190
test_programs += cputest
191

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

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

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

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

251 252
EXTRA_DIST += $(test_scripts)

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

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

269 270
TESTS = $(test_programs) \
	$(test_scripts)
271

272
# NB, automake < 1.10 does not provide the real
273
# abs_top_{src/build}dir or builddir variables, so don't rely
274
# on them here. Fake them with 'pwd'
275 276 277 278 279 280
# 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

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

294

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

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

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

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

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

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

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

reconnect_SOURCES = \
327
	reconnect.c testutils.h testutils.c
328 329
reconnect_LDADD = $(LDADDS)

330 331
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
332
statstest_LDADD = $(xen_LDADDS)
333

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

340 341 342 343 344
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

345
if WITH_QEMU
346

347 348
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

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

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

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

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

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
379
qemuhelptest_LDADD = $(qemu_LDADDS)
380

381
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
382
qemumonitortest_LDADD = $(qemu_LDADDS)
383

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

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

403 404
if WITH_LXC

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

525 526 527 528
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

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

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
536
commandhelper_LDFLAGS = -static
537

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

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

552 553
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
554
virnetsockettest_LDADD = $(LDADDS)
555

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

571 572
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
573
virtimetest_LDADD = $(LDADDS)
574

575 576 577 578
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

579 580 581 582
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

583 584 585 586
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

587 588 589 590
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

591 592 593 594
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

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

605 606 607 608 609 610 611 612 613 614
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 已提交
615

616 617
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
618
viruritest_LDADD = $(LDADDS)
619

620 621
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
622
virkeyfiletest_LDADD = $(LDADDS)
623

624 625
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
626
virauthconfigtest_LDADD = $(LDADDS)
627

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

632 633 634 635 636 637 638 639 640 641 642 643 644 645 646
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)
647 648 649 650 651 652 653 654 655 656 657
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
658
endif
659
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c securityselinuxhelper.c
660

661 662 663 664
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

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

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

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

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

681
jsontest_SOURCES = \
682
	jsontest.c testutils.h testutils.c
683 684
jsontest_LDADD = $(LDADDS)

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

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

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

701 702 703 704 705 706
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
707
shunloadtest_LDADD = $(LIB_PTHREAD)
708 709
shunloadtest_DEPENDENCIES = libshunload.la

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

714 715 716 717
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738
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

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