Makefile.am 18.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.
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 83 84
	nodedevschemadata \
	nodedevschematest \
	nodeinfodata     \
	nwfilterschematest \
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
	qemuhelpdata \
	qemuxml2argvdata \
	qemuxml2xmloutdata \
P
Philipp Hahn 已提交
85
	qemuxmlnsdata \
86
	securityselinuxlabeldata \
E
Eric Blake 已提交
87 88
	schematestutils.sh \
	sexpr2xmldata \
89
	storagepoolschemadata \
90
	storagepoolschematest \
91
	storagepoolxml2xmlin \
E
Eric Blake 已提交
92
	storagepoolxml2xmlout \
93
	storagevolxml2argvdata \
94
	storagevolschemadata \
95
	storagevolschematest \
96
	storagevolxml2xmlin \
E
Eric Blake 已提交
97
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
98
	sysinfodata \
E
Eric Blake 已提交
99
	test-lib.sh	\
100
	vmx2xmldata \
E
Eric Blake 已提交
101 102 103
	xencapsdata \
	xmconfigdata \
	xml2sexprdata \
104
	xml2vmxdata \
O
Osier Yang 已提交
105
	.valgrind.supp
K
Karel Zak 已提交
106

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

130
if WITH_GNUTLS
131 132 133
test_programs += virnettlscontexttest
endif

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

143 144 145 146
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
endif

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

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

161
if WITH_LXC
162
test_programs += lxcxml2xmltest
163 164
endif

165
if WITH_OPENVZ
166
test_programs += openvzutilstest
167 168
endif

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

if WITH_VMX
174
test_programs += vmx2xmltest xml2vmxtest
175 176
endif

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

181
if WITH_YAJL
182
test_programs += jsontest
183 184
endif

185
test_programs += networkxml2xmltest
186

187
if WITH_NETWORK
188
test_programs += networkxml2conftest
189
endif
190

191 192 193 194
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
endif

195
test_programs += nwfilterxml2xmltest
196

197
if WITH_STORAGE
198
test_programs += storagevolxml2argvtest
199
endif
200

201
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
202

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

205
test_programs += interfacexml2xmltest
206

207
test_programs += cputest
208

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

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

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

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

268 269
EXTRA_DIST += $(test_scripts)

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

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

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

289
# NB, automake < 1.10 does not provide the real
290
# abs_top_{src/build}dir or builddir variables, so don't rely
291
# on them here. Fake them with 'pwd'
292 293 294 295 296 297
# 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

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

311

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

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

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

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

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

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

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

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

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

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

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

362
if WITH_QEMU
363

364 365
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

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

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

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

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

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

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

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

408 409 410
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
411
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
412
else
413 414
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
415
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
416
	qemumonitorjsontest.c \
417
	$(QEMUMONITORTESTUTILS_SOURCES)
418
endif
419

420 421
if WITH_LXC

E
Eric Blake 已提交
422
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
423
if WITH_NETWORK
E
Eric Blake 已提交
424
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
425 426
endif
lxc_LDADDS += $(LDADDS)
427 428 429 430

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
431
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
432 433 434 435
else
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
endif

436 437 438 439
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
440
openvzutilstest_LDADD = $(LDADDS)
441 442 443 444 445
else
EXTRA_DIST += openvzutilstest.c
endif
EXTRA_DIST += openvzutilstest.conf

446 447 448 449
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
450
esxutilstest_LDADD = $(LDADDS)
451 452 453
else
EXTRA_DIST += esxutilstest.c
endif
454

455
if WITH_VMX
456 457 458
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
459
vmx2xmltest_LDADD = $(LDADDS)
460 461 462 463

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
464
xml2vmxtest_LDADD = $(LDADDS)
465
else
466
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
467 468
endif

469 470 471 472 473
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

474
if WITH_NETWORK
475 476
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
477
	testutils.c testutils.h
478
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
479
else
480
EXTRA_DIST += networkxml2conftest.c
481
endif
482

483 484 485 486
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
487 488
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
489 490 491 492
else
EXTRA_DIST += storagebackendsheepdogtest.c
endif

493 494 495 496
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
497

498
if WITH_STORAGE
499 500 501 502 503
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
504 505 506
else
EXTRA_DIST += storagevolxml2argvtest.c
endif
507

508 509 510 511 512
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

513 514 515 516 517
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
518 519 520
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
521
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
522

523 524 525 526 527
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

528 529 530 531 532
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

533 534 535 536 537
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
538 539 540
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
541

542 543 544 545
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

546 547 548 549 550 551 552
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
553
commandhelper_LDFLAGS = -static
554

555 556 557 558 559 560 561 562 563
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
	../daemon/libvirtd-config.c
libvirtdconftest_LDADD = $(LDADDS)
else
EXTRA_DIST += libvirtdconftest.c
endif

564 565
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
566
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
567
virnetmessagetest_LDADD = $(LDADDS)
568

569 570
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
571
virnetsockettest_LDADD = $(LDADDS)
572

573
if WITH_GNUTLS
574
virnettlscontexttest_SOURCES = \
E
Eric Blake 已提交
575
	virnettlscontexttest.c testutils.h testutils.c
576
virnettlscontexttest_LDADD = $(LDADDS)
E
Eric Blake 已提交
577 578 579 580 581 582
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
else
EXTRA_DIST += pkix_asn1_tab.c
endif
583 584 585 586
else
EXTRA_DIST += \
	virnettlscontexttest.c testutils.h testutils.c pkix_asn1_tab.c
endif
587

588 589
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
590
virtimetest_LDADD = $(LDADDS)
591

592 593 594 595
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

596 597 598 599
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

600 601 602 603
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

604 605 606 607
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

608 609 610 611
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
612 613 614 615 616 617 618 619 620 621
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

622 623 624 625 626 627 628 629 630 631
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 已提交
632

633 634
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
635
viruritest_LDADD = $(LDADDS)
636

637 638
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
639
virkeyfiletest_LDADD = $(LDADDS)
640

641 642
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
643
virauthconfigtest_LDADD = $(LDADDS)
644

645 646
seclabeltest_SOURCES = \
	seclabeltest.c
647
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
648

649 650 651 652 653 654 655 656 657 658 659 660 661 662 663
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)
664 665 666 667 668 669 670 671 672 673 674
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
675
endif
676
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c securityselinuxhelper.c
677

678 679 680 681
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

682 683 684
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
685

686
viratomictest_SOURCES = \
L
Laine Stump 已提交
687
	viratomictest.c testutils.h testutils.c
688 689
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
690 691 692 693
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
694 695 696 697
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

698
jsontest_SOURCES = \
699
	jsontest.c testutils.h testutils.c
700 701
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
702 703 704 705
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

706 707 708 709 710 711
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
endif

712 713
if WITH_LIBVIRTD
eventtest_SOURCES = \
714
	eventtest.c testutils.h testutils.c
715 716 717
eventtest_LDADD = -lrt $(LDADDS)
endif

718 719 720 721 722 723
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
724
shunloadtest_LDADD = $(LIB_PTHREAD)
725 726
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
727 728 729 730
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

731 732 733 734
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

O
Osier Yang 已提交
735 736 737 738
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759
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

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