Makefile.am 20.9 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
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
44
endif WITH_DRIVER_MODULES
45

46
PROBES_O =
47
if WITH_DTRACE_PROBES
48
PROBES_O += ../src/libvirt_probes.lo
49
endif WITH_DTRACE_PROBES
50

K
Karel Zak 已提交
51
LDADDS = \
52
        $(WARN_CFLAGS) \
53
	$(NO_INDIRECT_LDFLAGS) \
54
	$(PROBES_O) \
55 56
	../src/libvirt.la \
	../gnulib/lib/libgnu.la
K
Karel Zak 已提交
57

58
EXTRA_DIST =		\
59
	capabilityschemadata \
E
Eric Blake 已提交
60 61 62 63
	capabilityschematest \
	commanddata \
	confdata \
	cputestdata \
64
	domainschemadata \
E
Eric Blake 已提交
65 66 67 68
	domainschematest \
	domainsnapshotschematest \
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
O
Osier Yang 已提交
69
	fchostdata \
70
	interfaceschemadata \
71
	lxcxml2xmldata \
E
Eric Blake 已提交
72 73 74
	networkschematest \
	networkxml2xmlin \
	networkxml2xmlout \
75
	networkxml2confdata \
J
Ján Tomko 已提交
76 77
	networkxml2xmlupdatein \
	networkxml2xmlupdateout \
E
Eric Blake 已提交
78 79 80 81 82 83 84 85
	nodedevschemadata \
	nodedevschematest \
	nodeinfodata     \
	nwfilterschematest \
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
	qemuhelpdata \
86
	qemuhotplugtestdata \
E
Eric Blake 已提交
87 88
	qemuxml2argvdata \
	qemuxml2xmloutdata \
P
Philipp Hahn 已提交
89
	qemuxmlnsdata \
90
	securityselinuxlabeldata \
E
Eric Blake 已提交
91 92
	schematestutils.sh \
	sexpr2xmldata \
93
	storagepoolschemadata \
94
	storagepoolschematest \
95
	storagepoolxml2xmlin \
E
Eric Blake 已提交
96
	storagepoolxml2xmlout \
97
	storagevolxml2argvdata \
98
	storagevolschemadata \
99
	storagevolschematest \
100
	storagevolxml2xmlin \
E
Eric Blake 已提交
101
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
102
	sysinfodata \
E
Eric Blake 已提交
103
	test-lib.sh	\
104
	virsh-uriprecedence \
105
	vmx2xmldata \
E
Eric Blake 已提交
106 107 108
	xencapsdata \
	xmconfigdata \
	xml2sexprdata \
109
	xml2vmxdata \
O
Osier Yang 已提交
110
	.valgrind.supp
K
Karel Zak 已提交
111

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

134 135 136 137
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

138
if WITH_DBUS
139 140
test_programs += virdbustest \
                 virsystemdtest
141
endif WITH_DBUS
142

143
if WITH_GNUTLS
144
test_programs += virnettlscontexttest virnettlssessiontest
145
endif WITH_GNUTLS
146

147
if WITH_SECDRIVER_SELINUX
148
if WITH_ATTR
149
test_programs += securityselinuxtest
150
if WITH_QEMU
151
test_programs += securityselinuxlabeltest
152 153 154
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
155

156 157
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
158
endif WITH_DRIVER_MODULES
159

160 161 162
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
163

164
if WITH_XEN
165
test_programs += xml2sexprtest sexpr2xmltest \
166
	xmconfigtest xencapstest statstest reconnect
167
endif WITH_XEN
168
if WITH_QEMU
169
test_programs += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
170
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
171 172
	qemumonitortest qemumonitorjsontest qemuhotplugtest \
	qemuagenttest
173
endif WITH_QEMU
174

175
if WITH_LXC
176
test_programs += lxcxml2xmltest
177
endif WITH_LXC
178

179
if WITH_OPENVZ
180
test_programs += openvzutilstest
181
endif WITH_OPENVZ
182

183
if WITH_ESX
184
test_programs += esxutilstest
185
endif WITH_ESX
186 187

if WITH_VMX
188
test_programs += vmx2xmltest xml2vmxtest
189
endif WITH_VMX
190

191
if WITH_CIL
192
test_programs += object-locking
193
endif WITH_CIL
194

195
if WITH_YAJL
196
test_programs += jsontest
197
endif WITH_YAJL
198

J
Ján Tomko 已提交
199
test_programs += networkxml2xmltest networkxml2xmlupdatetest
200

201
if WITH_NETWORK
202
test_programs += networkxml2conftest
203
endif WITH_NETWORK
204

205 206
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
207
endif WITH_STORAGE_SHEEPDOG
208

209
test_programs += nwfilterxml2xmltest
210

211
if WITH_STORAGE
212
test_programs += storagevolxml2argvtest
213
endif WITH_STORAGE
214

215
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
216

217
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
218

219
test_programs += interfacexml2xmltest
220

221
test_programs += cputest
222

223 224
test_scripts = \
	capabilityschematest \
225
	interfaceschematest \
226 227 228 229
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
230
	nodedevschematest \
231 232
	nwfilterschematest \
	domainsnapshotschematest
233

A
Atsushi SAKAI 已提交
234
if WITH_LIBVIRTD
235 236 237 238 239
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
240 241
	libvirtd-fail			\
	libvirtd-pool			\
242 243 244
	read-bufsiz			\
	read-non-seekable		\
	start				\
245
	virsh-uriprecedence		\
246 247
	vcpupin				\
	virsh-all			\
248
	virsh-optparse			\
249
	virsh-schedinfo			\
250 251 252
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
253

254 255 256
test_programs += 			\
	eventtest			\
	libvirtdconftest
257
else ! WITH_LIBVIRTD
258 259 260 261 262 263 264 265 266 267 268 269 270 271
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			\
272 273 274
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
275
endif ! WITH_LIBVIRTD
276

J
Jamie Strandboge 已提交
277 278
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
279
else ! WITH_SECDRIVER_APPARMOR
280
EXTRA_DIST += virt-aa-helper-test
281
endif ! WITH_SECDRIVER_APPARMOR
282

283 284
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
285 286
test_libraries = libshunload.la \
		libvirportallocatormock.la \
287
		vircgroupmock.la \
D
Daniel P. Berrange 已提交
288
		$(NULL)
289 290
if WITH_QEMU
test_libraries += libqemumonitortestutils.la
291
endif WITH_QEMU
292

293 294
if WITH_DBUS
test_libraries += virsystemdmock.la
295
endif WITH_DBUS
296

297 298
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
299
noinst_LTLIBRARIES = $(test_libraries)
300
else ! WITH_TESTS
301
check_PROGRAMS = $(test_programs) $(test_helpers)
302
check_LTLIBRARIES = $(test_libraries)
303
endif ! WITH_TESTS
304

305 306
TESTS = $(test_programs) \
	$(test_scripts)
307

308
# NB, automake < 1.10 does not provide the real
309
# abs_top_{src/build}dir or builddir variables, so don't rely
310
# on them here. Fake them with 'pwd'
311 312 313 314
# 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`
315 316
path_add = $(subst :,$(PATH_SEPARATOR),\
	$(subst !,$(lv_abs_top_builddir)/,!daemon:!tools:!tests))
317

318
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
319
TESTS_ENVIRONMENT =				\
320
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
321
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
322
  abs_builddir=`pwd`				\
323
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
324
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
325
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
326
  SHELL="$(SHELL)"				\
327
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
328
  LIBVIRT_AUTOSTART=0				\
329
  LC_ALL=C					\
330
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE)	\
331 332
  $(VG)

333

334 335
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(srcdir)/.valgrind.supp
336
valgrind:
337
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
338

339 340 341
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
342
sockettest_LDADD = $(LDADDS)
343

344
if WITH_XEN
E
Eric Blake 已提交
345
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
346 347
xen_LDADDS += $(LDADDS)

348
xml2sexprtest_SOURCES = \
349
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
350
	testutils.c testutils.h
351
xml2sexprtest_LDADD = $(xen_LDADDS)
352 353

sexpr2xmltest_SOURCES = \
354
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
355
	testutils.c testutils.h
356
sexpr2xmltest_LDADD = $(xen_LDADDS)
357

358
xmconfigtest_SOURCES = \
359
	xmconfigtest.c testutilsxen.c testutilsxen.h \
360
	testutils.c testutils.h
361
xmconfigtest_LDADD = $(xen_LDADDS)
362

363 364
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
365
xencapstest_LDADD = $(xen_LDADDS)
366 367

reconnect_SOURCES = \
368
	reconnect.c testutils.h testutils.c
369 370
reconnect_LDADD = $(LDADDS)

371 372
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
373
statstest_LDADD = $(xen_LDADDS)
374

375
else ! WITH_XEN
376 377 378
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
379
endif ! WITH_XEN
380

381 382 383 384 385
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

386
if WITH_QEMU
387

388 389
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

390
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
391
if WITH_NETWORK
E
Eric Blake 已提交
392
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
393
endif WITH_NETWORK
394
if WITH_DTRACE_PROBES
395
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
396
endif WITH_DTRACE_PROBES
397
qemu_LDADDS += $(LDADDS)
398

399
qemuxml2argvtest_SOURCES = \
400
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
401
	testutils.c testutils.h
402
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LIBXML_LIBS)
403 404

qemuxml2xmltest_SOURCES = \
405
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
406
	testutils.c testutils.h
407
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
408

P
Philipp Hahn 已提交
409 410 411
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
412
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
413

414 415 416
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
417
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
418 419

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
420
qemuhelptest_LDADD = $(qemu_LDADDS)
421

422
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
423
qemumonitortest_LDADD = $(qemu_LDADDS)
424

425 426 427 428 429
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
430
qemumonitorjsontest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
431

P
Peter Krempa 已提交
432 433 434 435 436
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
437
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
P
Peter Krempa 已提交
438

439 440 441 442 443
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
444
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
445

446 447 448
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
449
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
450
else ! WITH_QEMU
451 452
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
453
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
454
	qemumonitorjsontest.c qemuhotplugtest.c \
P
Peter Krempa 已提交
455
	qemuagenttest.c \
456
	$(QEMUMONITORTESTUTILS_SOURCES)
457
endif ! WITH_QEMU
458

459 460
if WITH_LXC

E
Eric Blake 已提交
461
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
462
if WITH_NETWORK
E
Eric Blake 已提交
463
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
464
endif WITH_NETWORK
465
lxc_LDADDS += $(LDADDS)
466 467 468 469

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
470
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
471
else ! WITH_LXC
472
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
473
endif ! WITH_LXC
474

475 476 477 478
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
479
openvzutilstest_LDADD = $(LDADDS)
480
else ! WITH_OPENVZ
481
EXTRA_DIST += openvzutilstest.c
482
endif ! WITH_OPENVZ
483 484
EXTRA_DIST += openvzutilstest.conf

485 486 487 488
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
489
esxutilstest_LDADD = $(LDADDS)
490
else ! WITH_ESX
491
EXTRA_DIST += esxutilstest.c
492
endif ! WITH_ESX
493

494
if WITH_VMX
495 496 497
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
498
vmx2xmltest_LDADD = $(LDADDS)
499 500 501 502

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
503
xml2vmxtest_LDADD = $(LDADDS)
504
else ! WITH_VMX
505
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
506
endif ! WITH_VMX
507

508 509 510 511 512
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
513 514 515 516 517
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

518
if WITH_NETWORK
519 520
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
521
	testutils.c testutils.h
522
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
523
else ! WITH_NETWORK
524
EXTRA_DIST += networkxml2conftest.c
525
endif !	WITH_NETWORK
526

527 528 529 530
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
531 532
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
533
else ! WITH_STORAGE_SHEEPDOG
534
EXTRA_DIST += storagebackendsheepdogtest.c
535
endif ! WITH_STORAGE_SHEEPDOG
536

537 538 539 540
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
541

542
if WITH_STORAGE
543 544 545 546 547
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
548
else ! WITH_STORAGE
549
EXTRA_DIST += storagevolxml2argvtest.c
550
endif ! WITH_STORAGE
551

552 553 554 555 556
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

557 558 559 560 561
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
562 563 564
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
565
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
566

567 568 569 570 571
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

572 573 574
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
575
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
576

577 578 579 580 581
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
582 583 584
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
585

586 587 588 589
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

590 591 592 593 594 595 596
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
597
commandhelper_LDFLAGS = -static
598

599 600 601
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
602 603
	$(NULL)
libvirtdconftest_LDADD = ../daemon/libvirtd_conf.la $(LDADDS)
604
else ! WITH_LIBVIRTD
605
EXTRA_DIST += libvirtdconftest.c
606
endif ! WITH_LIBVIRTD
607

608 609
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
610
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
611
virnetmessagetest_LDADD = $(LDADDS)
612

613 614
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
615
virnetsockettest_LDADD = $(LDADDS)
616

617
if WITH_GNUTLS
618
virnettlscontexttest_SOURCES = \
619 620 621
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
622
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
623 624 625 626
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
627
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
628 629 630
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
631 632
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
633
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
634
EXTRA_DIST += pkix_asn1_tab.c
635 636
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
637
EXTRA_DIST += \
638 639 640
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
641
endif ! WITH_GNUTLS
642

643 644
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
645
virtimetest_LDADD = $(LDADDS)
646

647 648 649 650
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

651 652 653 654
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

655 656 657 658
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

659 660 661 662
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

663 664 665 666
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
667 668 669 670 671 672 673 674 675 676
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

677 678 679 680 681 682 683 684 685 686
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

687 688 689 690
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
691
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
692 693 694 695 696 697 698 699 700 701 702 703

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

704
else ! WITH_DBUS
705
EXTRA_DIST += virdbustest.c virsystemdtest.c virsystemdmock.c
706
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
707

708 709
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
710
viruritest_LDADD = $(LDADDS)
711

712 713
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
714
virkeyfiletest_LDADD = $(LDADDS)
715

716 717
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
718
virauthconfigtest_LDADD = $(LDADDS)
719

720 721
seclabeltest_SOURCES = \
	seclabeltest.c
722
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
723

724
if WITH_SECDRIVER_SELINUX
725
if WITH_ATTR
726 727
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
728
else ! WITH_TESTS
729
check_LTLIBRARIES += libsecurityselinuxhelper.la
730
endif ! WITH_TESTS
731 732 733 734 735 736 737 738

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
739
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
740 741
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
742 743 744 745 746

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
747
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
748 749
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
750 751 752
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
753 754
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
755

756 757 758 759
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

760 761 762
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
763

764
viratomictest_SOURCES = \
L
Laine Stump 已提交
765
	viratomictest.c testutils.h testutils.c
766 767
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
768 769 770 771
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
772 773 774 775
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

776
jsontest_SOURCES = \
777
	jsontest.c testutils.h testutils.c
778 779
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
780 781 782 783
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

784 785 786 787
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
788
endif WITH_DRIVER_MODULES
789

790 791
if WITH_LIBVIRTD
eventtest_SOURCES = \
792
	eventtest.c testutils.h testutils.c
793
eventtest_LDADD = -lrt $(LDADDS)
794
endif WITH_LIBVIRTD
795

796 797
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
798 799
libshunload_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation
800 801 802

shunloadtest_SOURCES = \
	shunloadtest.c
803
shunloadtest_LDADD = $(LIB_PTHREAD)
804 805
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
806 807 808 809
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

810 811 812 813
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

O
Osier Yang 已提交
814 815 816 817
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

818 819 820 821 822 823 824 825 826 827 828 829
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
830 831
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
832 833 834 835

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

836
else ! WITH_CIL
837
EXTRA_DIST += object-locking.ml
838
endif ! WITH_CIL
839

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