Makefile.am 35.6 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
# old automake does not provide abs_{src,build}dir variables
abs_builddir = $(shell pwd)
21
abs_topbuilddir = $(shell cd .. && pwd)
22
abs_srcdir = $(shell cd $(srcdir) && pwd)
23
abs_topsrcdir = $(shell cd $(top_srcdir) && pwd)
24

25 26
SHELL = $(PREFERABLY_POSIX_SHELL)

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

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

51 52 53
AM_LDFLAGS = \
	-export-dynamic

54 55 56 57
MOCKLIBS_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
	$(MINGW_EXTRA_LDFLAGS)

58 59 60 61 62
QEMULIB_LDFLAGS = \
	-avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
	$(MINGW_EXTRA_LDFLAGS)

63 64 65
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
66
endif WITH_DRIVER_MODULES
67

68
PROBES_O =
69
if WITH_DTRACE_PROBES
70
PROBES_O += ../src/libvirt_probes.lo
71
endif WITH_DTRACE_PROBES
72

73 74 75
GNULIB_LIBS = \
       ../gnulib/lib/libgnu.la

K
Karel Zak 已提交
76
LDADDS = \
77
	$(WARN_CFLAGS) \
78
	$(NO_INDIRECT_LDFLAGS) \
79
	$(PROBES_O) \
80 81
	$(GNULIB_LIBS) \
	../src/libvirt.la
K
Karel Zak 已提交
82

83 84 85
MOCKLIBS_LIBS = \
	$(GNULIB_LIBS)

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

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

200 201 202 203 204 205 206 207 208 209 210 211
test_libraries = libshunload.la \
	virportallocatormock.la \
	virnetdaemonmock.la \
	virnetserverclientmock.la \
	vircgroupmock.la \
	virpcimock.la \
	virnetdevmock.la \
	virrandommock.la \
	virhostcpumock.la \
	domaincapsmock.la \
	$(NULL)

E
Eric Blake 已提交
212 213 214 215
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
216
	virnetdaemontest \
E
Eric Blake 已提交
217 218 219 220 221 222 223
	virnetserverclienttest \
	$(NULL)
if WITH_GNUTLS
test_programs += virnettlscontexttest virnettlssessiontest
endif WITH_GNUTLS
endif WITH_REMOTE

224 225
if WITH_LINUX
test_programs += fchosttest
226
test_programs += scsihosttest
227 228 229 230
test_libraries += virusbmock.la \
	virnetdevbandwidthmock.la \
	virtestmock.la \
	$(NULL)
231 232
endif WITH_LINUX

233 234 235 236
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

237
if WITH_DBUS
238
test_programs += virdbustest \
239 240
                 virsystemdtest \
                 $(NULL)
241
test_libraries += virdbusmock.la
242 243 244
if WITH_POLKIT1
test_programs += virpolkittest
endif WITH_POLKIT1
245
endif WITH_DBUS
246

247
if WITH_SECDRIVER_SELINUX
248
if WITH_ATTR
249 250
test_programs += securityselinuxtest \
                 viridentitytest
251
if WITH_QEMU
252
test_programs += securityselinuxlabeltest
253 254 255
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
256

257 258
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
259
endif WITH_DRIVER_MODULES
260

261 262 263
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
264

265
if WITH_XEN
266
test_programs += xml2sexprtest sexpr2xmltest \
267
	xmconfigtest xencapstest
268
endif WITH_XEN
269 270 271 272 273

if WITH_LIBXL
test_programs += xlconfigtest
endif WITH_LIBXL

274
if WITH_QEMU
J
Jiri Denemark 已提交
275
test_programs += qemuxml2argvtest qemuxml2xmltest \
276
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
277
	qemumonitortest qemumonitorjsontest qemuhotplugtest \
278 279
	qemuagenttest qemucapabilitiestest qemucaps2xmltest \
	qemucommandutiltest
J
Jiri Denemark 已提交
280
test_helpers += qemucapsprobe
281 282 283
test_libraries += libqemumonitortestutils.la \
		libqemutestdriver.la \
		qemuxml2argvmock.la \
284
		qemuxml2xmlmock.la \
285 286 287
		qemucaps2xmlmock.la \
		qemucapsprobemock.la \
		$(NULL)
288
endif WITH_QEMU
289

290
if WITH_LXC
291
test_programs += lxcxml2xmltest lxcconf2xmltest
292
endif WITH_LXC
293

294
if WITH_OPENVZ
295
test_programs += openvzutilstest
296
endif WITH_OPENVZ
297

298
if WITH_ESX
299
test_programs += esxutilstest
300
endif WITH_ESX
301

Y
Yohan BELLEGUIC 已提交
302 303 304 305
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

306
if WITH_VMX
307
test_programs += vmx2xmltest xml2vmxtest
308
endif WITH_VMX
309

310 311 312 313
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
314
if WITH_BHYVE
315
test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest
316
test_libraries += bhyvexml2argvmock.la bhyveargv2xmlmock.la
R
Roman Bogorodskiy 已提交
317 318
endif WITH_BHYVE

319
if WITH_CIL
320
test_programs += objectlocking
321
endif WITH_CIL
322

323
if WITH_YAJL
324
test_programs += jsontest
325
endif WITH_YAJL
326

327 328 329 330
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
		$(NULL)
331

332
if WITH_NETWORK
333 334 335 336
test_programs += \
		networkxml2conftest \
		networkxml2firewalltest \
		$(NULL)
337
endif WITH_NETWORK
338

339 340
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
341
endif WITH_STORAGE_SHEEPDOG
342

343
test_programs += nwfilterxml2xmltest
344

345 346
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
347
test_programs += nwfilterxml2firewalltest
348 349
endif WITH_NWFILTER

350
if WITH_STORAGE
351
test_programs += storagevolxml2argvtest
352
endif WITH_STORAGE
353

354 355
if WITH_STORAGE_FS
test_programs += virstoragetest
356
endif WITH_STORAGE_FS
357

O
Osier Yang 已提交
358 359 360 361
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

362
if WITH_NSS
363 364
test_helpers += nsslinktest nssguestlinktest
test_programs += nsstest nssguesttest
365
test_libraries += nssmock.la
366 367
endif WITH_NSS

368
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
369

370
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
371

372
test_programs += interfacexml2xmltest
373

374
test_programs += cputest
375

P
Peter Krempa 已提交
376 377
test_programs += metadatatest

J
Ján Tomko 已提交
378 379
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
380 381
test_programs += genericxml2xmltest

382
if WITH_LINUX
383 384 385
test_programs += virusbtest \
	virnetdevbandwidthtest \
	$(NULL)
386 387
endif WITH_LINUX

J
Ján Tomko 已提交
388
test_scripts =
389
libvirtd_test_scripts =		\
J
Jim Meyering 已提交
390 391
	libvirtd-fail			\
	libvirtd-pool			\
392 393 394
	virsh-cpuset			\
	virsh-define-dev-segfault	\
	virsh-int-overflow		\
395
	virsh-optparse			\
396 397
	virsh-read-bufsiz		\
	virsh-read-non-seekable		\
398
	virsh-schedinfo			\
J
Ján Tomko 已提交
399
	virsh-self-test			\
M
Michal Privoznik 已提交
400
	virt-admin-self-test			\
401
	virsh-start			\
402
	virsh-undefine			\
403 404
	virsh-uriprecedence		\
	virsh-vcpupin			\
405
	$(NULL)
406

407 408 409
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

410
test_programs += 			\
411
	eventtest
412
else ! WITH_LIBVIRTD
413
EXTRA_DIST += $(libvirtd_test_scripts)
414
endif ! WITH_LIBVIRTD
415

416 417
test_programs += objecteventtest

J
Jamie Strandboge 已提交
418 419
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
420
else ! WITH_SECDRIVER_APPARMOR
421
EXTRA_DIST += virt-aa-helper-test
422
endif ! WITH_SECDRIVER_APPARMOR
423

424 425
EXTRA_DIST += $(test_scripts)

426 427 428 429 430 431 432 433 434 435 436 437 438
if WITH_LINUX
check-access: file-access-clean
	VIR_TEST_FILE_ACCESS=1 $(MAKE) $(AM_MAKEFLAGS) check
	$(PERL) check-file-access.pl | sort -u

file-access-clean:
	> test_file_access.txt
endif WITH_LINUX

EXTRA_DIST += \
	check-file-access.pl \
	file_access_whitelist.txt

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
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
459
TESTS_ENVIRONMENT =				\
460
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
461
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
462 463 464
  abs_builddir=$(abs_builddir)			\
  abs_srcdir=$(abs_srcdir)			\
  CONFIG_HEADER="$(lv_abs_top_builddir)/config.h"	\
465
  SHELL="$(SHELL)"				\
466
  LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \
467
  LIBVIRT_AUTOSTART=0				\
468
  LC_ALL=C					\
469
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE)	\
470 471
  $(VG)

472

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

478 479 480
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
481
sockettest_LDADD = $(LDADDS)
482

483
if WITH_XEN
E
Eric Blake 已提交
484
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
485 486
xen_LDADDS += $(LDADDS)

487
xml2sexprtest_SOURCES = \
488
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
489
	testutils.c testutils.h
490
xml2sexprtest_LDADD = $(xen_LDADDS)
491 492

sexpr2xmltest_SOURCES = \
493
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
494
	testutils.c testutils.h
495
sexpr2xmltest_LDADD = $(xen_LDADDS)
496

497
xmconfigtest_SOURCES = \
498
	xmconfigtest.c testutilsxen.c testutilsxen.h \
499
	testutils.c testutils.h
500
xmconfigtest_LDADD = $(xen_LDADDS)
501

502 503
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
504
xencapstest_LDADD = $(xen_LDADDS)
505

506
else ! WITH_XEN
507
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
508
	xencapstest.c \
509
	testutilsxen.c testutilsxen.h
510
endif ! WITH_XEN
511

512 513
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
514 515 516
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
517 518 519 520 521 522 523 524 525 526
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

527 528 529 530 531
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

532
if WITH_QEMU
533

534 535
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

536
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
537
if WITH_NETWORK
E
Eric Blake 已提交
538
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
539
endif WITH_NETWORK
540 541 542
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
543
if WITH_DTRACE_PROBES
544
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
545
endif WITH_DTRACE_PROBES
546

547 548 549 550
libqemutestdriver_la_SOURCES =
libqemutestdriver_la_LDFLAGS = $(QEMULIB_LDFLAGS)
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)

551
qemuxml2argvtest_SOURCES = \
552
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
553
	testutils.c testutils.h
554
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LDADDS) $(LIBXML_LIBS)
555

556 557 558
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
qemuxml2argvmock_la_CFLAGS = $(AM_CFLAGS)
559
qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
560
qemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
561

562 563 564 565 566 567
qemuxml2xmlmock_la_SOURCES = \
	qemuxml2xmlmock.c
qemuxml2xmlmock_la_CFLAGS = $(AM_CFLAGS)
qemuxml2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
qemuxml2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)

568
qemuxml2xmltest_SOURCES = \
569
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
570
	testutils.c testutils.h
571
qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
572 573 574 575

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
576
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
577 578

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
579
qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
580

581 582 583 584 585 586
qemumonitortest_SOURCES = \
	qemumonitortest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h
qemumonitortest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
587

588 589 590 591 592
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
593 594
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
595

596 597 598 599 600
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
601 602
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
603

J
Jiri Denemark 已提交
604 605 606 607 608 609 610 611 612 613 614
qemucapsprobe_SOURCES = \
	qemucapsprobe.c
qemucapsprobe_LDADD = \
	libqemutestdriver.la $(LDADDS)

qemucapsprobemock_la_SOURCES = \
	qemucapsprobemock.c
qemucapsprobemock_la_CFLAGS = $(AM_CFLAGS)
qemucapsprobemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
qemucapsprobemock_la_LIBADD = $(MOCKLIBS_LIBS)

615 616 617 618 619 620 621 622
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)

623 624 625 626
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
	$(NULL)
627
qemucaps2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
628

P
Pavel Hrdina 已提交
629 630 631
qemucaps2xmlmock_la_SOURCES = \
	qemucaps2xmlmock.c
qemucaps2xmlmock_la_CFLAGS = $(AM_CFLAGS)
632
qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
633
qemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
634

P
Peter Krempa 已提交
635 636 637 638 639
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
640
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
P
Peter Krempa 已提交
641

642 643 644 645 646
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
647
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
648

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

663 664
if WITH_LXC

E
Eric Blake 已提交
665
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
666
if WITH_NETWORK
E
Eric Blake 已提交
667
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
668
endif WITH_NETWORK
669
lxc_LDADDS += $(LDADDS)
670 671 672 673

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
674
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
675 676

lxcconf2xmltest_SOURCES = \
677
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
678 679
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
680
else ! WITH_LXC
681
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
682
endif ! WITH_LXC
683

684 685 686 687
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
688
openvzutilstest_LDADD = $(LDADDS)
689
else ! WITH_OPENVZ
690
EXTRA_DIST += openvzutilstest.c
691
endif ! WITH_OPENVZ
692 693
EXTRA_DIST += openvzutilstest.conf

694 695 696 697
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
698
esxutilstest_LDADD = $(LDADDS)
699
else ! WITH_ESX
700
EXTRA_DIST += esxutilstest.c
701
endif ! WITH_ESX
702

Y
Yohan BELLEGUIC 已提交
703 704 705 706 707 708 709 710 711 712
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

713
if WITH_VMX
714 715 716
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
717
vmx2xmltest_LDADD = $(LDADDS)
718 719 720 721

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
722
xml2vmxtest_LDADD = $(LDADDS)
723
else ! WITH_VMX
724
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
725
endif ! WITH_VMX
726

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

743 744 745 746 747 748
bhyveargv2xmlmock_la_SOURCES = \
	bhyveargv2xmlmock.c
bhyveargv2xmlmock_la_CFLAGS = $(AM_CFLAGS)
bhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
bhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)

R
Roman Bogorodskiy 已提交
749
bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
R
Roman Bogorodskiy 已提交
750 751 752
if WITH_STORAGE
bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
R
Roman Bogorodskiy 已提交
753 754 755 756 757
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
758 759 760 761 762

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
763 764 765 766 767

bhyveargv2xmltest_SOURCES = \
	bhyveargv2xmltest.c \
	testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
768
else ! WITH_BHYVE
769 770 771 772 773 774
EXTRA_DIST += \
	bhyvexml2argvtest.c \
	bhyveargv2xmltest.c \
	bhyvexml2xmltest.c \
	bhyvexml2argvmock.c \
	bhyveargv2xmlmock.c
R
Roman Bogorodskiy 已提交
775 776
endif ! WITH_BHYVE

777 778 779 780 781
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
782 783 784 785 786
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

787
if WITH_NETWORK
788 789
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
790
	testutils.c testutils.h
791
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
792 793 794 795 796 797

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

798
else ! WITH_NETWORK
799
EXTRA_DIST += networkxml2conftest.c
800
endif !	WITH_NETWORK
801

802 803 804 805
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
806 807
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
808
else ! WITH_STORAGE_SHEEPDOG
809
EXTRA_DIST += storagebackendsheepdogtest.c
810
endif ! WITH_STORAGE_SHEEPDOG
811

812 813 814 815
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
816

817 818 819 820 821
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
822 823 824 825 826 827

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

J
Ján Tomko 已提交
830 831 832 833 834
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
835 836 837 838 839
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
840

841
if WITH_STORAGE
842 843 844 845
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
846
	$(LIBXML_LIBS) \
847
	../src/libvirt_driver_storage_impl.la $(LDADDS)
J
Ján Tomko 已提交
848

849
else ! WITH_STORAGE
850
EXTRA_DIST += storagevolxml2argvtest.c
851
endif ! WITH_STORAGE
852

853 854 855 856 857
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

858 859 860 861 862
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
863 864 865
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
866
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
867

868 869 870 871 872
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

873 874 875
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
876
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Jiri Denemark 已提交
877 878 879 880
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS) $(GNULIB_LIBS)
endif WITH_QEMU
881

P
Peter Krempa 已提交
882 883 884 885 886
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

887 888 889 890 891
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

892
virconftest_SOURCES = \
893
	virconftest.c testutils.h testutils.c
894
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
895

896 897 898
virhostcputest_SOURCES = \
	virhostcputest.c testutils.h testutils.c
virhostcputest_LDADD = $(LDADDS)
899

900 901 902 903 904 905
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
906 907 908 909 910 911 912
commandhelper_LDADD = \
	$(WARN_CFLAGS) \
	$(NO_INDIRECT_LDFLAGS) \
	$(PROBES_O) \
	../src/libvirt_util.la \
	$(GNULIB_LIBS)

913
commandhelper_LDFLAGS = -static
914

915

916 917 918 919
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

920
vircapstest_SOURCES = \
921 922 923 924 925 926 927 928 929 930
	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
931
vircapstest_LDADD = $(qemu_LDADDS) $(LDADDS)
932

933 934 935 936
vircaps2xmltest_SOURCES = \
	vircaps2xmltest.c testutils.h testutils.c
vircaps2xmltest_LDADD = $(LDADDS)

937 938 939 940 941 942

domaincapsmock_la_SOURCES = domaincapsmock.c
domaincapsmock_la_CFLAGS = $(AM_CFLAGS)
domaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
domaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
943 944 945 946
domaincapstest_SOURCES = \
	domaincapstest.c testutils.h testutils.c
domaincapstest_LDADD = $(LDADDS)

947 948
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
949
domaincapstest_LDADD += $(qemu_LDADDS) $(GNULIB_LIBS)
950 951
endif WITH_QEMU

952 953
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
954
domaincapstest_LDADD += ../src/libvirt_driver_libxl_impl.la $(GNULIB_LIBS)
955 956
endif WITH_LIBXL

957 958
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
959
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
960
virnetmessagetest_LDADD = $(LDADDS)
961

962 963
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
964
virnetsockettest_LDADD = $(LDADDS)
965

966 967
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
968
	testutils.h testutils.c
969 970
virnetdaemontest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
virnetdaemontest_LDADD = $(LDADDS)
971

972 973 974 975 976 977
virnetdaemonmock_la_SOURCES = \
	virnetdaemonmock.c
virnetdaemonmock_la_CFLAGS = $(AM_CFLAGS)
virnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)

978 979 980
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
981
virnetserverclienttest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
982 983 984 985 986
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
virnetserverclientmock_la_CFLAGS = $(AM_CFLAGS)
987
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
988
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
989

990
if WITH_GNUTLS
991
virnettlscontexttest_SOURCES = \
992 993 994
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
995
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
996 997 998 999
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1000
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
1001 1002 1003
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
1004 1005
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
1006
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
1007
EXTRA_DIST += pkix_asn1_tab.c
1008 1009
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
1010
EXTRA_DIST += \
1011 1012 1013
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
1014
endif ! WITH_GNUTLS
1015

1016 1017
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1018
virtimetest_LDADD = $(LDADDS)
1019

J
Ján Tomko 已提交
1020 1021
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1022
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1023

1024 1025 1026 1027
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1028 1029
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1030 1031 1032 1033 1034 1035 1036
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)
1037

1038 1039 1040
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1041
if WITH_SELINUX
1042
viridentitytest_LDADD += $(SELINUX_LIBS)
1043 1044 1045
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1046

J
Ján Tomko 已提交
1047 1048 1049 1050
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1051 1052 1053 1054
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1055 1056 1057 1058
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1059 1060 1061 1062
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1063 1064 1065 1066
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1067
virportallocatormock_la_SOURCES = \
1068
	virportallocatormock.c
1069 1070 1071
virportallocatormock_la_CFLAGS = $(AM_CFLAGS)
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1072

1073 1074 1075 1076 1077 1078 1079
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
1080
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1081
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1082

1083 1084 1085 1086
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1087 1088 1089 1090
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1091 1092 1093 1094 1095 1096 1097
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
1098
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1099
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1100

J
John Ferlan 已提交
1101 1102 1103 1104 1105 1106
virrandommock_la_SOURCES = \
	virrandommock.c
virrandommock_la_CFLAGS = $(AM_CFLAGS)
virrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virrandommock_la_LIBADD = $(MOCKLIBS_LIBS)

1107 1108 1109 1110 1111
virhostcpumock_la_SOURCES = \
	virhostcpumock.c
virhostcpumock_la_CFLAGS = $(AM_CFLAGS)
virhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1112

1113
if WITH_NSS
M
Michal Privoznik 已提交
1114 1115 1116 1117 1118 1119 1120 1121 1122
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

1123 1124 1125 1126 1127 1128 1129 1130 1131 1132
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST	\
	$(AM_CFLAGS)	\
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
	$(LDADDS)	\
	../tools/nss/libnss_libvirt_guest_impl.la

M
Michal Privoznik 已提交
1133 1134 1135 1136 1137 1138
nssmock_la_SOURCES = \
	nssmock.c
nssmock_la_CFLAGS = $(AM_CFLAGS)
nssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
nssmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1139 1140 1141 1142 1143 1144 1145 1146 1147
## 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)

1148 1149 1150 1151 1152 1153 1154
nssguestlinktest_SOURCES = nsslinktest.c
nssguestlinktest_CFLAGS = 	\
	-DLIBVIRT_NSS_GUEST	\
	$(AM_CFLAGS)		\
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1155 1156 1157
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1158

1159
if WITH_YAJL
1160 1161 1162 1163 1164 1165 1166 1167
virmacmapmock_la_SOURCES = \
	virmacmapmock.c
virmacmapmock_la_CFLAGS = $(AM_CFLAGS)
virmacmapmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virmacmapmock_la_LIBADD = $(MOCKLIBS_LIBS)

virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
1168
virmacmaptest_CLFAGS = $(AM_CFLAGS)
1169 1170
virmacmaptest_LDADD = $(LDADDS)

1171 1172 1173 1174 1175 1176
test_libraries += virmacmapmock.la
test_programs += virmacmaptest
else ! WITH_YAJL
EXTRA_DIST += virmacmapmock.c virmacmaptest.c
endif ! WITH_YAJL

M
Michal Privoznik 已提交
1177 1178 1179 1180 1181 1182 1183 1184
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)
1185
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1186
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1187

1188 1189 1190 1191 1192
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_CFLAGS = $(AM_CFLAGS)
virrotatingfiletest_LDADD = $(LDADDS)

1193 1194 1195 1196 1197
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1198 1199 1200 1201
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1202 1203
virusbmock_la_SOURCES = virusbmock.c
virusbmock_la_CFLAGS = $(AM_CFLAGS)
1204
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1205
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS)
1206 1207 1208 1209

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
virnetdevbandwidthmock_la_CFLAGS = $(AM_CFLAGS)
1210
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1211
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1212

1213 1214 1215 1216
virtestmock_la_SOURCES = \
	virtestmock.c
virtestmock_la_CFLAGS = $(AM_CFLAGS)
virtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1217 1218
virtestmock_la_LIBADD = \
	$(MOCKLIBS_LIBS) \
1219
	$(PROBES_O) \
1220
	../src/libvirt_util.la
1221
else ! WITH_LINUX
1222
	EXTRA_DIST += virusbtest.c virusbmock.c \
1223 1224
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1225 1226
endif ! WITH_LINUX

1227 1228 1229 1230
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1231
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1232

1233 1234 1235 1236 1237
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1238

1239 1240 1241 1242 1243
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1244 1245
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1246
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1247
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1248

1249
else ! WITH_DBUS
1250
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1251
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1252

1253 1254
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1255
viruritest_LDADD = $(LDADDS)
1256

1257 1258
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1259
virkeyfiletest_LDADD = $(LDADDS)
1260

1261 1262 1263 1264
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1265 1266
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1267
virauthconfigtest_LDADD = $(LDADDS)
1268

1269
seclabeltest_SOURCES = \
1270
	seclabeltest.c testutils.h testutils.c
1271
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1272

1273
if WITH_SECDRIVER_SELINUX
1274
if WITH_ATTR
1275 1276
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1277
else ! WITH_TESTS
1278
check_LTLIBRARIES += libsecurityselinuxhelper.la
1279
endif ! WITH_TESTS
1280 1281 1282

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1283
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1284 1285 1286

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1287
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1288 1289
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1290 1291 1292 1293 1294

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1295
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(LDADDS) $(SELINUX_LIBS)
1296 1297
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1298 1299 1300
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1301 1302
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1303

1304 1305 1306 1307
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1308 1309 1310
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1311

1312
viratomictest_SOURCES = \
L
Laine Stump 已提交
1313
	viratomictest.c testutils.h testutils.c
1314 1315
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1316 1317 1318 1319
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1320 1321 1322 1323
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1324 1325 1326 1327
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

1328 1329
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1330
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1331 1332
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1333
jsontest_SOURCES = \
1334
	jsontest.c testutils.h testutils.c
1335 1336
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
1337 1338 1339 1340
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1341 1342 1343 1344
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1345
endif WITH_DRIVER_MODULES
1346

1347 1348
if WITH_LIBVIRTD
eventtest_SOURCES = \
1349
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1350
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1351
endif WITH_LIBVIRTD
1352

1353 1354
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1355
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1356 1357 1358

shunloadtest_SOURCES = \
	shunloadtest.c
1359
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1360 1361
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1362 1363 1364 1365
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1366 1367 1368 1369
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1370 1371 1372 1373
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1374 1375 1376 1377 1378
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1379 1380 1381 1382 1383
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1384
if WITH_LINUX
O
Osier Yang 已提交
1385 1386 1387 1388
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1389 1390 1391 1392
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1393 1394
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1395
EXTRA_DIST += scsihosttest.c
1396 1397
endif  ! WITH_LINUX

O
Osier Yang 已提交
1398 1399 1400 1401 1402 1403 1404 1405 1406
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1407 1408 1409 1410 1411 1412
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1413
objectlocking_SOURCES = objectlocking.ml
1414 1415 1416 1417

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

1418
objectlocking: objectlocking.cmx objectlocking-files.txt
1419 1420
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1421

1422
objectlocking-files.txt:
1423 1424
	find $(top_builddir)/src/ -name '*.i' > $@

1425
else ! WITH_CIL
1426
EXTRA_DIST += objectlocking.ml
1427
endif ! WITH_CIL
1428

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