Makefile.am 32.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 75 76
MOCKLIBS_LIBS = \
	$(GNULIB_LIBS)

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

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

E
Eric Blake 已提交
197 198 199 200
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
201
	virnetdaemontest \
E
Eric Blake 已提交
202 203 204 205 206 207 208
	virnetserverclienttest \
	$(NULL)
if WITH_GNUTLS
test_programs += virnettlscontexttest virnettlssessiontest
endif WITH_GNUTLS
endif WITH_REMOTE

209 210
if WITH_LINUX
test_programs += fchosttest
211
test_programs += scsihosttest
212 213
endif WITH_LINUX

214 215 216 217
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

218
if WITH_DBUS
219
test_programs += virdbustest \
220 221 222 223 224
                 virsystemdtest \
                 $(NULL)
if WITH_POLKIT1
test_programs += virpolkittest
endif WITH_POLKIT1
225
endif WITH_DBUS
226

227
if WITH_SECDRIVER_SELINUX
228
if WITH_ATTR
229 230
test_programs += securityselinuxtest \
                 viridentitytest
231
if WITH_QEMU
232
test_programs += securityselinuxlabeltest
233 234 235
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
236

237 238
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
239
endif WITH_DRIVER_MODULES
240

241 242 243
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
244

245
if WITH_XEN
246
test_programs += xml2sexprtest sexpr2xmltest \
247
	xmconfigtest xencapstest statstest reconnect
248
endif WITH_XEN
249 250 251 252 253

if WITH_LIBXL
test_programs += xlconfigtest
endif WITH_LIBXL

254
if WITH_QEMU
J
Jiri Denemark 已提交
255
test_programs += qemuxml2argvtest qemuxml2xmltest \
256
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
257
	qemumonitortest qemumonitorjsontest qemuhotplugtest \
258 259
	qemuagenttest qemucapabilitiestest qemucaps2xmltest \
	qemucommandutiltest
260
endif WITH_QEMU
261

262
if WITH_LXC
263
test_programs += lxcxml2xmltest lxcconf2xmltest
264
endif WITH_LXC
265

266
if WITH_OPENVZ
267
test_programs += openvzutilstest
268
endif WITH_OPENVZ
269

270
if WITH_ESX
271
test_programs += esxutilstest
272
endif WITH_ESX
273

Y
Yohan BELLEGUIC 已提交
274 275 276 277
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

278
if WITH_VMX
279
test_programs += vmx2xmltest xml2vmxtest
280
endif WITH_VMX
281

282 283 284 285
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
286
if WITH_BHYVE
287
test_programs += bhyvexml2argvtest bhyvexml2xmltest
R
Roman Bogorodskiy 已提交
288 289
endif WITH_BHYVE

290
if WITH_CIL
291
test_programs += objectlocking
292
endif WITH_CIL
293

294
if WITH_YAJL
295
test_programs += jsontest
296
endif WITH_YAJL
297

298 299 300 301
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
		$(NULL)
302

303
if WITH_NETWORK
304 305 306 307
test_programs += \
		networkxml2conftest \
		networkxml2firewalltest \
		$(NULL)
308
endif WITH_NETWORK
309

310 311
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
312
endif WITH_STORAGE_SHEEPDOG
313

314
test_programs += nwfilterxml2xmltest
315

316 317
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
318
test_programs += nwfilterxml2firewalltest
319 320
endif WITH_NWFILTER

321
if WITH_STORAGE
322
test_programs += storagevolxml2argvtest
323
endif WITH_STORAGE
324

325 326
if WITH_STORAGE_FS
test_programs += virstoragetest
327
endif WITH_STORAGE_FS
328

O
Osier Yang 已提交
329 330 331 332
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

333
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
334

335
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
336

337
test_programs += interfacexml2xmltest
338

339
test_programs += cputest
340

P
Peter Krempa 已提交
341 342
test_programs += metadatatest

J
Ján Tomko 已提交
343 344
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
345 346
test_programs += genericxml2xmltest

347
if WITH_LINUX
348 349 350
test_programs += virusbtest \
	virnetdevbandwidthtest \
	$(NULL)
351 352
endif WITH_LINUX

353 354
test_scripts = \
	capabilityschematest \
355
	interfaceschematest \
356 357 358
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
M
Michal Privoznik 已提交
359
	domaincapsschematest \
360
	domainschematest \
361
	nodedevschematest \
362
	nwfilterschematest \
J
Ján Tomko 已提交
363 364
	domainsnapshotschematest \
	secretschematest
365

A
Atsushi SAKAI 已提交
366
if WITH_LIBVIRTD
367 368 369 370 371
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
372 373
	libvirtd-fail			\
	libvirtd-pool			\
374 375 376
	read-bufsiz			\
	read-non-seekable		\
	start				\
377
	virsh-uriprecedence		\
378 379
	vcpupin				\
	virsh-all			\
380
	virsh-optparse			\
381
	virsh-schedinfo			\
382 383 384
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
385

386 387 388
test_programs += 			\
	eventtest			\
	libvirtdconftest
389
else ! WITH_LIBVIRTD
390 391 392 393 394 395 396 397 398 399 400 401 402 403
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			\
404 405 406
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
407
endif ! WITH_LIBVIRTD
408

409 410
test_programs += objecteventtest

J
Jamie Strandboge 已提交
411 412
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
413
else ! WITH_SECDRIVER_APPARMOR
414
EXTRA_DIST += virt-aa-helper-test
415
endif ! WITH_SECDRIVER_APPARMOR
416

417 418
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
419
test_libraries = libshunload.la \
420
		virportallocatormock.la \
421
		virnetserverclientmock.la \
422
		vircgroupmock.la \
M
Michal Privoznik 已提交
423
		virpcimock.la \
M
Michal Privoznik 已提交
424
		virnetdevmock.la \
425
		nodeinfomock.la \
M
Michal Privoznik 已提交
426
		nssmock.la \
D
Daniel P. Berrange 已提交
427
		$(NULL)
428
if WITH_QEMU
429 430
test_libraries += libqemumonitortestutils.la \
		qemuxml2argvmock.la \
P
Pavel Hrdina 已提交
431
		qemucaps2xmlmock.la \
432
		$(NULL)
433
endif WITH_QEMU
434

R
Roman Bogorodskiy 已提交
435 436 437 438
if WITH_BHYVE
test_libraries += bhyvexml2argvmock.la
endif WITH_BHYVE

439
if WITH_DBUS
440
test_libraries += \
441
		virdbusmock.la
442
endif WITH_DBUS
443

444
if WITH_LINUX
445 446 447
test_libraries += virusbmock.la \
		virnetdevbandwidthmock.la \
		$(NULL)
448 449
endif WITH_LINUX

450 451
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
452
noinst_LTLIBRARIES = $(test_libraries)
453
else ! WITH_TESTS
454
check_PROGRAMS = $(test_programs) $(test_helpers)
455
check_LTLIBRARIES = $(test_libraries)
456
endif ! WITH_TESTS
457

458 459
TESTS = $(test_programs) \
	$(test_scripts)
460

461
# NB, automake < 1.10 does not provide the real
462
# abs_top_{src/build}dir or builddir variables, so don't rely
463
# on them here. Fake them with 'pwd'
464 465 466
# 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

467
lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd)
468

469
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
470
TESTS_ENVIRONMENT =				\
471
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
472
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
473 474 475
  abs_builddir=$(abs_builddir)			\
  abs_srcdir=$(abs_srcdir)			\
  CONFIG_HEADER="$(lv_abs_top_builddir)/config.h"	\
476
  SHELL="$(SHELL)"				\
477
  LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \
478
  LIBVIRT_AUTOSTART=0				\
479
  LC_ALL=C					\
480
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE)	\
481 482
  $(VG)

483

484 485
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(srcdir)/.valgrind.supp
486
valgrind:
487
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
488

489 490 491
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
492
sockettest_LDADD = $(LDADDS)
493

494
if WITH_XEN
E
Eric Blake 已提交
495
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
496 497
xen_LDADDS += $(LDADDS)

498
xml2sexprtest_SOURCES = \
499
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
500
	testutils.c testutils.h
501
xml2sexprtest_LDADD = $(xen_LDADDS)
502 503

sexpr2xmltest_SOURCES = \
504
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
505
	testutils.c testutils.h
506
sexpr2xmltest_LDADD = $(xen_LDADDS)
507

508
xmconfigtest_SOURCES = \
509
	xmconfigtest.c testutilsxen.c testutilsxen.h \
510
	testutils.c testutils.h
511
xmconfigtest_LDADD = $(xen_LDADDS)
512

513 514
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
515
xencapstest_LDADD = $(xen_LDADDS)
516 517

reconnect_SOURCES = \
518
	reconnect.c testutils.h testutils.c
519 520
reconnect_LDADD = $(LDADDS)

521 522
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
523
statstest_LDADD = $(xen_LDADDS)
524

525
else ! WITH_XEN
526 527 528
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
529
endif ! WITH_XEN
530

531 532 533 534 535 536 537 538 539 540 541 542
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

543 544 545 546 547
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

548
if WITH_QEMU
549

550 551
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

552
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
553
if WITH_NETWORK
E
Eric Blake 已提交
554
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
555
endif WITH_NETWORK
556 557 558
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
559
if WITH_DTRACE_PROBES
560
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
561
endif WITH_DTRACE_PROBES
562

563
qemuxml2argvtest_SOURCES = \
564
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
565
	testutils.c testutils.h
566
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LDADDS) $(LIBXML_LIBS)
567

568 569 570
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
qemuxml2argvmock_la_CFLAGS = $(AM_CFLAGS)
571
qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
572
qemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
573

574
qemuxml2xmltest_SOURCES = \
575
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
576
	testutils.c testutils.h
577
qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
578 579 580 581

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
582
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
583 584

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
585
qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
586

587 588 589 590 591 592
qemumonitortest_SOURCES = \
	qemumonitortest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h
qemumonitortest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
593

594 595 596 597 598
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
599 600
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
601

602 603 604 605 606
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
607 608
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
609

610 611 612 613 614 615 616 617
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)

618 619 620 621
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
	$(NULL)
622
qemucaps2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
623

P
Pavel Hrdina 已提交
624 625 626
qemucaps2xmlmock_la_SOURCES = \
	qemucaps2xmlmock.c
qemucaps2xmlmock_la_CFLAGS = $(AM_CFLAGS)
627
qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
628
qemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
629

P
Peter Krempa 已提交
630 631 632 633 634
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
635
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
P
Peter Krempa 已提交
636

637 638 639 640 641
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
642
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
643

644 645 646
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
647
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
648
else ! WITH_QEMU
649
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
J
Jiri Denemark 已提交
650
	qemuhelptest.c domainsnapshotxml2xmltest.c \
651
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
652
	qemumonitorjsontest.c qemuhotplugtest.c \
653
	qemuagenttest.c qemucapabilitiestest.c \
654
	qemucaps2xmltest.c qemucommandutiltest.c \
655
	$(QEMUMONITORTESTUTILS_SOURCES)
656
endif ! WITH_QEMU
657

658 659
if WITH_LXC

E
Eric Blake 已提交
660
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
661
if WITH_NETWORK
E
Eric Blake 已提交
662
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
663
endif WITH_NETWORK
664
lxc_LDADDS += $(LDADDS)
665 666 667 668

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
669
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
670 671

lxcconf2xmltest_SOURCES = \
672
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
673 674
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
675
else ! WITH_LXC
676
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
677
endif ! WITH_LXC
678

679 680 681 682
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
683
openvzutilstest_LDADD = $(LDADDS)
684
else ! WITH_OPENVZ
685
EXTRA_DIST += openvzutilstest.c
686
endif ! WITH_OPENVZ
687 688
EXTRA_DIST += openvzutilstest.conf

689 690 691 692
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
693
esxutilstest_LDADD = $(LDADDS)
694
else ! WITH_ESX
695
EXTRA_DIST += esxutilstest.c
696
endif ! WITH_ESX
697

Y
Yohan BELLEGUIC 已提交
698 699 700 701 702 703 704 705 706 707
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

708
if WITH_VMX
709 710 711
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
712
vmx2xmltest_LDADD = $(LDADDS)
713 714 715 716

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
717
xml2vmxtest_LDADD = $(LDADDS)
718
else ! WITH_VMX
719
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
720
endif ! WITH_VMX
721

722 723 724 725 726 727 728 729 730
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 已提交
731 732 733 734
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
bhyvexml2argvmock_la_CFLAGS = $(AM_CFLAGS)
735
bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
736
bhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
737 738

bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
R
Roman Bogorodskiy 已提交
739 740 741
if WITH_STORAGE
bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
R
Roman Bogorodskiy 已提交
742 743 744 745 746
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
747 748 749 750 751

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
752
else ! WITH_BHYVE
753
EXTRA_DIST += bhyvexml2argvtest.c bhyvexml2xmltest.c bhyvexml2argvmock.c
R
Roman Bogorodskiy 已提交
754 755
endif ! WITH_BHYVE

756 757 758 759 760
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
761 762 763 764 765
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

766
if WITH_NETWORK
767 768
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
769
	testutils.c testutils.h
770
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
771 772 773 774 775 776

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

777
else ! WITH_NETWORK
778
EXTRA_DIST += networkxml2conftest.c
779
endif !	WITH_NETWORK
780

781 782 783 784
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
785 786
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
787
else ! WITH_STORAGE_SHEEPDOG
788
EXTRA_DIST += storagebackendsheepdogtest.c
789
endif ! WITH_STORAGE_SHEEPDOG
790

791 792 793 794
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
795

796 797 798 799 800
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
801 802 803 804 805 806

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

J
Ján Tomko 已提交
809 810 811 812 813
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
814 815 816 817 818
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
819

820
if WITH_STORAGE
821 822 823 824
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
825
	$(LIBXML_LIBS) \
826
	../src/libvirt_driver_storage_impl.la $(LDADDS)
J
Ján Tomko 已提交
827

828
else ! WITH_STORAGE
829
EXTRA_DIST += storagevolxml2argvtest.c
830
endif ! WITH_STORAGE
831

832 833 834 835 836
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

837 838 839 840 841
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
842 843 844
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
845
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
846

847 848 849 850 851
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

852 853 854
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
855
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
856

P
Peter Krempa 已提交
857 858 859 860 861
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

862 863 864 865 866
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
867 868 869
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
870

871 872 873 874
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

875 876 877 878 879 880
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
881 882 883 884 885 886 887
commandhelper_LDADD = \
	$(WARN_CFLAGS) \
	$(NO_INDIRECT_LDFLAGS) \
	$(PROBES_O) \
	../src/libvirt_util.la \
	$(GNULIB_LIBS)

888
commandhelper_LDFLAGS = -static
889

890

891 892 893 894
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

895
vircapstest_SOURCES = \
896 897 898 899 900 901 902 903 904 905
	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
906
vircapstest_LDADD = $(qemu_LDADDS) $(LDADDS)
907

908 909 910 911
vircaps2xmltest_SOURCES = \
	vircaps2xmltest.c testutils.h testutils.c
vircaps2xmltest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
912 913 914 915
domaincapstest_SOURCES = \
	domaincapstest.c testutils.h testutils.c
domaincapstest_LDADD = $(LDADDS)

916 917
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
918
domaincapstest_LDADD += $(qemu_LDADDS) $(GNULIB_LIBS)
919 920
endif WITH_QEMU

921 922 923
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
924 925
	$(NULL)
libvirtdconftest_LDADD = ../daemon/libvirtd_conf.la $(LDADDS)
926
else ! WITH_LIBVIRTD
927
EXTRA_DIST += libvirtdconftest.c
928
endif ! WITH_LIBVIRTD
929

930 931
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
932
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
933
virnetmessagetest_LDADD = $(LDADDS)
934

935 936
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
937
virnetsockettest_LDADD = $(LDADDS)
938

939 940
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
941
	testutils.h testutils.c
942 943
virnetdaemontest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
virnetdaemontest_LDADD = $(LDADDS)
944

945 946 947
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
948
virnetserverclienttest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
949 950 951 952 953
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
virnetserverclientmock_la_CFLAGS = $(AM_CFLAGS)
954
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
955
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
956

957
if WITH_GNUTLS
958
virnettlscontexttest_SOURCES = \
959 960 961
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
962
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
963 964 965 966
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
967
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
968 969 970
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
971 972
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
973
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
974
EXTRA_DIST += pkix_asn1_tab.c
975 976
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
977
EXTRA_DIST += \
978 979 980
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
981
endif ! WITH_GNUTLS
982

983 984
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
985
virtimetest_LDADD = $(LDADDS)
986

987 988 989 990
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

991 992
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
993 994 995 996 997 998 999
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)
1000

1001 1002 1003
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1004
if WITH_SELINUX
1005
viridentitytest_LDADD += $(SELINUX_LIBS)
1006 1007 1008
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1009

J
Ján Tomko 已提交
1010 1011 1012 1013
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1014 1015 1016 1017
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1018 1019 1020 1021
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1022 1023 1024 1025
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1026 1027 1028 1029
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1030
virportallocatormock_la_SOURCES = \
1031
	virportallocatormock.c
1032 1033 1034
virportallocatormock_la_CFLAGS = $(AM_CFLAGS)
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1035

1036 1037 1038 1039 1040 1041 1042
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
1043
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1044
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1045

1046 1047 1048 1049
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1050 1051 1052 1053
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1054 1055 1056 1057 1058 1059 1060
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
1061
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1062
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1063

1064 1065 1066 1067
nodeinfomock_la_SOURCES = \
	nodeinfomock.c
nodeinfomock_la_CFLAGS = $(AM_CFLAGS)
nodeinfomock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1068
nodeinfomock_la_LIBADD = $(MOCKLIBS_LIBS)
1069

M
Michal Privoznik 已提交
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
	$(AM_CFLAGS)	\
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
	$(LDADDS)	\
	../tools/nss/libnss_libvirt_impl.la

nssmock_la_SOURCES = \
	nssmock.c
nssmock_la_CFLAGS = $(AM_CFLAGS)
nssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
nssmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1085 1086 1087 1088 1089 1090 1091 1092 1093
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
nsslinktest_CFLAGS = 	\
	$(AM_CFLAGS)		\
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

M
Michal Privoznik 已提交
1094 1095 1096 1097 1098 1099 1100 1101
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)
1102
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1103
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1104

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

1110 1111 1112 1113 1114
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1115 1116 1117 1118
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1119 1120
virusbmock_la_SOURCES = virusbmock.c
virusbmock_la_CFLAGS = $(AM_CFLAGS)
1121
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1122
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS)
1123 1124 1125 1126

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
virnetdevbandwidthmock_la_CFLAGS = $(AM_CFLAGS)
1127
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1128
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1129

1130
else ! WITH_LINUX
1131 1132
	EXTRA_DIST += virusbtest.c virusbmock.c \
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c
1133 1134
endif ! WITH_LINUX

1135 1136 1137 1138
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1139
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1140

1141 1142 1143 1144 1145
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1146

1147 1148 1149 1150 1151
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1152 1153
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1154
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1155
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1156

1157
else ! WITH_DBUS
1158
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1159
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1160

1161 1162
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1163
viruritest_LDADD = $(LDADDS)
1164

1165 1166
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1167
virkeyfiletest_LDADD = $(LDADDS)
1168

1169 1170 1171 1172
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1173 1174
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1175
virauthconfigtest_LDADD = $(LDADDS)
1176

1177 1178
seclabeltest_SOURCES = \
	seclabeltest.c
1179
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1180

1181
if WITH_SECDRIVER_SELINUX
1182
if WITH_ATTR
1183 1184
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1185
else ! WITH_TESTS
1186
check_LTLIBRARIES += libsecurityselinuxhelper.la
1187
endif ! WITH_TESTS
1188 1189 1190

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1191
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1192 1193 1194

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1195
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1196 1197
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1198 1199 1200 1201 1202

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1203
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(LDADDS) $(SELINUX_LIBS)
1204 1205
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1206 1207 1208
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1209 1210
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1211

1212 1213 1214 1215
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1216 1217 1218
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1219

1220
viratomictest_SOURCES = \
L
Laine Stump 已提交
1221
	viratomictest.c testutils.h testutils.c
1222 1223
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1224 1225 1226 1227
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1228 1229 1230 1231
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1232 1233 1234 1235
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

1236 1237
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1238
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1239 1240
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1241
jsontest_SOURCES = \
1242
	jsontest.c testutils.h testutils.c
1243 1244
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
1245 1246 1247 1248
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1249 1250 1251 1252
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1253
endif WITH_DRIVER_MODULES
1254

1255 1256
if WITH_LIBVIRTD
eventtest_SOURCES = \
1257
	eventtest.c testutils.h testutils.c
1258
eventtest_LDADD = -lrt $(LDADDS)
1259
endif WITH_LIBVIRTD
1260

1261 1262
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1263
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1264 1265 1266

shunloadtest_SOURCES = \
	shunloadtest.c
1267
shunloadtest_LDADD = $(LIB_PTHREAD)
1268 1269
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1270 1271 1272 1273
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1274 1275 1276 1277
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1278 1279 1280 1281
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1282 1283 1284 1285 1286
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1287 1288 1289 1290 1291
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1292
if WITH_LINUX
O
Osier Yang 已提交
1293 1294 1295 1296
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1297 1298 1299 1300
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1301 1302
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1303
EXTRA_DIST += scsihosttest.c
1304 1305
endif  ! WITH_LINUX

O
Osier Yang 已提交
1306 1307 1308 1309 1310 1311 1312 1313 1314
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1315 1316 1317 1318 1319 1320
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1321
objectlocking_SOURCES = objectlocking.ml
1322 1323 1324 1325

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

1326
objectlocking: objectlocking.cmx objectlocking-files.txt
1327 1328
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1329

1330
objectlocking-files.txt:
1331 1332
	find $(top_builddir)/src/ -name '*.i' > $@

1333
else ! WITH_CIL
1334
EXTRA_DIST += objectlocking.ml
1335
endif ! WITH_CIL
1336

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