Makefile.am 17.0 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
	$(NULL)
111

112
if WITH_GNUTLS
113 114 115
test_programs += virnettlscontexttest
endif

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

125 126 127 128
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
endif

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

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

143
if WITH_LXC
144
test_programs += lxcxml2xmltest
145 146
endif

147
if WITH_OPENVZ
148
test_programs += openvzutilstest
149 150
endif

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

if WITH_VMX
156
test_programs += vmx2xmltest xml2vmxtest
157 158
endif

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

163
if WITH_YAJL
164
test_programs += jsontest
165 166
endif

167
test_programs += networkxml2xmltest
168

169
if WITH_NETWORK
170
test_programs += networkxml2conftest
171
endif
172

173 174 175 176
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
endif

177
test_programs += nwfilterxml2xmltest
178

179
if WITH_STORAGE
180
test_programs += storagevolxml2argvtest
181
endif
182

183
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
184

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

187
test_programs += interfacexml2xmltest
188

189
test_programs += cputest
190

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

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

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

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

250 251
EXTRA_DIST += $(test_scripts)

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

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

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

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

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

293

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

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

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

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

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

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

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

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

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

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

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

344
if WITH_QEMU
345

346 347
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

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

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

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

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

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

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

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

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

402 403
if WITH_LXC

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733
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

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