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

3
## Copyright (C) 2005-2015 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 21 22
# old automake does not provide abs_{src,build}dir variables
abs_builddir = $(shell pwd)
abs_srcdir = $(shell cd $(srcdir) && pwd)

23 24
SHELL = $(PREFERABLY_POSIX_SHELL)

K
Karel Zak 已提交
25
INCLUDES = \
26
	-I$(top_builddir) -I$(top_srcdir) \
27 28 29
	-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 \
30
	-I$(top_srcdir)/src/util \
31 32
	-I$(top_srcdir)/src/conf \
	$(GETTEXT_CPPFLAGS)
E
Eric Blake 已提交
33 34

AM_CFLAGS = \
35 36
	-Dabs_builddir="\"$(abs_builddir)\"" \
	-Dabs_srcdir="\"$(abs_srcdir)\"" \
37
	$(LIBXML_CFLAGS) \
38
	$(LIBNL_CFLAGS) \
39
	$(GNUTLS_CFLAGS) \
40
	$(SASL_CFLAGS) \
41
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
42
	$(APPARMOR_CFLAGS) \
43
	$(YAJL_CFLAGS) \
E
Eric Blake 已提交
44 45
	$(COVERAGE_CFLAGS) \
	$(WARN_CFLAGS)
46

47 48 49
AM_LDFLAGS = \
	-export-dynamic

50 51 52 53
MOCKLIBS_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
	$(MINGW_EXTRA_LDFLAGS)

54 55 56
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
57
endif WITH_DRIVER_MODULES
58

59
PROBES_O =
60
if WITH_DTRACE_PROBES
61
PROBES_O += ../src/libvirt_probes.lo
62
endif WITH_DTRACE_PROBES
63

64 65 66
GNULIB_LIBS = \
       ../gnulib/lib/libgnu.la

K
Karel Zak 已提交
67
LDADDS = \
68
        $(WARN_CFLAGS) \
69
	$(NO_INDIRECT_LDFLAGS) \
70
	$(PROBES_O) \
71 72
	$(GNULIB_LIBS) \
	../src/libvirt.la
K
Karel Zak 已提交
73

74
EXTRA_DIST =		\
75
	.valgrind.supp \
R
Roman Bogorodskiy 已提交
76
	bhyvexml2argvdata \
77
	bhyvexml2xmloutdata \
78
	capabilityschemadata \
E
Eric Blake 已提交
79 80 81 82
	capabilityschematest \
	commanddata \
	confdata \
	cputestdata \
M
Michal Privoznik 已提交
83 84
	domaincapsschemadata \
	domaincapsschematest \
85
	domainconfdata \
86
	domainschemadata \
E
Eric Blake 已提交
87 88 89 90
	domainschematest \
	domainsnapshotschematest \
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
O
Osier Yang 已提交
91
	fchostdata \
92
	interfaceschemadata \
93
	lxcconf2xmldata \
94
	lxcxml2xmldata \
95
	lxcxml2xmloutdata \
E
Eric Blake 已提交
96
	networkschematest \
97 98
	networkxml2confdata \
	networkxml2firewalldata \
E
Eric Blake 已提交
99 100
	networkxml2xmlin \
	networkxml2xmlout \
J
Ján Tomko 已提交
101 102
	networkxml2xmlupdatein \
	networkxml2xmlupdateout \
E
Eric Blake 已提交
103 104 105 106
	nodedevschemadata \
	nodedevschematest \
	nodeinfodata     \
	nwfilterschematest \
107
	nwfilterxml2firewalldata \
E
Eric Blake 已提交
108 109 110
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
111
	qemuagentdata \
112
	qemucapabilitiesdata \
113
	qemucaps2xmldata \
E
Eric Blake 已提交
114
	qemuhelpdata \
115
	qemuhotplugtestdata \
116
	qemumonitorjsondata \
E
Eric Blake 已提交
117 118
	qemuxml2argvdata \
	qemuxml2xmloutdata \
119
	schematestutils.sh \
J
Ján Tomko 已提交
120
	secretxml2xmlin \
121
	securityselinuxhelperdata \
122
	securityselinuxlabeldata \
E
Eric Blake 已提交
123
	sexpr2xmldata \
124
	storagepoolschemadata \
125
	storagepoolschematest \
126
	storagepoolxml2xmlin \
E
Eric Blake 已提交
127
	storagepoolxml2xmlout \
128
	storagevolschemadata \
129
	storagevolschematest \
130
	storagevolxml2argvdata \
131
	storagevolxml2xmlin \
E
Eric Blake 已提交
132
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
133
	sysinfodata \
E
Eric Blake 已提交
134
	test-lib.sh	\
Y
Yohan BELLEGUIC 已提交
135
	vboxsnapshotxmldata \
136
	vircaps2xmldata \
137
	vircgroupdata \
138
	virfiledata \
139
	virmock.h \
140
	virnetdaemondata \
141
	virnetdevtestdata \
142
	virpcitestdata \
O
Osier Yang 已提交
143
	virscsidata \
144
	virsh-uriprecedence \
145
	virusbtestdata \
146
	vmwareverdata \
147
	vmx2xmldata \
E
Eric Blake 已提交
148
	xencapsdata \
149
	xlconfigdata \
150
	xmconfigdata \
E
Eric Blake 已提交
151
	xml2sexprdata \
152
	xml2vmxdata
K
Karel Zak 已提交
153

G
Gene Czarcinski 已提交
154
test_helpers = commandhelper ssh test_conf
155
test_programs = virshtest sockettest \
E
Eric Blake 已提交
156
	nodeinfotest virbuftest \
157
	commandtest seclabeltest \
E
Eric Blake 已提交
158 159
	virhashtest \
	viratomictest \
160
	utiltest shunloadtest \
161
	virtimetest viruritest virkeyfiletest \
162
	viralloctest \
H
Hu Tao 已提交
163
	virauthconfigtest \
164 165
	virbitmaptest \
	vircgrouptest \
166
	vircryptotest \
M
Michal Privoznik 已提交
167
	virpcitest \
168
	virendiantest \
169
	virfiletest \
170
	virfirewalltest \
J
Ján Tomko 已提交
171
	viriscsitest \
172
	virkeycodetest \
173
	virlockspacetest \
174
	virlogtest \
175
	virrotatingfiletest \
176
	virstringtest \
177
	virportallocatortest \
V
Viktor Mihajlovski 已提交
178
	sysinfotest \
179
	virkmodtest \
180
	vircapstest \
M
Michal Privoznik 已提交
181
	domaincapstest \
182
	domainconftest \
183
	virhostdevtest \
184
	vircaps2xmltest \
M
Michal Privoznik 已提交
185
	virnetdevtest \
186
	virtypedparamtest \
187
	$(NULL)
188

E
Eric Blake 已提交
189 190 191 192
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
193
	virnetdaemontest \
E
Eric Blake 已提交
194 195 196 197 198 199 200
	virnetserverclienttest \
	$(NULL)
if WITH_GNUTLS
test_programs += virnettlscontexttest virnettlssessiontest
endif WITH_GNUTLS
endif WITH_REMOTE

201 202
if WITH_LINUX
test_programs += fchosttest
203
test_programs += scsihosttest
204 205
endif WITH_LINUX

206 207 208 209
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

210
if WITH_DBUS
211
test_programs += virdbustest \
212 213 214 215 216
                 virsystemdtest \
                 $(NULL)
if WITH_POLKIT1
test_programs += virpolkittest
endif WITH_POLKIT1
217
endif WITH_DBUS
218

219
if WITH_SECDRIVER_SELINUX
220
if WITH_ATTR
221 222
test_programs += securityselinuxtest \
                 viridentitytest
223
if WITH_QEMU
224
test_programs += securityselinuxlabeltest
225 226 227
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
228

229 230
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
231
endif WITH_DRIVER_MODULES
232

233 234 235
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
236

237
if WITH_XEN
238
test_programs += xml2sexprtest sexpr2xmltest \
239
	xmconfigtest xencapstest statstest reconnect
240
endif WITH_XEN
241 242 243 244 245

if WITH_LIBXL
test_programs += xlconfigtest
endif WITH_LIBXL

246
if WITH_QEMU
J
Jiri Denemark 已提交
247
test_programs += qemuxml2argvtest qemuxml2xmltest \
248
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
249
	qemumonitortest qemumonitorjsontest qemuhotplugtest \
250 251
	qemuagenttest qemucapabilitiestest qemucaps2xmltest \
	qemucommandutiltest
252
endif WITH_QEMU
253

254
if WITH_LXC
255
test_programs += lxcxml2xmltest lxcconf2xmltest
256
endif WITH_LXC
257

258
if WITH_OPENVZ
259
test_programs += openvzutilstest
260
endif WITH_OPENVZ
261

262
if WITH_ESX
263
test_programs += esxutilstest
264
endif WITH_ESX
265

Y
Yohan BELLEGUIC 已提交
266 267 268 269
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

270
if WITH_VMX
271
test_programs += vmx2xmltest xml2vmxtest
272
endif WITH_VMX
273

274 275 276 277
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
278
if WITH_BHYVE
279
test_programs += bhyvexml2argvtest bhyvexml2xmltest
R
Roman Bogorodskiy 已提交
280 281
endif WITH_BHYVE

282
if WITH_CIL
283
test_programs += objectlocking
284
endif WITH_CIL
285

286
if WITH_YAJL
287
test_programs += jsontest
288
endif WITH_YAJL
289

290 291 292 293
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
		$(NULL)
294

295
if WITH_NETWORK
296 297 298 299
test_programs += \
		networkxml2conftest \
		networkxml2firewalltest \
		$(NULL)
300
endif WITH_NETWORK
301

302 303
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
304
endif WITH_STORAGE_SHEEPDOG
305

306
test_programs += nwfilterxml2xmltest
307

308 309
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
310
test_programs += nwfilterxml2firewalltest
311 312
endif WITH_NWFILTER

313
if WITH_STORAGE
314
test_programs += storagevolxml2argvtest
315
endif WITH_STORAGE
316

317 318
if WITH_STORAGE_FS
test_programs += virstoragetest
319
endif WITH_STORAGE_FS
320

O
Osier Yang 已提交
321 322 323 324
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

325
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
326

327
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
328

329
test_programs += interfacexml2xmltest
330

331
test_programs += cputest
332

P
Peter Krempa 已提交
333 334
test_programs += metadatatest

J
Ján Tomko 已提交
335 336
test_programs += secretxml2xmltest

337
if WITH_LINUX
338 339 340
test_programs += virusbtest \
	virnetdevbandwidthtest \
	$(NULL)
341 342
endif WITH_LINUX

343 344
test_scripts = \
	capabilityschematest \
345
	interfaceschematest \
346 347 348
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
M
Michal Privoznik 已提交
349
	domaincapsschematest \
350
	domainschematest \
351
	nodedevschematest \
352
	nwfilterschematest \
J
Ján Tomko 已提交
353 354
	domainsnapshotschematest \
	secretschematest
355

A
Atsushi SAKAI 已提交
356
if WITH_LIBVIRTD
357 358 359 360 361
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
362 363
	libvirtd-fail			\
	libvirtd-pool			\
364 365 366
	read-bufsiz			\
	read-non-seekable		\
	start				\
367
	virsh-uriprecedence		\
368 369
	vcpupin				\
	virsh-all			\
370
	virsh-optparse			\
371
	virsh-schedinfo			\
372 373 374
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
375

376 377 378
test_programs += 			\
	eventtest			\
	libvirtdconftest
379
else ! WITH_LIBVIRTD
380 381 382 383 384 385 386 387 388 389 390 391 392 393
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			\
394 395 396
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
397
endif ! WITH_LIBVIRTD
398

399 400
test_programs += objecteventtest

J
Jamie Strandboge 已提交
401 402
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
403
else ! WITH_SECDRIVER_APPARMOR
404
EXTRA_DIST += virt-aa-helper-test
405
endif ! WITH_SECDRIVER_APPARMOR
406

407 408
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
409 410
test_libraries = libshunload.la \
		libvirportallocatormock.la \
411
		virnetserverclientmock.la \
412
		vircgroupmock.la \
M
Michal Privoznik 已提交
413
		virpcimock.la \
M
Michal Privoznik 已提交
414
		virnetdevmock.la \
415
		nodeinfomock.la \
D
Daniel P. Berrange 已提交
416
		$(NULL)
417
if WITH_QEMU
418 419
test_libraries += libqemumonitortestutils.la \
		qemuxml2argvmock.la \
P
Pavel Hrdina 已提交
420
		qemucaps2xmlmock.la \
421
		$(NULL)
422
endif WITH_QEMU
423

R
Roman Bogorodskiy 已提交
424 425 426 427
if WITH_BHYVE
test_libraries += bhyvexml2argvmock.la
endif WITH_BHYVE

428
if WITH_DBUS
429
test_libraries += \
430
		virmockdbus.la
431
endif WITH_DBUS
432

433
if WITH_LINUX
434 435 436
test_libraries += virusbmock.la \
		virnetdevbandwidthmock.la \
		$(NULL)
437 438
endif WITH_LINUX

439 440
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
441
noinst_LTLIBRARIES = $(test_libraries)
442
else ! WITH_TESTS
443
check_PROGRAMS = $(test_programs) $(test_helpers)
444
check_LTLIBRARIES = $(test_libraries)
445
endif ! WITH_TESTS
446

447 448
TESTS = $(test_programs) \
	$(test_scripts)
449

450
# NB, automake < 1.10 does not provide the real
451
# abs_top_{src/build}dir or builddir variables, so don't rely
452
# on them here. Fake them with 'pwd'
453 454 455
# 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

456
lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd)
457 458
path_add = $(subst :,$(PATH_SEPARATOR),\
	$(subst !,$(lv_abs_top_builddir)/,!daemon:!tools:!tests))
459

460
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
461
TESTS_ENVIRONMENT =				\
462
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
463
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
464 465 466
  abs_builddir=$(abs_builddir)			\
  abs_srcdir=$(abs_srcdir)			\
  CONFIG_HEADER="$(lv_abs_top_builddir)/config.h"	\
J
Jim Meyering 已提交
467
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
468
  SHELL="$(SHELL)"				\
469
  LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \
470
  LIBVIRT_AUTOSTART=0				\
471
  LC_ALL=C					\
472
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE)	\
473 474
  $(VG)

475

476 477
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(srcdir)/.valgrind.supp
478
valgrind:
479
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
480

481 482 483
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
484
sockettest_LDADD = $(LDADDS)
485

486
if WITH_XEN
E
Eric Blake 已提交
487
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
488 489
xen_LDADDS += $(LDADDS)

490
xml2sexprtest_SOURCES = \
491
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
492
	testutils.c testutils.h
493
xml2sexprtest_LDADD = $(xen_LDADDS)
494 495

sexpr2xmltest_SOURCES = \
496
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
497
	testutils.c testutils.h
498
sexpr2xmltest_LDADD = $(xen_LDADDS)
499

500
xmconfigtest_SOURCES = \
501
	xmconfigtest.c testutilsxen.c testutilsxen.h \
502
	testutils.c testutils.h
503
xmconfigtest_LDADD = $(xen_LDADDS)
504

505 506
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
507
xencapstest_LDADD = $(xen_LDADDS)
508 509

reconnect_SOURCES = \
510
	reconnect.c testutils.h testutils.c
511 512
reconnect_LDADD = $(LDADDS)

513 514
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
515
statstest_LDADD = $(xen_LDADDS)
516

517
else ! WITH_XEN
518 519 520
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
521
endif ! WITH_XEN
522

523 524 525 526 527 528 529 530 531 532 533 534
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
libxl_LDADDS += $(LDADDS)

xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
else ! WITH_LIBXL
EXTRA_DIST += xlconfigtest.c
endif ! WITH_LIBXL

535 536 537 538 539
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

540
if WITH_QEMU
541

542 543
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

544
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
545
if WITH_NETWORK
E
Eric Blake 已提交
546
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
547
endif WITH_NETWORK
548 549 550
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
551
if WITH_DTRACE_PROBES
552
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
553
endif WITH_DTRACE_PROBES
554

555
qemuxml2argvtest_SOURCES = \
556
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
557
	testutils.c testutils.h
558
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LDADDS) $(LIBXML_LIBS)
559

560 561 562
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
qemuxml2argvmock_la_CFLAGS = $(AM_CFLAGS)
563
qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
564

565
qemuxml2xmltest_SOURCES = \
566
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
567
	testutils.c testutils.h
568
qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
569 570 571 572

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
573
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
574 575

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
576
qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
577

578 579 580 581 582 583
qemumonitortest_SOURCES = \
	qemumonitortest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h
qemumonitortest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
584

585 586 587 588 589
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
590 591
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
592

593 594 595 596 597
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
598 599
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
600

601 602 603 604 605 606 607 608
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)

609 610 611 612
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
	$(NULL)
613
qemucaps2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
614

P
Pavel Hrdina 已提交
615 616 617
qemucaps2xmlmock_la_SOURCES = \
	qemucaps2xmlmock.c
qemucaps2xmlmock_la_CFLAGS = $(AM_CFLAGS)
618
qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
P
Pavel Hrdina 已提交
619

P
Peter Krempa 已提交
620 621 622 623 624
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
625
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
P
Peter Krempa 已提交
626

627 628 629 630 631
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
632
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
633

634 635 636
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
637
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
638
else ! WITH_QEMU
639
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
J
Jiri Denemark 已提交
640
	qemuhelptest.c domainsnapshotxml2xmltest.c \
641
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
642
	qemumonitorjsontest.c qemuhotplugtest.c \
643
	qemuagenttest.c qemucapabilitiestest.c \
644
	qemucaps2xmltest.c qemucommandutiltest.c \
645
	$(QEMUMONITORTESTUTILS_SOURCES)
646
endif ! WITH_QEMU
647

648 649
if WITH_LXC

E
Eric Blake 已提交
650
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
651
if WITH_NETWORK
E
Eric Blake 已提交
652
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
653
endif WITH_NETWORK
654
lxc_LDADDS += $(LDADDS)
655 656 657 658

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
659
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
660 661 662 663 664

lxcconf2xmltest_SOURCES = \
	lxcconf2xmltest.c \
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
665
else ! WITH_LXC
666
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
667
endif ! WITH_LXC
668

669 670 671 672
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
673
openvzutilstest_LDADD = $(LDADDS)
674
else ! WITH_OPENVZ
675
EXTRA_DIST += openvzutilstest.c
676
endif ! WITH_OPENVZ
677 678
EXTRA_DIST += openvzutilstest.conf

679 680 681 682
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
683
esxutilstest_LDADD = $(LDADDS)
684
else ! WITH_ESX
685
EXTRA_DIST += esxutilstest.c
686
endif ! WITH_ESX
687

Y
Yohan BELLEGUIC 已提交
688 689 690 691 692 693 694 695 696 697
if WITH_VBOX
vboxsnapshotxmltest_SOURCES = \
	vboxsnapshotxmltest.c \
	testutils.c testutils.h
vbox_LDADDS = ../src/libvirt_driver_vbox_impl.la
vboxsnapshotxmltest_LDADD = $(LDADDS) $(vbox_LDADDS)
else ! WITH_VBOX
EXTRA_DIST += vboxsnapshotxmltest.c
endif ! WITH_VBOX

698
if WITH_VMX
699 700 701
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
702
vmx2xmltest_LDADD = $(LDADDS)
703 704 705 706

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
707
xml2vmxtest_LDADD = $(LDADDS)
708
else ! WITH_VMX
709
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
710
endif ! WITH_VMX
711

712 713 714 715 716 717 718 719 720
if WITH_VMWARE
vmwarevertest_SOURCES = \
    vmwarevertest.c \
    testutils.c testutils.h
vmwarevertest_LDADD = $(LDADDS)
else ! WITH_VMWARE
EXTRA_DIST += vmwarevertest.c
endif ! WITH_VMWARE

R
Roman Bogorodskiy 已提交
721 722 723 724
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
bhyvexml2argvmock_la_CFLAGS = $(AM_CFLAGS)
725
bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
R
Roman Bogorodskiy 已提交
726 727

bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
R
Roman Bogorodskiy 已提交
728 729 730
if WITH_STORAGE
bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
R
Roman Bogorodskiy 已提交
731 732 733 734 735
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
736 737 738 739 740

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
741
else ! WITH_BHYVE
742
EXTRA_DIST += bhyvexml2argvtest.c bhyvexml2xmltest.c bhyvexml2argvmock.c
R
Roman Bogorodskiy 已提交
743 744
endif ! WITH_BHYVE

745 746 747 748 749
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
750 751 752 753 754
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

755
if WITH_NETWORK
756 757
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
758
	testutils.c testutils.h
759
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
760 761 762 763 764 765

networkxml2firewalltest_SOURCES = \
	networkxml2firewalltest.c \
	testutils.c testutils.h
networkxml2firewalltest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)

766
else ! WITH_NETWORK
767
EXTRA_DIST += networkxml2conftest.c
768
endif !	WITH_NETWORK
769

770 771 772 773
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
774 775
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
776
else ! WITH_STORAGE_SHEEPDOG
777
EXTRA_DIST += storagebackendsheepdogtest.c
778
endif ! WITH_STORAGE_SHEEPDOG
779

780 781 782 783
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
784

785 786 787 788 789
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
790 791 792 793 794 795

nwfilterxml2firewalltest_SOURCES = \
	nwfilterxml2firewalltest.c \
	testutils.c testutils.h
nwfilterxml2firewalltest_LDADD = \
	../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
796 797
endif WITH_NWFILTER

J
Ján Tomko 已提交
798 799 800 801 802 803
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)


804
if WITH_STORAGE
805 806 807 808
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
809
	$(LIBXML_LIBS) \
810
	../src/libvirt_driver_storage_impl.la $(LDADDS)
J
Ján Tomko 已提交
811

812
else ! WITH_STORAGE
813
EXTRA_DIST += storagevolxml2argvtest.c
814
endif ! WITH_STORAGE
815

816 817 818 819 820
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

821 822 823 824 825
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
826 827 828
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
829
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
830

831 832 833 834 835
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

836 837 838
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
839
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
840

P
Peter Krempa 已提交
841 842 843 844 845
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

846 847 848 849 850
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
851 852 853
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
854

855 856 857 858
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

859 860 861 862 863 864
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
865 866 867 868 869 870 871
commandhelper_LDADD = \
	$(WARN_CFLAGS) \
	$(NO_INDIRECT_LDFLAGS) \
	$(PROBES_O) \
	../src/libvirt_util.la \
	$(GNULIB_LIBS)

872
commandhelper_LDFLAGS = -static
873

874

875 876 877 878
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

879
vircapstest_SOURCES = \
880 881 882 883 884 885 886 887 888 889
	vircapstest.c testutils.h testutils.c
if WITH_LXC
vircapstest_SOURCES += testutilslxc.c testutilslxc.h
endif WITH_LXC
if WITH_QEMU
vircapstest_SOURCES += testutilsqemu.c testutilsqemu.h
endif WITH_QEMU
if WITH_XEN
vircapstest_SOURCES += testutilsxen.c testutilsxen.h
endif WITH_XEN
890
vircapstest_LDADD = $(qemu_LDADDS) $(LDADDS)
891

892 893 894 895
vircaps2xmltest_SOURCES = \
	vircaps2xmltest.c testutils.h testutils.c
vircaps2xmltest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
896 897 898 899
domaincapstest_SOURCES = \
	domaincapstest.c testutils.h testutils.c
domaincapstest_LDADD = $(LDADDS)

900 901
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
902
domaincapstest_LDADD += $(qemu_LDADDS) $(GNULIB_LIBS)
903 904
endif WITH_QEMU

905 906 907
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
908 909
	$(NULL)
libvirtdconftest_LDADD = ../daemon/libvirtd_conf.la $(LDADDS)
910
else ! WITH_LIBVIRTD
911
EXTRA_DIST += libvirtdconftest.c
912
endif ! WITH_LIBVIRTD
913

914 915
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
916
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
917
virnetmessagetest_LDADD = $(LDADDS)
918

919 920
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
921
virnetsockettest_LDADD = $(LDADDS)
922

923 924
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
925
	testutils.h testutils.c
926 927
virnetdaemontest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
virnetdaemontest_LDADD = $(LDADDS)
928

929 930 931
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
932
virnetserverclienttest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
933 934 935 936 937
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
virnetserverclientmock_la_CFLAGS = $(AM_CFLAGS)
938
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
939
virnetserverclientmock_la_LIBADD = $(GNULIB_LIBS)
940

941
if WITH_GNUTLS
942
virnettlscontexttest_SOURCES = \
943 944 945
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
946
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
947 948 949 950
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
951
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
952 953 954
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
955 956
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
957
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
958
EXTRA_DIST += pkix_asn1_tab.c
959 960
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
961
EXTRA_DIST += \
962 963 964
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
965
endif ! WITH_GNUTLS
966

967 968
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
969
virtimetest_LDADD = $(LDADDS)
970

971 972 973 974
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

975 976
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
977 978 979 980 981 982 983
virstoragetest_LDADD = $(LDADDS) \
	../src/libvirt.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	../src/libvirt_driver_storage_impl.la \
	../gnulib/lib/libgnu.la \
	$(NULL)
984

985 986 987
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
988
if WITH_SELINUX
989
viridentitytest_LDADD += $(SELINUX_LIBS)
990 991 992
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
993

J
Ján Tomko 已提交
994 995 996 997
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

998 999 1000 1001
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1002 1003 1004 1005
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1006 1007 1008 1009
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1010 1011 1012 1013 1014 1015 1016
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

libvirportallocatormock_la_SOURCES = \
	virportallocatortest.c
libvirportallocatormock_la_CFLAGS = $(AM_CFLAGS) -DMOCK_HELPER=1
1017
libvirportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1018
libvirportallocatormock_la_LIBADD = ../src/libvirt.la
D
Daniel P. Berrange 已提交
1019

1020 1021 1022 1023 1024 1025 1026
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
1027
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1028

1029 1030 1031 1032
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1033 1034 1035 1036
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1037 1038 1039 1040 1041 1042 1043
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
1044 1045
virpcimock_la_LIBADD = $(GNULIB_LIBS) \
					   ../src/libvirt.la
1046
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
M
Michal Privoznik 已提交
1047

1048 1049 1050 1051 1052
nodeinfomock_la_SOURCES = \
	nodeinfomock.c
nodeinfomock_la_CFLAGS = $(AM_CFLAGS)
nodeinfomock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)

M
Michal Privoznik 已提交
1053 1054 1055 1056 1057 1058 1059 1060 1061 1062
virnetdevtest_SOURCES = \
	virnetdevtest.c testutils.h testutils.c
virnetdevtest_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
virnetdevtest_LDADD = $(LDADDS)

virnetdevmock_la_SOURCES = \
	virnetdevmock.c
virnetdevmock_la_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS)
virnetdevmock_la_LIBADD = $(GNULIB_LIBS) \
					   ../src/libvirt.la
1063
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
M
Michal Privoznik 已提交
1064

1065 1066 1067 1068 1069
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1070 1071 1072 1073
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1074 1075
virusbmock_la_SOURCES = virusbmock.c
virusbmock_la_CFLAGS = $(AM_CFLAGS)
1076
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1077 1078 1079 1080

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
virnetdevbandwidthmock_la_CFLAGS = $(AM_CFLAGS)
1081
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1082

1083
else ! WITH_LINUX
1084 1085
	EXTRA_DIST += virusbtest.c virusbmock.c \
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c
1086 1087
endif ! WITH_LINUX

1088 1089 1090 1091
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1092
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1093

1094 1095 1096
virmockdbus_la_SOURCES = \
	virmockdbus.c
virmockdbus_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1097
virmockdbus_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1098

1099 1100 1101 1102 1103
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1104 1105 1106 1107 1108
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virrotatingfiletest_LDADD = $(LDADDS) $(DBUS_LIBS)

1109 1110
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1111
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1112
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1113

1114
else ! WITH_DBUS
1115
EXTRA_DIST += virdbustest.c virmockdbus.c virsystemdtest.c
1116
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1117

1118 1119
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1120
viruritest_LDADD = $(LDADDS)
1121

1122 1123
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1124
virkeyfiletest_LDADD = $(LDADDS)
1125

1126 1127 1128 1129
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1130 1131
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1132
virauthconfigtest_LDADD = $(LDADDS)
1133

1134 1135
seclabeltest_SOURCES = \
	seclabeltest.c
1136
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1137

1138
if WITH_SECDRIVER_SELINUX
1139
if WITH_ATTR
1140 1141
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1142
else ! WITH_TESTS
1143
check_LTLIBRARIES += libsecurityselinuxhelper.la
1144
endif ! WITH_TESTS
1145 1146 1147

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1148
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1149 1150 1151

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1152
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1153 1154
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1155 1156 1157 1158 1159

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1160
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(LDADDS) $(SELINUX_LIBS)
1161 1162
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1163 1164 1165
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1166 1167
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1168

1169 1170 1171 1172
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1173 1174 1175
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1176

1177
viratomictest_SOURCES = \
L
Laine Stump 已提交
1178
	viratomictest.c testutils.h testutils.c
1179 1180
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1181 1182 1183 1184
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1185 1186 1187 1188
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1189 1190 1191 1192
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

1193 1194
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1195
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1196 1197
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1198
jsontest_SOURCES = \
1199
	jsontest.c testutils.h testutils.c
1200 1201
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
1202 1203 1204 1205
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1206 1207 1208 1209
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1210
endif WITH_DRIVER_MODULES
1211

1212 1213
if WITH_LIBVIRTD
eventtest_SOURCES = \
1214
	eventtest.c testutils.h testutils.c
1215
eventtest_LDADD = -lrt $(LDADDS)
1216
endif WITH_LIBVIRTD
1217

1218 1219
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1220
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1221 1222 1223

shunloadtest_SOURCES = \
	shunloadtest.c
1224
shunloadtest_LDADD = $(LIB_PTHREAD)
1225 1226
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1227 1228 1229 1230
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1231 1232 1233 1234
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1235 1236 1237 1238
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1239 1240 1241 1242 1243
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1244 1245 1246 1247 1248
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1249
if WITH_LINUX
O
Osier Yang 已提交
1250 1251 1252 1253
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1254 1255 1256 1257
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1258 1259
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1260
EXTRA_DIST += scsihosttest.c
1261 1262
endif  ! WITH_LINUX

O
Osier Yang 已提交
1263 1264 1265 1266 1267 1268 1269 1270 1271
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1272 1273 1274 1275 1276 1277
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1278
objectlocking_SOURCES = objectlocking.ml
1279 1280 1281 1282

%.cmx: %.ml
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) -c $<

1283
objectlocking: objectlocking.cmx objectlocking-files.txt
1284 1285
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1286

1287
objectlocking-files.txt:
1288 1289
	find $(top_builddir)/src/ -name '*.i' > $@

1290
else ! WITH_CIL
1291
EXTRA_DIST += objectlocking.ml
1292
endif ! WITH_CIL
1293

1294
CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx \
1295
	objectlocking-files.txt