Makefile.am 19.7 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_DBUS
132 133
test_programs += virdbustest \
                 virsystemdtest
134 135
endif

136
if WITH_GNUTLS
137
test_programs += virnettlscontexttest virnettlssessiontest
138 139
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 \
P
Peter Krempa 已提交
164 165
	qemumonitortest qemumonitorjsontest qemuhotplugtest \
	qemuagenttest
166 167
endif

168
if WITH_LXC
169
test_programs += lxcxml2xmltest
170 171
endif

172
if WITH_OPENVZ
173
test_programs += openvzutilstest
174 175
endif

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

if WITH_VMX
181
test_programs += vmx2xmltest xml2vmxtest
182 183
endif

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

188
if WITH_YAJL
189
test_programs += jsontest
190 191
endif

192
test_programs += networkxml2xmltest
193

194
if WITH_NETWORK
195
test_programs += networkxml2conftest
196
endif
197

198 199 200 201
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
endif

202
test_programs += nwfilterxml2xmltest
203

204
if WITH_STORAGE
205
test_programs += storagevolxml2argvtest
206
endif
207

208
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
209

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

212
test_programs += interfacexml2xmltest
213

214
test_programs += cputest
215

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

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

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

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

275 276
EXTRA_DIST += $(test_scripts)

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

285 286 287 288
if WITH_DBUS
test_libraries += virsystemdmock.la
endif

289 290
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
291
noinst_LTLIBRARIES = $(test_libraries)
292 293
else
check_PROGRAMS = $(test_programs) $(test_helpers)
294
check_LTLIBRARIES = $(test_libraries)
295
endif
296

297 298
TESTS = $(test_programs) \
	$(test_scripts)
299

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

310
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
311
TESTS_ENVIRONMENT =				\
312
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
313
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
314
  abs_builddir=`pwd`				\
315
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
316
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
317
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
318
  SHELL="$(SHELL)"				\
319
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
320
  LIBVIRT_AUTOSTART=0				\
321
  LC_ALL=C					\
322
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE)	\
323 324
  $(VG)

325

326 327
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(srcdir)/.valgrind.supp
328
valgrind:
329
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
330

331 332 333
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
334
sockettest_LDADD = $(LDADDS)
335

336
if WITH_XEN
E
Eric Blake 已提交
337
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
338 339
xen_LDADDS += $(LDADDS)

340
xml2sexprtest_SOURCES = \
341
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
342
	testutils.c testutils.h
343
xml2sexprtest_LDADD = $(xen_LDADDS)
344 345

sexpr2xmltest_SOURCES = \
346
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
347
	testutils.c testutils.h
348
sexpr2xmltest_LDADD = $(xen_LDADDS)
349

350
xmconfigtest_SOURCES = \
351
	xmconfigtest.c testutilsxen.c testutilsxen.h \
352
	testutils.c testutils.h
353
xmconfigtest_LDADD = $(xen_LDADDS)
354

355 356
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
357
xencapstest_LDADD = $(xen_LDADDS)
358 359

reconnect_SOURCES = \
360
	reconnect.c testutils.h testutils.c
361 362
reconnect_LDADD = $(LDADDS)

363 364
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
365
statstest_LDADD = $(xen_LDADDS)
366

367 368 369 370 371 372
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

373 374 375 376 377
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

378
if WITH_QEMU
379

380 381
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

382
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
383
if WITH_NETWORK
E
Eric Blake 已提交
384
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
385
endif
386
if WITH_DTRACE_PROBES
387
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
388
endif
389
qemu_LDADDS += $(LDADDS)
390

391
qemuxml2argvtest_SOURCES = \
392
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
393
	testutils.c testutils.h
394
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LIBXML_LIBS)
395 396

qemuxml2xmltest_SOURCES = \
397
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
398
	testutils.c testutils.h
399
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
400

P
Philipp Hahn 已提交
401 402 403
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
404
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
405

406 407 408
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
409
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
410 411

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
412
qemuhelptest_LDADD = $(qemu_LDADDS)
413

414
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
415
qemumonitortest_LDADD = $(qemu_LDADDS)
416

417 418 419 420 421
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
422
qemumonitorjsontest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
423

P
Peter Krempa 已提交
424 425 426 427 428
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
429
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
P
Peter Krempa 已提交
430

431 432 433 434 435
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
436
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
437

438 439 440
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
441
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
442
else
443 444
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
445
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
446
	qemumonitorjsontest.c qemuhotplugtest.c \
P
Peter Krempa 已提交
447
	qemuagenttest.c \
448
	$(QEMUMONITORTESTUTILS_SOURCES)
449
endif
450

451 452
if WITH_LXC

E
Eric Blake 已提交
453
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
454
if WITH_NETWORK
E
Eric Blake 已提交
455
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
456 457
endif
lxc_LDADDS += $(LDADDS)
458 459 460 461

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
462
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
463 464 465 466
else
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
endif

467 468 469 470
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
471
openvzutilstest_LDADD = $(LDADDS)
472 473 474 475 476
else
EXTRA_DIST += openvzutilstest.c
endif
EXTRA_DIST += openvzutilstest.conf

477 478 479 480
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
481
esxutilstest_LDADD = $(LDADDS)
482 483 484
else
EXTRA_DIST += esxutilstest.c
endif
485

486
if WITH_VMX
487 488 489
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
490
vmx2xmltest_LDADD = $(LDADDS)
491 492 493 494

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
495
xml2vmxtest_LDADD = $(LDADDS)
496
else
497
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
498 499
endif

500 501 502 503 504
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

505
if WITH_NETWORK
506 507
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
508
	testutils.c testutils.h
509
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
510
else
511
EXTRA_DIST += networkxml2conftest.c
512
endif
513

514 515 516 517
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
518 519
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
520 521 522 523
else
EXTRA_DIST += storagebackendsheepdogtest.c
endif

524 525 526 527
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
528

529
if WITH_STORAGE
530 531 532 533 534
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
535 536 537
else
EXTRA_DIST += storagevolxml2argvtest.c
endif
538

539 540 541 542 543
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

544 545 546 547 548
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
549 550 551
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
552
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
553

554 555 556 557 558
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

559 560 561
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
562
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
563

564 565 566 567 568
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
569 570 571
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
572

573 574 575 576
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

577 578 579 580 581 582 583
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
584
commandhelper_LDFLAGS = -static
585

586 587 588 589 590 591 592 593 594
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
	../daemon/libvirtd-config.c
libvirtdconftest_LDADD = $(LDADDS)
else
EXTRA_DIST += libvirtdconftest.c
endif

595 596
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
597
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
598
virnetmessagetest_LDADD = $(LDADDS)
599

600 601
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
602
virnetsockettest_LDADD = $(LDADDS)
603

604
if WITH_GNUTLS
605
virnettlscontexttest_SOURCES = \
606 607 608
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
609
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
610 611 612 613
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
614
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
615 616 617
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
618 619
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
E
Eric Blake 已提交
620 621 622
else
EXTRA_DIST += pkix_asn1_tab.c
endif
623 624
else
EXTRA_DIST += \
625 626 627
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
628
endif
629

630 631
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
632
virtimetest_LDADD = $(LDADDS)
633

634 635 636 637
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

638 639 640 641
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

642 643 644 645
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

646 647 648 649
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

650 651 652 653
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
654 655 656 657 658 659 660 661 662 663
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

664 665 666 667 668 669 670 671 672 673
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

674 675 676 677
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
678
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
679 680 681 682 683 684 685 686 687 688 689 690

virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
virsystemdtest_CFLAGS = $(AM_CFLAGS)
virsystemdtest_LDADD = $(LDADDS)

virsystemdmock_la_SOURCES = \
	virsystemdmock.c
virsystemdmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virsystemdmock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

691
else
692
EXTRA_DIST += virdbustest.c virsystemdtest.c virsystemdmock.c
693
endif
D
Daniel P. Berrange 已提交
694

695 696
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
697
viruritest_LDADD = $(LDADDS)
698

699 700
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
701
virkeyfiletest_LDADD = $(LDADDS)
702

703 704
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
705
virauthconfigtest_LDADD = $(LDADDS)
706

707 708
seclabeltest_SOURCES = \
	seclabeltest.c
709
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
710

711 712 713 714 715 716 717 718 719 720 721 722 723 724 725
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)
726 727
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
728 729 730 731 732 733 734

if WITH_QEMU
if WITH_ATTR
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
securityselinuxlabeltest_LDADD = $(qemu_LDADDS)
735 736
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
737 738
endif
endif
739
endif
740 741
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
742

743 744 745 746
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

747 748 749
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
750

751
viratomictest_SOURCES = \
L
Laine Stump 已提交
752
	viratomictest.c testutils.h testutils.c
753 754
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
755 756 757 758
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
759 760 761 762
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

763
jsontest_SOURCES = \
764
	jsontest.c testutils.h testutils.c
765 766
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
767 768 769 770
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

771 772 773 774 775 776
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
endif

777 778
if WITH_LIBVIRTD
eventtest_SOURCES = \
779
	eventtest.c testutils.h testutils.c
780 781 782
eventtest_LDADD = -lrt $(LDADDS)
endif

783 784
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
785 786
libshunload_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation
787 788 789

shunloadtest_SOURCES = \
	shunloadtest.c
790
shunloadtest_LDADD = $(LIB_PTHREAD)
791 792
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
793 794 795 796
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

797 798 799 800
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

O
Osier Yang 已提交
801 802 803 804
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

805 806 807 808 809 810 811 812 813 814 815 816
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
817 818
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
819 820 821 822 823 824 825 826

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

else
EXTRA_DIST += object-locking.ml
endif

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