Makefile.am 18.4 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 44 45
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
endif

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

K
Karel Zak 已提交
51
LDADDS = \
52
        $(WARN_CFLAGS) \
53
	$(PROBES_O) \
54 55
	../src/libvirt.la \
	../gnulib/lib/libgnu.la
K
Karel Zak 已提交
56

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

G
Gene Czarcinski 已提交
108
test_helpers = commandhelper ssh test_conf
109
test_programs = virshtest sockettest \
E
Eric Blake 已提交
110
	nodeinfotest virbuftest \
111 112
	commandtest seclabeltest \
	virhashtest virnetmessagetest virnetsockettest \
113
	viratomictest \
114
	utiltest shunloadtest \
115
	virtimetest viruritest virkeyfiletest \
H
Hu Tao 已提交
116
	virauthconfigtest \
117 118 119
	virbitmaptest \
	vircgrouptest \
	virendiantest \
120
	viridentitytest \
121
	virkeycodetest \
122
	virlockspacetest \
123
	virstringtest \
D
Daniel P. Berrange 已提交
124
        virportallocatortest \
V
Viktor Mihajlovski 已提交
125
	sysinfotest \
126
	virstoragetest \
127
        fdstreamtest \
O
Osier Yang 已提交
128
        fchosttest \
129
	$(NULL)
130

131 132 133 134 135
if WITH_DBUS
test_programs += virdbustest
endif


136
if WITH_GNUTLS
137 138 139
test_programs += virnettlscontexttest
endif

140 141
if WITH_SECDRIVER_SELINUX
test_programs += securityselinuxtest
142
if WITH_QEMU
143 144 145
if WITH_ATTR
test_programs += securityselinuxlabeltest
endif
146
endif
147
endif
148

149 150 151 152
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
endif

153 154 155
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
156

157
if WITH_XEN
158
test_programs += xml2sexprtest sexpr2xmltest \
159
	xmconfigtest xencapstest statstest reconnect
160
endif
161
if WITH_QEMU
162
test_programs += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
163
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
164
	qemumonitortest qemumonitorjsontest qemuhotplugtest
165 166
endif

167
if WITH_LXC
168
test_programs += lxcxml2xmltest
169 170
endif

171
if WITH_OPENVZ
172
test_programs += openvzutilstest
173 174
endif

175
if WITH_ESX
176
test_programs += esxutilstest
177 178 179
endif

if WITH_VMX
180
test_programs += vmx2xmltest xml2vmxtest
181 182
endif

183
if WITH_CIL
184
test_programs += object-locking
185 186
endif

187
if WITH_YAJL
188
test_programs += jsontest
189 190
endif

191
test_programs += networkxml2xmltest
192

193
if WITH_NETWORK
194
test_programs += networkxml2conftest
195
endif
196

197 198 199 200
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
endif

201
test_programs += nwfilterxml2xmltest
202

203
if WITH_STORAGE
204
test_programs += storagevolxml2argvtest
205
endif
206

207
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
208

209
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
210

211
test_programs += interfacexml2xmltest
212

213
test_programs += cputest
214

215 216
test_scripts = \
	capabilityschematest \
217
	interfaceschematest \
218 219 220 221
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
222
	nodedevschematest \
223 224
	nwfilterschematest \
	domainsnapshotschematest
225

A
Atsushi SAKAI 已提交
226
if WITH_LIBVIRTD
227 228 229 230 231
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
232 233
	libvirtd-fail			\
	libvirtd-pool			\
234 235 236 237 238
	read-bufsiz			\
	read-non-seekable		\
	start				\
	vcpupin				\
	virsh-all			\
239
	virsh-optparse			\
240
	virsh-schedinfo			\
241 242 243
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
244

245 246 247
test_programs += 			\
	eventtest			\
	libvirtdconftest
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
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			\
263 264 265
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
A
Atsushi SAKAI 已提交
266
endif
267

J
Jamie Strandboge 已提交
268 269
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
270 271
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
272
endif
273

274 275
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
276 277
test_libraries = libshunload.la \
		libvirportallocatormock.la \
278
		vircgroupmock.la \
D
Daniel P. Berrange 已提交
279
		$(NULL)
280 281 282 283
if WITH_QEMU
test_libraries += libqemumonitortestutils.la
endif

284 285
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
286
noinst_LTLIBRARIES = $(test_libraries)
287 288
else
check_PROGRAMS = $(test_programs) $(test_helpers)
289
check_LTLIBRARIES = $(test_libraries)
290
endif
291

292 293
TESTS = $(test_programs) \
	$(test_scripts)
294

295
# NB, automake < 1.10 does not provide the real
296
# abs_top_{src/build}dir or builddir variables, so don't rely
297
# on them here. Fake them with 'pwd'
298 299 300 301
# 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`
302 303
path_add = $(subst :,$(PATH_SEPARATOR),\
	$(subst !,$(lv_abs_top_builddir)/,!daemon:!tools:!tests))
304

305
TESTS_ENVIRONMENT =				\
306
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
307
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
308
  abs_builddir=`pwd`				\
309
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
310
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
311
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
312
  SHELL="$(SHELL)"				\
313
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
314
  LIBVIRT_AUTOSTART=0				\
315
  LC_ALL=C					\
316 317
  $(VG)

318

319 320
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(srcdir)/.valgrind.supp
321
valgrind:
322
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
323

324 325 326
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
327
sockettest_LDADD = $(LDADDS)
328

329
if WITH_XEN
E
Eric Blake 已提交
330
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
331 332
xen_LDADDS += $(LDADDS)

333
xml2sexprtest_SOURCES = \
334
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
335
	testutils.c testutils.h
336
xml2sexprtest_LDADD = $(xen_LDADDS)
337 338

sexpr2xmltest_SOURCES = \
339
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
340
	testutils.c testutils.h
341
sexpr2xmltest_LDADD = $(xen_LDADDS)
342

343
xmconfigtest_SOURCES = \
344
	xmconfigtest.c testutilsxen.c testutilsxen.h \
345
	testutils.c testutils.h
346
xmconfigtest_LDADD = $(xen_LDADDS)
347

348 349
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
350
xencapstest_LDADD = $(xen_LDADDS)
351 352

reconnect_SOURCES = \
353
	reconnect.c testutils.h testutils.c
354 355
reconnect_LDADD = $(LDADDS)

356 357
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
358
statstest_LDADD = $(xen_LDADDS)
359

360 361 362 363 364 365
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

366 367 368 369 370
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

371
if WITH_QEMU
372

373 374
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

375
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
376
if WITH_NETWORK
E
Eric Blake 已提交
377
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
378
endif
379
if WITH_DTRACE_PROBES
380
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
381
endif
382
qemu_LDADDS += $(LDADDS)
383

384
qemuxml2argvtest_SOURCES = \
385
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
386
	testutils.c testutils.h
387
qemuxml2argvtest_LDADD = $(qemu_LDADDS)
388 389

qemuxml2xmltest_SOURCES = \
390
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
391
	testutils.c testutils.h
392
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
393

P
Philipp Hahn 已提交
394 395 396
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
397
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
398

399 400 401
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
402
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
403 404

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
405
qemuhelptest_LDADD = $(qemu_LDADDS)
406

407
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
408
qemumonitortest_LDADD = $(qemu_LDADDS)
409

410 411 412 413 414 415 416
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemumonitorjsontest_LDADD = $(qemu_LDADDS) libqemumonitortestutils.la

417 418 419 420 421 422 423
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemuhotplugtest_LDADD = $(qemu_LDADDS) libqemumonitortestutils.la

424 425 426
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
427
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
428
else
429 430
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
431
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
432
	qemumonitorjsontest.c qemuhotplugtest.c \
433
	$(QEMUMONITORTESTUTILS_SOURCES)
434
endif
435

436 437
if WITH_LXC

E
Eric Blake 已提交
438
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
439
if WITH_NETWORK
E
Eric Blake 已提交
440
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
441 442
endif
lxc_LDADDS += $(LDADDS)
443 444 445 446

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
447
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
448 449 450 451
else
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
endif

452 453 454 455
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
456
openvzutilstest_LDADD = $(LDADDS)
457 458 459 460 461
else
EXTRA_DIST += openvzutilstest.c
endif
EXTRA_DIST += openvzutilstest.conf

462 463 464 465
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
466
esxutilstest_LDADD = $(LDADDS)
467 468 469
else
EXTRA_DIST += esxutilstest.c
endif
470

471
if WITH_VMX
472 473 474
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
475
vmx2xmltest_LDADD = $(LDADDS)
476 477 478 479

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
480
xml2vmxtest_LDADD = $(LDADDS)
481
else
482
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
483 484
endif

485 486 487 488 489
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

490
if WITH_NETWORK
491 492
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
493
	testutils.c testutils.h
494
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
495
else
496
EXTRA_DIST += networkxml2conftest.c
497
endif
498

499 500 501 502
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
503 504
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
505 506 507 508
else
EXTRA_DIST += storagebackendsheepdogtest.c
endif

509 510 511 512
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
513

514
if WITH_STORAGE
515 516 517 518 519
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
520 521 522
else
EXTRA_DIST += storagevolxml2argvtest.c
endif
523

524 525 526 527 528
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

529 530 531 532 533
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
534 535 536
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
537
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
538

539 540 541 542 543
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

544 545 546 547 548
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

549 550 551 552 553
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
554 555 556
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
557

558 559 560 561
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

562 563 564 565 566 567 568
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
569
commandhelper_LDFLAGS = -static
570

571 572 573 574 575 576 577 578 579
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
	../daemon/libvirtd-config.c
libvirtdconftest_LDADD = $(LDADDS)
else
EXTRA_DIST += libvirtdconftest.c
endif

580 581
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
582
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
583
virnetmessagetest_LDADD = $(LDADDS)
584

585 586
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
587
virnetsockettest_LDADD = $(LDADDS)
588

589
if WITH_GNUTLS
590
virnettlscontexttest_SOURCES = \
E
Eric Blake 已提交
591
	virnettlscontexttest.c testutils.h testutils.c
592
virnettlscontexttest_LDADD = $(LDADDS)
E
Eric Blake 已提交
593 594 595 596 597 598
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
else
EXTRA_DIST += pkix_asn1_tab.c
endif
599 600 601 602
else
EXTRA_DIST += \
	virnettlscontexttest.c testutils.h testutils.c pkix_asn1_tab.c
endif
603

604 605
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
606
virtimetest_LDADD = $(LDADDS)
607

608 609 610 611
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

612 613 614 615
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

616 617 618 619
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

620 621 622 623
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

624 625 626 627
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
628 629 630 631 632 633 634 635 636 637
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

638 639 640 641 642 643 644 645 646 647
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

648 649 650 651 652 653 654 655
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbustest_LDADD = $(LDADDS)
else
EXTRA_DIST += virdbustest.c
endif
D
Daniel P. Berrange 已提交
656

657 658
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
659
viruritest_LDADD = $(LDADDS)
660

661 662
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
663
virkeyfiletest_LDADD = $(LDADDS)
664

665 666
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
667
virauthconfigtest_LDADD = $(LDADDS)
668

669 670
seclabeltest_SOURCES = \
	seclabeltest.c
671
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
672

673 674 675 676 677 678 679 680 681 682 683 684 685 686 687
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)
688 689
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
690 691 692 693 694 695 696

if WITH_QEMU
if WITH_ATTR
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
securityselinuxlabeltest_LDADD = $(qemu_LDADDS)
697 698
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
699 700
endif
endif
701
endif
702 703
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
704

705 706 707 708
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

709 710 711
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
712

713
viratomictest_SOURCES = \
L
Laine Stump 已提交
714
	viratomictest.c testutils.h testutils.c
715 716
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
717 718 719 720
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
721 722 723 724
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

725
jsontest_SOURCES = \
726
	jsontest.c testutils.h testutils.c
727 728
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
729 730 731 732
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

733 734 735 736 737 738
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
endif

739 740
if WITH_LIBVIRTD
eventtest_SOURCES = \
741
	eventtest.c testutils.h testutils.c
742 743 744
eventtest_LDADD = -lrt $(LDADDS)
endif

745 746
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
747 748
libshunload_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation
749 750 751

shunloadtest_SOURCES = \
	shunloadtest.c
752
shunloadtest_LDADD = $(LIB_PTHREAD)
753 754
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
755 756 757 758
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

759 760 761 762
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

O
Osier Yang 已提交
763 764 765 766
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

767 768 769 770 771 772 773 774 775 776 777 778
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
779 780
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
781 782 783 784 785 786 787 788

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

else
EXTRA_DIST += object-locking.ml
endif

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