Makefile.am 24.5 KB
Newer Older
K
Karel Zak 已提交
1 2
## Process this file with automake to produce Makefile.in

3
## Copyright (C) 2005-2014 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
	-Dabs_srcdir="\"`cd '$(srcdir)'; pwd`\"" \
33 34
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
35
	$(SASL_CFLAGS) \
36
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
37
	$(APPARMOR_CFLAGS) \
38
	$(YAJL_CFLAGS) \
E
Eric Blake 已提交
39 40
	$(COVERAGE_CFLAGS) \
	$(WARN_CFLAGS)
41

42 43 44
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
45
endif WITH_DRIVER_MODULES
46

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

52 53 54
GNULIB_LIBS = \
       ../gnulib/lib/libgnu.la

K
Karel Zak 已提交
55
LDADDS = \
56
        $(WARN_CFLAGS) \
57
	$(NO_INDIRECT_LDFLAGS) \
58
	$(PROBES_O) \
59 60
	$(GNULIB_LIBS) \
	../src/libvirt.la
K
Karel Zak 已提交
61

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

G
Gene Czarcinski 已提交
126
test_helpers = commandhelper ssh test_conf
127
test_programs = virshtest sockettest \
E
Eric Blake 已提交
128
	nodeinfotest virbuftest \
129
	commandtest seclabeltest \
E
Eric Blake 已提交
130 131
	virhashtest \
	viratomictest \
132
	utiltest shunloadtest \
133
	virtimetest viruritest virkeyfiletest \
H
Hu Tao 已提交
134
	virauthconfigtest \
135 136
	virbitmaptest \
	vircgrouptest \
M
Michal Privoznik 已提交
137
	virpcitest \
138
	virendiantest \
139
	virfiletest \
140
	viridentitytest \
141
	virkeycodetest \
142
	virlockspacetest \
143
	virlogtest \
144
	virstringtest \
D
Daniel P. Berrange 已提交
145
        virportallocatortest \
V
Viktor Mihajlovski 已提交
146
	sysinfotest \
147
	virstoragetest \
148
	virnetdevbandwidthtest \
149
	virkmodtest \
150
	vircapstest \
151
	domainconftest \
152
	$(NULL)
153

E
Eric Blake 已提交
154 155 156 157 158 159 160 161 162 163 164
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
	virnetserverclienttest \
	$(NULL)
if WITH_GNUTLS
test_programs += virnettlscontexttest virnettlssessiontest
endif WITH_GNUTLS
endif WITH_REMOTE

165 166 167 168
if WITH_LINUX
test_programs += fchosttest
endif WITH_LINUX

169 170 171 172
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

173
if WITH_DBUS
174 175
test_programs += virdbustest \
                 virsystemdtest
176
endif WITH_DBUS
177

178
if WITH_SECDRIVER_SELINUX
179
if WITH_ATTR
180
test_programs += securityselinuxtest
181
if WITH_QEMU
182
test_programs += securityselinuxlabeltest
183 184 185
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
186

187 188
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
189
endif WITH_DRIVER_MODULES
190

191 192 193
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
194

195
if WITH_XEN
196
test_programs += xml2sexprtest sexpr2xmltest \
197
	xmconfigtest xencapstest statstest reconnect
198
endif WITH_XEN
199
if WITH_QEMU
200
test_programs += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
201
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
202
	qemumonitortest qemumonitorjsontest qemuhotplugtest \
203
	qemuagenttest qemucapabilitiestest
204
endif WITH_QEMU
205

206
if WITH_LXC
207
test_programs += lxcxml2xmltest lxcconf2xmltest
208
endif WITH_LXC
209

210
if WITH_OPENVZ
211
test_programs += openvzutilstest
212
endif WITH_OPENVZ
213

214
if WITH_ESX
215
test_programs += esxutilstest
216
endif WITH_ESX
217 218

if WITH_VMX
219
test_programs += vmx2xmltest xml2vmxtest
220
endif WITH_VMX
221

222 223 224 225
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

226
if WITH_CIL
227
test_programs += object-locking
228
endif WITH_CIL
229

230
if WITH_YAJL
231
test_programs += jsontest
232
endif WITH_YAJL
233

J
Ján Tomko 已提交
234
test_programs += networkxml2xmltest networkxml2xmlupdatetest
235

236
if WITH_NETWORK
237
test_programs += networkxml2conftest
238
endif WITH_NETWORK
239

240 241
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
242
endif WITH_STORAGE_SHEEPDOG
243

244
test_programs += nwfilterxml2xmltest
245

246
if WITH_STORAGE
247
test_programs += storagevolxml2argvtest
248
endif WITH_STORAGE
249

O
Osier Yang 已提交
250 251 252 253
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

254
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
255

256
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
257

258
test_programs += interfacexml2xmltest
259

260
test_programs += cputest
261

P
Peter Krempa 已提交
262 263
test_programs += metadatatest

J
Ján Tomko 已提交
264 265
test_programs += secretxml2xmltest

266 267
test_scripts = \
	capabilityschematest \
268
	interfaceschematest \
269 270 271 272
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
273
	nodedevschematest \
274
	nwfilterschematest \
J
Ján Tomko 已提交
275 276
	domainsnapshotschematest \
	secretschematest
277

A
Atsushi SAKAI 已提交
278
if WITH_LIBVIRTD
279 280 281 282 283
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
284 285
	libvirtd-fail			\
	libvirtd-pool			\
286 287 288
	read-bufsiz			\
	read-non-seekable		\
	start				\
289
	virsh-uriprecedence		\
290 291
	vcpupin				\
	virsh-all			\
292
	virsh-optparse			\
293
	virsh-schedinfo			\
294 295 296
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
297

298 299 300
test_programs += 			\
	eventtest			\
	libvirtdconftest
301
else ! WITH_LIBVIRTD
302 303 304 305 306 307 308 309 310 311 312 313 314 315
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			\
316 317 318
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
319
endif ! WITH_LIBVIRTD
320

321 322
test_programs += objecteventtest

J
Jamie Strandboge 已提交
323 324
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
325
else ! WITH_SECDRIVER_APPARMOR
326
EXTRA_DIST += virt-aa-helper-test
327
endif ! WITH_SECDRIVER_APPARMOR
328

329 330
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
331 332
test_libraries = libshunload.la \
		libvirportallocatormock.la \
333
		virnetserverclientmock.la \
334
		vircgroupmock.la \
M
Michal Privoznik 已提交
335
		virpcimock.la \
D
Daniel P. Berrange 已提交
336
		$(NULL)
337
if WITH_QEMU
338 339 340
test_libraries += libqemumonitortestutils.la \
		qemuxml2argvmock.la \
		$(NULL)
341
endif WITH_QEMU
342

343 344
if WITH_DBUS
test_libraries += virsystemdmock.la
345
endif WITH_DBUS
346

347 348
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
349
noinst_LTLIBRARIES = $(test_libraries)
350
else ! WITH_TESTS
351
check_PROGRAMS = $(test_programs) $(test_helpers)
352
check_LTLIBRARIES = $(test_libraries)
353
endif ! WITH_TESTS
354

355 356
TESTS = $(test_programs) \
	$(test_scripts)
357

358
# NB, automake < 1.10 does not provide the real
359
# abs_top_{src/build}dir or builddir variables, so don't rely
360
# on them here. Fake them with 'pwd'
361 362 363 364
# 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`
365 366
path_add = $(subst :,$(PATH_SEPARATOR),\
	$(subst !,$(lv_abs_top_builddir)/,!daemon:!tools:!tests))
367

368
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
369
TESTS_ENVIRONMENT =				\
370
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
371
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
372
  abs_builddir=`pwd`				\
373
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
374
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
375
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
376
  SHELL="$(SHELL)"				\
377
  LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \
378
  LIBVIRT_AUTOSTART=0				\
379
  LC_ALL=C					\
380
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE)	\
381 382
  $(VG)

383

384 385
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(srcdir)/.valgrind.supp
386
valgrind:
387
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
388

389 390 391
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
392
sockettest_LDADD = $(LDADDS)
393

394
if WITH_XEN
E
Eric Blake 已提交
395
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
396 397
xen_LDADDS += $(LDADDS)

398
xml2sexprtest_SOURCES = \
399
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
400
	testutils.c testutils.h
401
xml2sexprtest_LDADD = $(xen_LDADDS)
402 403

sexpr2xmltest_SOURCES = \
404
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
405
	testutils.c testutils.h
406
sexpr2xmltest_LDADD = $(xen_LDADDS)
407

408
xmconfigtest_SOURCES = \
409
	xmconfigtest.c testutilsxen.c testutilsxen.h \
410
	testutils.c testutils.h
411
xmconfigtest_LDADD = $(xen_LDADDS)
412

413 414
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
415
xencapstest_LDADD = $(xen_LDADDS)
416 417

reconnect_SOURCES = \
418
	reconnect.c testutils.h testutils.c
419 420
reconnect_LDADD = $(LDADDS)

421 422
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
423
statstest_LDADD = $(xen_LDADDS)
424

425
else ! WITH_XEN
426 427 428
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
429
endif ! WITH_XEN
430

431 432 433 434 435
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

436
if WITH_QEMU
437

438 439
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

440
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
441
if WITH_NETWORK
E
Eric Blake 已提交
442
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
443
endif WITH_NETWORK
444 445 446
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
447
if WITH_DTRACE_PROBES
448
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
449
endif WITH_DTRACE_PROBES
450
qemu_LDADDS += $(LDADDS)
451

452
qemuxml2argvtest_SOURCES = \
453
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
454
	testutils.c testutils.h
455
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LIBXML_LIBS)
456

457 458 459 460 461 462
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
qemuxml2argvmock_la_CFLAGS = $(AM_CFLAGS)
qemuxml2argvmock_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation

463
qemuxml2xmltest_SOURCES = \
464
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
465
	testutils.c testutils.h
466
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
467

P
Philipp Hahn 已提交
468 469 470
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
471
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
472

473 474 475
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
476
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
477 478

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
479
qemuhelptest_LDADD = $(qemu_LDADDS)
480

481
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
482
qemumonitortest_LDADD = $(qemu_LDADDS)
483

484 485 486 487 488
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
489
qemumonitorjsontest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
490

491 492 493 494 495 496 497
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucapabilitiestest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)

P
Peter Krempa 已提交
498 499 500 501 502
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
503
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
P
Peter Krempa 已提交
504

505 506 507 508 509
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
510
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
511

512 513 514
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
515
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
516
else ! WITH_QEMU
517 518
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
519
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
520
	qemumonitorjsontest.c qemuhotplugtest.c \
521
	qemuagenttest.c qemucapabilitiestest.c \
522
	$(QEMUMONITORTESTUTILS_SOURCES)
523
endif ! WITH_QEMU
524

525 526
if WITH_LXC

E
Eric Blake 已提交
527
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
528
if WITH_NETWORK
E
Eric Blake 已提交
529
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
530
endif WITH_NETWORK
531
lxc_LDADDS += $(LDADDS)
532 533 534 535

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
536
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
537 538 539 540 541

lxcconf2xmltest_SOURCES = \
	lxcconf2xmltest.c \
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
542
else ! WITH_LXC
543
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
544
endif ! WITH_LXC
545

546 547 548 549
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
550
openvzutilstest_LDADD = $(LDADDS)
551
else ! WITH_OPENVZ
552
EXTRA_DIST += openvzutilstest.c
553
endif ! WITH_OPENVZ
554 555
EXTRA_DIST += openvzutilstest.conf

556 557 558 559
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
560
esxutilstest_LDADD = $(LDADDS)
561
else ! WITH_ESX
562
EXTRA_DIST += esxutilstest.c
563
endif ! WITH_ESX
564

565
if WITH_VMX
566 567 568
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
569
vmx2xmltest_LDADD = $(LDADDS)
570 571 572 573

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
574
xml2vmxtest_LDADD = $(LDADDS)
575
else ! WITH_VMX
576
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
577
endif ! WITH_VMX
578

579 580 581 582 583 584 585 586 587
if WITH_VMWARE
vmwarevertest_SOURCES = \
    vmwarevertest.c \
    testutils.c testutils.h
vmwarevertest_LDADD = $(LDADDS)
else ! WITH_VMWARE
EXTRA_DIST += vmwarevertest.c
endif ! WITH_VMWARE

588 589 590 591 592
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
593 594 595 596 597
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

598
if WITH_NETWORK
599 600
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
601
	testutils.c testutils.h
602
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
603
else ! WITH_NETWORK
604
EXTRA_DIST += networkxml2conftest.c
605
endif !	WITH_NETWORK
606

607 608 609 610
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
611 612
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
613
else ! WITH_STORAGE_SHEEPDOG
614
EXTRA_DIST += storagebackendsheepdogtest.c
615
endif ! WITH_STORAGE_SHEEPDOG
616

617 618 619 620
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
621

J
Ján Tomko 已提交
622 623 624 625 626 627
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)


628
if WITH_STORAGE
629 630 631 632 633
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
634
else ! WITH_STORAGE
635
EXTRA_DIST += storagevolxml2argvtest.c
636
endif ! WITH_STORAGE
637

638 639 640 641 642
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

643 644 645 646 647
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
648 649 650
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
651
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
652

653 654 655 656 657
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

658 659 660
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
661
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
662

P
Peter Krempa 已提交
663 664 665 666 667
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

668 669 670 671 672
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
673 674 675
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
676

677 678 679 680
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

681 682 683 684 685 686 687
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
688
commandhelper_LDFLAGS = -static
689

690 691
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
692
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)
693

694 695 696 697
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

698 699 700 701
vircapstest_SOURCES = \
	vircapstest.c testutils.h testutils.c
vircapstest_LDADD = $(LDADDS)

702 703 704
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
705 706
	$(NULL)
libvirtdconftest_LDADD = ../daemon/libvirtd_conf.la $(LDADDS)
707
else ! WITH_LIBVIRTD
708
EXTRA_DIST += libvirtdconftest.c
709
endif ! WITH_LIBVIRTD
710

711 712
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
713
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
714
virnetmessagetest_LDADD = $(LDADDS)
715

716 717
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
718
virnetsockettest_LDADD = $(LDADDS)
719

720 721 722
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
723
virnetserverclienttest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
724 725 726 727 728 729 730 731
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
virnetserverclientmock_la_CFLAGS = $(AM_CFLAGS)
virnetserverclientmock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

732
if WITH_GNUTLS
733
virnettlscontexttest_SOURCES = \
734 735 736
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
737
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
738 739 740 741
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
742
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
743 744 745
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
746 747
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
748
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
749
EXTRA_DIST += pkix_asn1_tab.c
750 751
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
752
EXTRA_DIST += \
753 754 755
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
756
endif ! WITH_GNUTLS
757

758 759
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
760
virtimetest_LDADD = $(LDADDS)
761

762 763 764 765
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

766 767 768 769
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

770 771 772 773
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

774 775 776 777
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

778 779 780 781
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

782 783 784 785
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
786 787 788 789 790 791 792 793 794 795
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

796 797 798 799 800 801 802 803 804 805
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

M
Michal Privoznik 已提交
806 807 808 809 810 811 812
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
813 814
virpcimock_la_LIBADD = $(GNULIB_LIBS) \
					   ../src/libvirt.la
M
Michal Privoznik 已提交
815 816 817
virpcimock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

818 819 820 821
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
822
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
823 824 825 826 827 828 829 830 831 832 833 834

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

835
else ! WITH_DBUS
836
EXTRA_DIST += virdbustest.c virsystemdtest.c virsystemdmock.c
837
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
838

839 840
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
841
viruritest_LDADD = $(LDADDS)
842

843 844
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
845
virkeyfiletest_LDADD = $(LDADDS)
846

847 848
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
849
virauthconfigtest_LDADD = $(LDADDS)
850

851 852
seclabeltest_SOURCES = \
	seclabeltest.c
853
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
854

855
if WITH_SECDRIVER_SELINUX
856
if WITH_ATTR
857 858
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
859
else ! WITH_TESTS
860
check_LTLIBRARIES += libsecurityselinuxhelper.la
861
endif ! WITH_TESTS
862 863 864 865 866 867 868 869

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
870
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
871 872
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
873 874 875 876 877

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
878
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
879 880
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
881 882 883
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
884 885
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
886

887 888 889 890
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

891 892 893
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
894

895
viratomictest_SOURCES = \
L
Laine Stump 已提交
896
	viratomictest.c testutils.h testutils.c
897 898
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
899 900 901 902
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
903 904 905 906
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

907 908 909 910
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

911
jsontest_SOURCES = \
912
	jsontest.c testutils.h testutils.c
913 914
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
915 916 917 918
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

919 920 921 922
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
923
endif WITH_DRIVER_MODULES
924

925 926
if WITH_LIBVIRTD
eventtest_SOURCES = \
927
	eventtest.c testutils.h testutils.c
928
eventtest_LDADD = -lrt $(LDADDS)
929
endif WITH_LIBVIRTD
930

931 932
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
933 934
libshunload_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation
935 936 937

shunloadtest_SOURCES = \
	shunloadtest.c
938
shunloadtest_LDADD = $(LIB_PTHREAD)
939 940
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
941 942 943 944
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

945 946 947 948
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

949 950 951 952
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

953 954 955 956 957
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

958
if WITH_LINUX
O
Osier Yang 已提交
959 960 961 962
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

963 964 965 966
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
endif  ! WITH_LINUX

O
Osier Yang 已提交
967 968 969 970 971 972 973 974 975
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

else ! WITH_LINUX
EXTRA_DIST += virscsitest.c
endif  ! WITH_LINUX

976 977 978 979 980 981 982 983 984 985 986 987
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
988 989
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
990 991 992 993

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

994
else ! WITH_CIL
995
EXTRA_DIST += object-locking.ml
996
endif ! WITH_CIL
997

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