Makefile.am 19.5 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
TESTS_ENVIRONMENT =				\
311
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
312
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
313
  abs_builddir=`pwd`				\
314
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
315
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
316
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
317
  SHELL="$(SHELL)"				\
318
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
319
  LIBVIRT_AUTOSTART=0				\
320
  LC_ALL=C					\
321 322
  $(VG)

323

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

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

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

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

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

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

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

reconnect_SOURCES = \
358
	reconnect.c testutils.h testutils.c
359 360
reconnect_LDADD = $(LDADDS)

361 362
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
363
statstest_LDADD = $(xen_LDADDS)
364

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

371 372 373 374 375
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

376
if WITH_QEMU
377

378 379
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

389
qemuxml2argvtest_SOURCES = \
390
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
391
	testutils.c testutils.h
392
qemuxml2argvtest_LDADD = $(qemu_LDADDS)
393 394

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

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

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

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
410
qemuhelptest_LDADD = $(qemu_LDADDS)
411

412
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
413
qemumonitortest_LDADD = $(qemu_LDADDS)
414

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

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

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

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

449 450
if WITH_LXC

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

557 558 559 560 561
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

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

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

571 572 573 574
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

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

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
582
commandhelper_LDFLAGS = -static
583

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

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

598 599
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
600
virnetsockettest_LDADD = $(LDADDS)
601

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

628 629
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
630
virtimetest_LDADD = $(LDADDS)
631

632 633 634 635
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

636 637 638 639
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

640 641 642 643
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

644 645 646 647
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

648 649 650 651
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

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

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

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

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

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

693 694
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
695
viruritest_LDADD = $(LDADDS)
696

697 698
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
699
virkeyfiletest_LDADD = $(LDADDS)
700

701 702
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
703
virauthconfigtest_LDADD = $(LDADDS)
704

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

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

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

741 742 743 744
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

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

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

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

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

761
jsontest_SOURCES = \
762
	jsontest.c testutils.h testutils.c
763 764
jsontest_LDADD = $(LDADDS)

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

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

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

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

shunloadtest_SOURCES = \
	shunloadtest.c
788
shunloadtest_LDADD = $(LIB_PTHREAD)
789 790
shunloadtest_DEPENDENCIES = libshunload.la

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

795 796 797 798
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

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

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

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

else
EXTRA_DIST += object-locking.ml
endif

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