Makefile.am 18.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.
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
if WITH_GNUTLS
132 133 134
test_programs += virnettlscontexttest
endif

135 136
if WITH_SECDRIVER_SELINUX
test_programs += securityselinuxtest
137
if WITH_QEMU
138 139 140
if WITH_ATTR
test_programs += securityselinuxlabeltest
endif
141
endif
142
endif
143

144 145 146 147
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
endif

148 149 150
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
151

152
if WITH_XEN
153
test_programs += xml2sexprtest sexpr2xmltest \
154
	xmconfigtest xencapstest statstest reconnect
155
endif
156
if WITH_QEMU
157
test_programs += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
158
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
159
	qemumonitortest qemumonitorjsontest qemuhotplugtest
160 161
endif

162
if WITH_LXC
163
test_programs += lxcxml2xmltest
164 165
endif

166
if WITH_OPENVZ
167
test_programs += openvzutilstest
168 169
endif

170
if WITH_ESX
171
test_programs += esxutilstest
172 173 174
endif

if WITH_VMX
175
test_programs += vmx2xmltest xml2vmxtest
176 177
endif

178
if WITH_CIL
179
test_programs += object-locking
180 181
endif

182
if WITH_YAJL
183
test_programs += jsontest
184 185
endif

186
test_programs += networkxml2xmltest
187

188
if WITH_NETWORK
189
test_programs += networkxml2conftest
190
endif
191

192 193 194 195
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
endif

196
test_programs += nwfilterxml2xmltest
197

198
if WITH_STORAGE
199
test_programs += storagevolxml2argvtest
200
endif
201

202
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
203

204
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
205

206
test_programs += interfacexml2xmltest
207

208
test_programs += cputest
209

210 211
test_scripts = \
	capabilityschematest \
212
	interfaceschematest \
213 214 215 216
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
217
	nodedevschematest \
218 219
	nwfilterschematest \
	domainsnapshotschematest
220

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

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

J
Jamie Strandboge 已提交
263 264
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
265 266
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
267
endif
268

269 270
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
271 272
test_libraries = libshunload.la \
		libvirportallocatormock.la \
273
		vircgroupmock.la \
D
Daniel P. Berrange 已提交
274
		$(NULL)
275 276 277 278
if WITH_QEMU
test_libraries += libqemumonitortestutils.la
endif

279 280
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
281
noinst_LTLIBRARIES = $(test_libraries)
282 283
else
check_PROGRAMS = $(test_programs) $(test_helpers)
284
check_LTLIBRARIES = $(test_libraries)
285
endif
286

287 288
TESTS = $(test_programs) \
	$(test_scripts)
289

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

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

313

314 315
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(srcdir)/.valgrind.supp
316
valgrind:
317
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
318

319 320 321
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
322
sockettest_LDADD = $(LDADDS)
323

324
if WITH_XEN
E
Eric Blake 已提交
325
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
326 327
xen_LDADDS += $(LDADDS)

328
xml2sexprtest_SOURCES = \
329
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
330
	testutils.c testutils.h
331
xml2sexprtest_LDADD = $(xen_LDADDS)
332 333

sexpr2xmltest_SOURCES = \
334
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
335
	testutils.c testutils.h
336
sexpr2xmltest_LDADD = $(xen_LDADDS)
337

338
xmconfigtest_SOURCES = \
339
	xmconfigtest.c testutilsxen.c testutilsxen.h \
340
	testutils.c testutils.h
341
xmconfigtest_LDADD = $(xen_LDADDS)
342

343 344
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
345
xencapstest_LDADD = $(xen_LDADDS)
346 347

reconnect_SOURCES = \
348
	reconnect.c testutils.h testutils.c
349 350
reconnect_LDADD = $(LDADDS)

351 352
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
353
statstest_LDADD = $(xen_LDADDS)
354

355 356 357 358 359 360
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

361 362 363 364 365
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

366
if WITH_QEMU
367

368 369
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

370
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
371
if WITH_NETWORK
E
Eric Blake 已提交
372
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
373
endif
374
if WITH_DTRACE_PROBES
375
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
376
endif
377
qemu_LDADDS += $(LDADDS)
378

379
qemuxml2argvtest_SOURCES = \
380
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
381
	testutils.c testutils.h
382
qemuxml2argvtest_LDADD = $(qemu_LDADDS)
383 384

qemuxml2xmltest_SOURCES = \
385
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
386
	testutils.c testutils.h
387
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
388

P
Philipp Hahn 已提交
389 390 391
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
392
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
393

394 395 396
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
397
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
398 399

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
400
qemuhelptest_LDADD = $(qemu_LDADDS)
401

402
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
403
qemumonitortest_LDADD = $(qemu_LDADDS)
404

405 406 407 408 409 410 411
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemumonitorjsontest_LDADD = $(qemu_LDADDS) libqemumonitortestutils.la

412 413 414 415 416 417 418
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemuhotplugtest_LDADD = $(qemu_LDADDS) libqemumonitortestutils.la

419 420 421
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
422
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
423
else
424 425
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
426
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
427
	qemumonitorjsontest.c qemuhotplugtest.c \
428
	$(QEMUMONITORTESTUTILS_SOURCES)
429
endif
430

431 432
if WITH_LXC

E
Eric Blake 已提交
433
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
434
if WITH_NETWORK
E
Eric Blake 已提交
435
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
436 437
endif
lxc_LDADDS += $(LDADDS)
438 439 440 441

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
442
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
443 444 445 446
else
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
endif

447 448 449 450
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
451
openvzutilstest_LDADD = $(LDADDS)
452 453 454 455 456
else
EXTRA_DIST += openvzutilstest.c
endif
EXTRA_DIST += openvzutilstest.conf

457 458 459 460
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
461
esxutilstest_LDADD = $(LDADDS)
462 463 464
else
EXTRA_DIST += esxutilstest.c
endif
465

466
if WITH_VMX
467 468 469
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
470
vmx2xmltest_LDADD = $(LDADDS)
471 472 473 474

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
475
xml2vmxtest_LDADD = $(LDADDS)
476
else
477
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
478 479
endif

480 481 482 483 484
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

485
if WITH_NETWORK
486 487
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
488
	testutils.c testutils.h
489
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
490
else
491
EXTRA_DIST += networkxml2conftest.c
492
endif
493

494 495 496 497
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
498 499
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
500 501 502 503
else
EXTRA_DIST += storagebackendsheepdogtest.c
endif

504 505 506 507
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
508

509
if WITH_STORAGE
510 511 512 513 514
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
515 516 517
else
EXTRA_DIST += storagevolxml2argvtest.c
endif
518

519 520 521 522 523
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

524 525 526 527 528
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
529 530 531
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
532
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
533

534 535 536 537 538
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

539 540 541 542 543
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

544 545 546 547 548
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
549 550 551
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
552

553 554 555 556
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

557 558 559 560 561 562 563
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
564
commandhelper_LDFLAGS = -static
565

566 567 568 569 570 571 572 573 574
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
	../daemon/libvirtd-config.c
libvirtdconftest_LDADD = $(LDADDS)
else
EXTRA_DIST += libvirtdconftest.c
endif

575 576
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
577
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
578
virnetmessagetest_LDADD = $(LDADDS)
579

580 581
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
582
virnetsockettest_LDADD = $(LDADDS)
583

584
if WITH_GNUTLS
585
virnettlscontexttest_SOURCES = \
E
Eric Blake 已提交
586
	virnettlscontexttest.c testutils.h testutils.c
587
virnettlscontexttest_LDADD = $(LDADDS)
E
Eric Blake 已提交
588 589 590 591 592 593
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
else
EXTRA_DIST += pkix_asn1_tab.c
endif
594 595 596 597
else
EXTRA_DIST += \
	virnettlscontexttest.c testutils.h testutils.c pkix_asn1_tab.c
endif
598

599 600
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
601
virtimetest_LDADD = $(LDADDS)
602

603 604 605 606
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

607 608 609 610
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

611 612 613 614
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

615 616 617 618
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

619 620 621 622
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
623 624 625 626 627 628 629 630 631 632
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

633 634 635 636 637 638 639 640 641 642
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 已提交
643

644 645
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
646
viruritest_LDADD = $(LDADDS)
647

648 649
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
650
virkeyfiletest_LDADD = $(LDADDS)
651

652 653
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
654
virauthconfigtest_LDADD = $(LDADDS)
655

656 657
seclabeltest_SOURCES = \
	seclabeltest.c
658
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
659

660 661 662 663 664 665 666 667 668 669 670 671 672 673 674
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)
675 676
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
677 678 679 680 681 682 683

if WITH_QEMU
if WITH_ATTR
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
securityselinuxlabeltest_LDADD = $(qemu_LDADDS)
684 685
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
686 687
endif
endif
688
endif
689 690
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
691

692 693 694 695
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

696 697 698
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
699

700
viratomictest_SOURCES = \
L
Laine Stump 已提交
701
	viratomictest.c testutils.h testutils.c
702 703
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
704 705 706 707
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
708 709 710 711
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

712
jsontest_SOURCES = \
713
	jsontest.c testutils.h testutils.c
714 715
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
716 717 718 719
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

720 721 722 723 724 725
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
endif

726 727
if WITH_LIBVIRTD
eventtest_SOURCES = \
728
	eventtest.c testutils.h testutils.c
729 730 731
eventtest_LDADD = -lrt $(LDADDS)
endif

732 733
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
734 735
libshunload_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation
736 737 738

shunloadtest_SOURCES = \
	shunloadtest.c
739
shunloadtest_LDADD = $(LIB_PTHREAD)
740 741
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
742 743 744 745
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

746 747 748 749
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

O
Osier Yang 已提交
750 751 752 753
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

754 755 756 757 758 759 760 761 762 763 764 765
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
766 767
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
768 769 770 771 772 773 774 775

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

else
EXTRA_DIST += object-locking.ml
endif

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