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

160
test_helpers = commandhelper ssh virconftest
161
test_programs = virshtest sockettest \
162
	virhostcputest virbuftest \
163
	commandtest seclabeltest \
E
Eric Blake 已提交
164 165
	virhashtest \
	viratomictest \
166
	utiltest shunloadtest \
167
	virtimetest viruritest virkeyfiletest \
168
	viralloctest \
H
Hu Tao 已提交
169
	virauthconfigtest \
170 171
	virbitmaptest \
	vircgrouptest \
172
	vircryptotest \
J
John Ferlan 已提交
173
	virrandomtest \
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 \
J
Ján Tomko 已提交
183
	virschematest \
184
	virstringtest \
185
	virportallocatortest \
V
Viktor Mihajlovski 已提交
186
	sysinfotest \
187
	virkmodtest \
188
	vircapstest \
M
Michal Privoznik 已提交
189
	domaincapstest \
190
	domainconftest \
191
	virhostdevtest \
192
	vircaps2xmltest \
M
Michal Privoznik 已提交
193
	virnetdevtest \
194
	virtypedparamtest \
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
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
J
Jiri Denemark 已提交
260
test_helpers += qemucapsprobe
261
endif WITH_QEMU
262

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

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

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

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

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

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

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

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

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

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

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

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

315
test_programs += nwfilterxml2xmltest
316

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

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

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

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

334 335 336 337 338
if WITH_NSS
test_helpers += nsslinktest
test_programs += nsstest
endif WITH_NSS

339
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
340

341
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
342

343
test_programs += interfacexml2xmltest
344

345
test_programs += cputest
346

P
Peter Krempa 已提交
347 348
test_programs += metadatatest

J
Ján Tomko 已提交
349 350
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
351 352
test_programs += genericxml2xmltest

353
if WITH_LINUX
354 355 356
test_programs += virusbtest \
	virnetdevbandwidthtest \
	$(NULL)
357 358
endif WITH_LINUX

J
Ján Tomko 已提交
359
test_scripts =
360
libvirtd_test_scripts =		\
J
Jim Meyering 已提交
361 362
	libvirtd-fail			\
	libvirtd-pool			\
363
	virconftest.sh			\
364 365 366
	virsh-cpuset			\
	virsh-define-dev-segfault	\
	virsh-int-overflow		\
367
	virsh-optparse			\
368 369
	virsh-read-bufsiz		\
	virsh-read-non-seekable		\
370
	virsh-schedinfo			\
371
	virsh-start			\
372 373
	virsh-synopsis			\
	virsh-undefine			\
374 375
	virsh-uriprecedence		\
	virsh-vcpupin			\
376
	$(NULL)
377

378 379 380
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

381 382 383
test_programs += 			\
	eventtest			\
	libvirtdconftest
384
else ! WITH_LIBVIRTD
385
EXTRA_DIST += $(libvirtd_test_scripts)
386
endif ! WITH_LIBVIRTD
387

388 389
test_programs += objecteventtest

J
Jamie Strandboge 已提交
390 391
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
392
else ! WITH_SECDRIVER_APPARMOR
393
EXTRA_DIST += virt-aa-helper-test
394
endif ! WITH_SECDRIVER_APPARMOR
395

396 397
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
398
test_libraries = libshunload.la \
399
		virportallocatormock.la \
400
		virnetdaemonmock.la \
401
		virnetserverclientmock.la \
402
		vircgroupmock.la \
M
Michal Privoznik 已提交
403
		virpcimock.la \
M
Michal Privoznik 已提交
404
		virnetdevmock.la \
J
John Ferlan 已提交
405
		virrandommock.la \
406
		virhostcpumock.la \
M
Michal Privoznik 已提交
407
		nssmock.la \
D
Daniel P. Berrange 已提交
408
		$(NULL)
409
if WITH_QEMU
410
test_libraries += libqemumonitortestutils.la \
411
		libqemutestdriver.la \
412
		qemuxml2argvmock.la \
P
Pavel Hrdina 已提交
413
		qemucaps2xmlmock.la \
J
Jiri Denemark 已提交
414
		qemucapsprobemock.la \
415
		$(NULL)
416
endif WITH_QEMU
417

R
Roman Bogorodskiy 已提交
418 419 420 421
if WITH_BHYVE
test_libraries += bhyvexml2argvmock.la
endif WITH_BHYVE

422
if WITH_DBUS
423
test_libraries += \
424
		virdbusmock.la
425
endif WITH_DBUS
426

427
if WITH_LINUX
428 429
test_libraries += virusbmock.la \
		virnetdevbandwidthmock.la \
430
		virtestmock.la \
431
		$(NULL)
432 433
endif WITH_LINUX

434 435 436 437 438 439 440 441 442 443 444 445 446
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

447 448
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
449
noinst_LTLIBRARIES = $(test_libraries)
450
else ! WITH_TESTS
451
check_PROGRAMS = $(test_programs) $(test_helpers)
452
check_LTLIBRARIES = $(test_libraries)
453
endif ! WITH_TESTS
454

455 456
TESTS = $(test_programs) \
	$(test_scripts)
457

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

464
lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd)
465

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

480

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

486 487 488
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
489
sockettest_LDADD = $(LDADDS)
490

491
if WITH_XEN
E
Eric Blake 已提交
492
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
493 494
xen_LDADDS += $(LDADDS)

495
xml2sexprtest_SOURCES = \
496
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
497
	testutils.c testutils.h
498
xml2sexprtest_LDADD = $(xen_LDADDS)
499 500

sexpr2xmltest_SOURCES = \
501
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
502
	testutils.c testutils.h
503
sexpr2xmltest_LDADD = $(xen_LDADDS)
504

505
xmconfigtest_SOURCES = \
506
	xmconfigtest.c testutilsxen.c testutilsxen.h \
507
	testutils.c testutils.h
508
xmconfigtest_LDADD = $(xen_LDADDS)
509

510 511
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
512
xencapstest_LDADD = $(xen_LDADDS)
513

514
else ! WITH_XEN
515
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
516
	xencapstest.c \
517
	testutilsxen.c testutilsxen.h
518
endif ! WITH_XEN
519

520 521
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
522 523 524
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
525 526 527 528 529 530 531 532 533 534
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 556 557 558
libqemutestdriver_la_SOURCES =
libqemutestdriver_la_LDFLAGS = $(QEMULIB_LDFLAGS)
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)

559
qemuxml2argvtest_SOURCES = \
560
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
561
	testutils.c testutils.h
562
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LDADDS) $(LIBXML_LIBS)
563

564 565 566
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
qemuxml2argvmock_la_CFLAGS = $(AM_CFLAGS)
567
qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
568
qemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
569

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

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

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
581
qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
582

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

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

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

J
Jiri Denemark 已提交
606 607 608 609 610 611 612 613 614 615 616
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)

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

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

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

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

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

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

665 666
if WITH_LXC

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

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
676
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
677 678

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

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

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

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

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

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

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

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

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
759
else ! WITH_BHYVE
760
EXTRA_DIST += bhyvexml2argvtest.c bhyvexml2xmltest.c bhyvexml2argvmock.c
R
Roman Bogorodskiy 已提交
761 762
endif ! WITH_BHYVE

763 764 765 766 767
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
768 769 770 771 772
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

773
if WITH_NETWORK
774 775
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
776
	testutils.c testutils.h
777
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
778 779 780 781 782 783

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

784
else ! WITH_NETWORK
785
EXTRA_DIST += networkxml2conftest.c
786
endif !	WITH_NETWORK
787

788 789 790 791
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
792 793
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
794
else ! WITH_STORAGE_SHEEPDOG
795
EXTRA_DIST += storagebackendsheepdogtest.c
796
endif ! WITH_STORAGE_SHEEPDOG
797

798 799 800 801
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
802

803 804 805 806 807
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
808 809 810 811 812 813

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

J
Ján Tomko 已提交
816 817 818 819 820
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
821 822 823 824 825
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
826

827
if WITH_STORAGE
828 829 830 831
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
832
	$(LIBXML_LIBS) \
833
	../src/libvirt_driver_storage_impl.la $(LDADDS)
J
Ján Tomko 已提交
834

835
else ! WITH_STORAGE
836
EXTRA_DIST += storagevolxml2argvtest.c
837
endif ! WITH_STORAGE
838

839 840 841 842 843
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

844 845 846 847 848
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
849 850 851
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
852
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
853

854 855 856 857 858
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

859 860 861
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
862
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Jiri Denemark 已提交
863 864 865 866
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS) $(GNULIB_LIBS)
endif WITH_QEMU
867

P
Peter Krempa 已提交
868 869 870 871 872
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

873 874 875 876 877
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

878 879 880
virconftest_SOURCES = \
	virconftest.c
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
881

882 883 884
virhostcputest_SOURCES = \
	virhostcputest.c testutils.h testutils.c
virhostcputest_LDADD = $(LDADDS)
885

886 887 888 889 890 891
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
892 893 894 895 896 897 898
commandhelper_LDADD = \
	$(WARN_CFLAGS) \
	$(NO_INDIRECT_LDFLAGS) \
	$(PROBES_O) \
	../src/libvirt_util.la \
	$(GNULIB_LIBS)

899
commandhelper_LDFLAGS = -static
900

901

902 903 904 905
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

906
vircapstest_SOURCES = \
907 908 909 910 911 912 913 914 915 916
	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
917
vircapstest_LDADD = $(qemu_LDADDS) $(LDADDS)
918

919 920 921 922
vircaps2xmltest_SOURCES = \
	vircaps2xmltest.c testutils.h testutils.c
vircaps2xmltest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
923 924 925 926
domaincapstest_SOURCES = \
	domaincapstest.c testutils.h testutils.c
domaincapstest_LDADD = $(LDADDS)

927 928
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
929
domaincapstest_LDADD += $(qemu_LDADDS) $(GNULIB_LIBS)
930 931
endif WITH_QEMU

932 933 934 935 936
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
domaincapstest_LDADD += ../src/libvirt_driver_libxl_impl.la
endif WITH_LIBXL

937 938 939
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
940 941
	$(NULL)
libvirtdconftest_LDADD = ../daemon/libvirtd_conf.la $(LDADDS)
942
else ! WITH_LIBVIRTD
943
EXTRA_DIST += libvirtdconftest.c
944
endif ! WITH_LIBVIRTD
945

946 947
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
948
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
949
virnetmessagetest_LDADD = $(LDADDS)
950

951 952
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
953
virnetsockettest_LDADD = $(LDADDS)
954

955 956
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
957
	testutils.h testutils.c
958 959
virnetdaemontest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
virnetdaemontest_LDADD = $(LDADDS)
960

961 962 963 964 965 966
virnetdaemonmock_la_SOURCES = \
	virnetdaemonmock.c
virnetdaemonmock_la_CFLAGS = $(AM_CFLAGS)
virnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)

967 968 969
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
970
virnetserverclienttest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
971 972 973 974 975
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
virnetserverclientmock_la_CFLAGS = $(AM_CFLAGS)
976
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
977
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
978

979
if WITH_GNUTLS
980
virnettlscontexttest_SOURCES = \
981 982 983
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
984
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
985 986 987 988
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
989
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
990 991 992
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
993 994
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
995
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
996
EXTRA_DIST += pkix_asn1_tab.c
997 998
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
999
EXTRA_DIST += \
1000 1001 1002
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
1003
endif ! WITH_GNUTLS
1004

1005 1006
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1007
virtimetest_LDADD = $(LDADDS)
1008

J
Ján Tomko 已提交
1009 1010
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1011
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1012

1013 1014 1015 1016
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1017 1018
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1019 1020 1021 1022 1023 1024 1025
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)
1026

1027 1028 1029
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1030
if WITH_SELINUX
1031
viridentitytest_LDADD += $(SELINUX_LIBS)
1032 1033 1034
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1035

J
Ján Tomko 已提交
1036 1037 1038 1039
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1040 1041 1042 1043
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1044 1045 1046 1047
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1048 1049 1050 1051
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1052 1053 1054 1055
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1056
virportallocatormock_la_SOURCES = \
1057
	virportallocatormock.c
1058 1059 1060
virportallocatormock_la_CFLAGS = $(AM_CFLAGS)
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1061

1062 1063 1064 1065 1066 1067 1068
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
1069
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1070
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1071

1072 1073 1074 1075
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

J
John Ferlan 已提交
1076 1077 1078 1079
virrandomtest_SOURCES = \
	virrandomtest.c testutils.h testutils.c
virrandomtest_LDADD = $(LDADDS)

1080 1081 1082 1083
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1084 1085 1086 1087 1088 1089 1090
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
1091
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1092
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1093

J
John Ferlan 已提交
1094 1095 1096 1097 1098 1099
virrandommock_la_SOURCES = \
	virrandommock.c
virrandommock_la_CFLAGS = $(AM_CFLAGS)
virrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virrandommock_la_LIBADD = $(MOCKLIBS_LIBS)

1100 1101 1102 1103 1104
virhostcpumock_la_SOURCES = \
	virhostcpumock.c
virhostcpumock_la_CFLAGS = $(AM_CFLAGS)
virhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1105

M
Michal Privoznik 已提交
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120
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 已提交
1121 1122 1123 1124 1125 1126 1127 1128 1129
## 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 已提交
1130 1131 1132 1133 1134 1135 1136 1137
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)
1138
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1139
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1140

1141 1142 1143 1144 1145
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_CFLAGS = $(AM_CFLAGS)
virrotatingfiletest_LDADD = $(LDADDS)

1146 1147 1148 1149 1150
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1151 1152 1153 1154
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1155 1156
virusbmock_la_SOURCES = virusbmock.c
virusbmock_la_CFLAGS = $(AM_CFLAGS)
1157
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1158
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS)
1159 1160 1161 1162

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
virnetdevbandwidthmock_la_CFLAGS = $(AM_CFLAGS)
1163
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1164
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1165

1166 1167 1168 1169
virtestmock_la_SOURCES = \
	virtestmock.c
virtestmock_la_CFLAGS = $(AM_CFLAGS)
virtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1170 1171
virtestmock_la_LIBADD = \
	$(MOCKLIBS_LIBS) \
1172
	$(PROBES_O) \
1173
	../src/libvirt_util.la
1174
else ! WITH_LINUX
1175
	EXTRA_DIST += virusbtest.c virusbmock.c \
1176 1177
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1178 1179
endif ! WITH_LINUX

1180 1181 1182 1183
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1184
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1185

1186 1187 1188 1189 1190
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1191

1192 1193 1194 1195 1196
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1197 1198
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1199
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1200
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1201

1202
else ! WITH_DBUS
1203
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1204
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1205

1206 1207
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1208
viruritest_LDADD = $(LDADDS)
1209

1210 1211
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1212
virkeyfiletest_LDADD = $(LDADDS)
1213

1214 1215 1216 1217
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1218 1219
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1220
virauthconfigtest_LDADD = $(LDADDS)
1221

1222
seclabeltest_SOURCES = \
1223
	seclabeltest.c testutils.h testutils.c
1224
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1225

1226
if WITH_SECDRIVER_SELINUX
1227
if WITH_ATTR
1228 1229
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1230
else ! WITH_TESTS
1231
check_LTLIBRARIES += libsecurityselinuxhelper.la
1232
endif ! WITH_TESTS
1233 1234 1235

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1236
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1237 1238 1239

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1240
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1241 1242
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1243 1244 1245 1246 1247

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1248
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(LDADDS) $(SELINUX_LIBS)
1249 1250
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1251 1252 1253
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1254 1255
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1256

1257 1258 1259 1260
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1261 1262 1263
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1264

1265
viratomictest_SOURCES = \
L
Laine Stump 已提交
1266
	viratomictest.c testutils.h testutils.c
1267 1268
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1269 1270 1271 1272
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1273 1274 1275 1276
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1277 1278 1279 1280
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

1281 1282
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1283
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1284 1285
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1286
jsontest_SOURCES = \
1287
	jsontest.c testutils.h testutils.c
1288 1289
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
1290 1291 1292 1293
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1294 1295 1296 1297
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1298
endif WITH_DRIVER_MODULES
1299

1300 1301
if WITH_LIBVIRTD
eventtest_SOURCES = \
1302
	eventtest.c testutils.h testutils.c
1303
eventtest_LDADD = -lrt $(LDADDS)
1304
endif WITH_LIBVIRTD
1305

1306 1307
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1308
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1309 1310 1311

shunloadtest_SOURCES = \
	shunloadtest.c
1312
shunloadtest_LDADD = $(LIB_PTHREAD)
1313 1314
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1315 1316 1317 1318
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1319 1320 1321 1322
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1323 1324 1325 1326
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1327 1328 1329 1330 1331
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1332 1333 1334 1335 1336
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1337
if WITH_LINUX
O
Osier Yang 已提交
1338 1339 1340 1341
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1342 1343 1344 1345
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1346 1347
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1348
EXTRA_DIST += scsihosttest.c
1349 1350
endif  ! WITH_LINUX

O
Osier Yang 已提交
1351 1352 1353 1354 1355 1356 1357 1358 1359
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1360 1361 1362 1363 1364 1365
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1366
objectlocking_SOURCES = objectlocking.ml
1367 1368 1369 1370

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

1371
objectlocking: objectlocking.cmx objectlocking-files.txt
1372 1373
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1374

1375
objectlocking-files.txt:
1376 1377
	find $(top_builddir)/src/ -name '*.i' > $@

1378
else ! WITH_CIL
1379
EXTRA_DIST += objectlocking.ml
1380
endif ! WITH_CIL
1381

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