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 297 298
# 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

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

312

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

316 317 318
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
319
sockettest_LDADD = $(LDADDS)
320

321
if WITH_XEN
E
Eric Blake 已提交
322
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
323 324
xen_LDADDS += $(LDADDS)

325
xml2sexprtest_SOURCES = \
326
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
327
	testutils.c testutils.h
328
xml2sexprtest_LDADD = $(xen_LDADDS)
329 330

sexpr2xmltest_SOURCES = \
331
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
332
	testutils.c testutils.h
333
sexpr2xmltest_LDADD = $(xen_LDADDS)
334

335
xmconfigtest_SOURCES = \
336
	xmconfigtest.c testutilsxen.c testutilsxen.h \
337
	testutils.c testutils.h
338
xmconfigtest_LDADD = $(xen_LDADDS)
339

340 341
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
342
xencapstest_LDADD = $(xen_LDADDS)
343 344

reconnect_SOURCES = \
345
	reconnect.c testutils.h testutils.c
346 347
reconnect_LDADD = $(LDADDS)

348 349
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
350
statstest_LDADD = $(xen_LDADDS)
351

352 353 354 355 356 357
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

358 359 360 361 362
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

363
if WITH_QEMU
364

365 366
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

376
qemuxml2argvtest_SOURCES = \
377
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
378
	testutils.c testutils.h
379
qemuxml2argvtest_LDADD = $(qemu_LDADDS)
380 381

qemuxml2xmltest_SOURCES = \
382
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
383
	testutils.c testutils.h
384
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
385

P
Philipp Hahn 已提交
386 387 388
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
389
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
390

391 392 393
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
394
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
395 396

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
397
qemuhelptest_LDADD = $(qemu_LDADDS)
398

399
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
400
qemumonitortest_LDADD = $(qemu_LDADDS)
401

402 403 404 405 406 407 408
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemumonitorjsontest_LDADD = $(qemu_LDADDS) libqemumonitortestutils.la

409 410 411 412 413 414 415
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemuhotplugtest_LDADD = $(qemu_LDADDS) libqemumonitortestutils.la

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

428 429
if WITH_LXC

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

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
439
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
440 441 442 443
else
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
endif

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

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

463
if WITH_VMX
464 465 466
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
467
vmx2xmltest_LDADD = $(LDADDS)
468 469 470 471

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
472
xml2vmxtest_LDADD = $(LDADDS)
473
else
474
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
475 476
endif

477 478 479 480 481
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

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

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

501 502 503 504
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
505

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

516 517 518 519 520
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

521 522 523 524 525
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
526 527 528
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
529
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
530

531 532 533 534 535
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

536 537 538 539 540
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

541 542 543 544 545
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
546 547 548
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
549

550 551 552 553
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

554 555 556 557 558 559 560
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
561
commandhelper_LDFLAGS = -static
562

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

572 573
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
574
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
575
virnetmessagetest_LDADD = $(LDADDS)
576

577 578
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
579
virnetsockettest_LDADD = $(LDADDS)
580

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

596 597
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
598
virtimetest_LDADD = $(LDADDS)
599

600 601 602 603
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

604 605 606 607
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

608 609 610 611
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

612 613 614 615
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

616 617 618 619
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
620 621 622 623 624 625 626 627 628 629
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

630 631 632 633 634 635 636 637 638 639
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 已提交
640

641 642
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
643
viruritest_LDADD = $(LDADDS)
644

645 646
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
647
virkeyfiletest_LDADD = $(LDADDS)
648

649 650
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
651
virauthconfigtest_LDADD = $(LDADDS)
652

653 654
seclabeltest_SOURCES = \
	seclabeltest.c
655
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
656

657 658 659 660 661 662 663 664 665 666 667 668 669 670 671
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)
672 673 674 675 676 677 678 679 680 681 682
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
683
endif
684
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c securityselinuxhelper.c
685

686 687 688 689
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

690 691 692
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
693

694
viratomictest_SOURCES = \
L
Laine Stump 已提交
695
	viratomictest.c testutils.h testutils.c
696 697
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
698 699 700 701
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
702 703 704 705
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

706
jsontest_SOURCES = \
707
	jsontest.c testutils.h testutils.c
708 709
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
710 711 712 713
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

714 715 716 717 718 719
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
endif

720 721
if WITH_LIBVIRTD
eventtest_SOURCES = \
722
	eventtest.c testutils.h testutils.c
723 724 725
eventtest_LDADD = -lrt $(LDADDS)
endif

726 727 728 729 730 731
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
732
shunloadtest_LDADD = $(LIB_PTHREAD)
733 734
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
735 736 737 738
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

739 740 741 742
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

O
Osier Yang 已提交
743 744 745 746
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767
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

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