Makefile.am 21.1 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

P
Peter Krempa 已提交
223 224
test_programs += metadatatest

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

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

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

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

285 286
EXTRA_DIST += $(test_scripts)

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

295 296
if WITH_DBUS
test_libraries += virsystemdmock.la
297
endif WITH_DBUS
298

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

307 308
TESTS = $(test_programs) \
	$(test_scripts)
309

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

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

335

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

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

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

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

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

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

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

reconnect_SOURCES = \
370
	reconnect.c testutils.h testutils.c
371 372
reconnect_LDADD = $(LDADDS)

373 374
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
375
statstest_LDADD = $(xen_LDADDS)
376

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

383 384 385 386 387
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

388
if WITH_QEMU
389

390 391
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

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

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

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

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

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
422
qemuhelptest_LDADD = $(qemu_LDADDS)
423

424
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
425
qemumonitortest_LDADD = $(qemu_LDADDS)
426

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

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

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

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

461 462
if WITH_LXC

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

P
Peter Krempa 已提交
579 580 581 582 583
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

584 585 586 587 588
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
589 590 591
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
592

593 594 595 596
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

597 598 599 600 601 602 603
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
604
commandhelper_LDFLAGS = -static
605

606 607 608
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
609 610
	$(NULL)
libvirtdconftest_LDADD = ../daemon/libvirtd_conf.la $(LDADDS)
611
else ! WITH_LIBVIRTD
612
EXTRA_DIST += libvirtdconftest.c
613
endif ! WITH_LIBVIRTD
614

615 616
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
617
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
618
virnetmessagetest_LDADD = $(LDADDS)
619

620 621
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
622
virnetsockettest_LDADD = $(LDADDS)
623

624
if WITH_GNUTLS
625
virnettlscontexttest_SOURCES = \
626 627 628
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
629
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
630 631 632 633
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
634
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
635 636 637
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
638 639
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
640
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
641
EXTRA_DIST += pkix_asn1_tab.c
642 643
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
644
EXTRA_DIST += \
645 646 647
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
648
endif ! WITH_GNUTLS
649

650 651
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
652
virtimetest_LDADD = $(LDADDS)
653

654 655 656 657
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

658 659 660 661
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

662 663 664 665
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

666 667 668 669
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

670 671 672 673
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
674 675 676 677 678 679 680 681 682 683
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

684 685 686 687 688 689 690 691 692 693
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

694 695 696 697
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
698
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
699 700 701 702 703 704 705 706 707 708 709 710

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

711
else ! WITH_DBUS
712
EXTRA_DIST += virdbustest.c virsystemdtest.c virsystemdmock.c
713
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
714

715 716
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
717
viruritest_LDADD = $(LDADDS)
718

719 720
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
721
virkeyfiletest_LDADD = $(LDADDS)
722

723 724
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
725
virauthconfigtest_LDADD = $(LDADDS)
726

727 728
seclabeltest_SOURCES = \
	seclabeltest.c
729
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
730

731
if WITH_SECDRIVER_SELINUX
732
if WITH_ATTR
733 734
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
735
else ! WITH_TESTS
736
check_LTLIBRARIES += libsecurityselinuxhelper.la
737
endif ! WITH_TESTS
738 739 740 741 742 743 744 745

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
746
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
747 748
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
749 750 751 752 753

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
754
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
755 756
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
757 758 759
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
760 761
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
762

763 764 765 766
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

767 768 769
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
770

771
viratomictest_SOURCES = \
L
Laine Stump 已提交
772
	viratomictest.c testutils.h testutils.c
773 774
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
775 776 777 778
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
779 780 781 782
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

783
jsontest_SOURCES = \
784
	jsontest.c testutils.h testutils.c
785 786
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
787 788 789 790
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

791 792 793 794
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
795
endif WITH_DRIVER_MODULES
796

797 798
if WITH_LIBVIRTD
eventtest_SOURCES = \
799
	eventtest.c testutils.h testutils.c
800
eventtest_LDADD = -lrt $(LDADDS)
801
endif WITH_LIBVIRTD
802

803 804
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
805 806
libshunload_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation
807 808 809

shunloadtest_SOURCES = \
	shunloadtest.c
810
shunloadtest_LDADD = $(LIB_PTHREAD)
811 812
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
813 814 815 816
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

817 818 819 820
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

O
Osier Yang 已提交
821 822 823 824
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

825 826 827 828 829 830 831 832 833 834 835 836
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
837 838
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
839 840 841 842

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

843
else ! WITH_CIL
844
EXTRA_DIST += object-locking.ml
845
endif ! WITH_CIL
846

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