Makefile.am 36.8 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 37
WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)

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

53 54 55
AM_LDFLAGS = \
	-export-dynamic

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

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

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

70
PROBES_O =
71
if WITH_DTRACE_PROBES
72
PROBES_O += ../src/libvirt_probes.lo
73
endif WITH_DTRACE_PROBES
74

75 76 77
GNULIB_LIBS = \
       ../gnulib/lib/libgnu.la

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

85 86 87
MOCKLIBS_LIBS = \
	$(GNULIB_LIBS)

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

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

204 205 206 207 208 209 210 211 212 213 214 215
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 已提交
216 217 218 219
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
220
	virnetdaemontest \
E
Eric Blake 已提交
221 222 223 224 225 226 227
	virnetserverclienttest \
	$(NULL)
if WITH_GNUTLS
test_programs += virnettlscontexttest virnettlssessiontest
endif WITH_GNUTLS
endif WITH_REMOTE

228 229
if WITH_LINUX
test_programs += fchosttest
230
test_programs += scsihosttest
231
test_programs += vircaps2xmltest
232 233
test_libraries += virusbmock.la \
	virnetdevbandwidthmock.la \
234
	virnumamock.la \
235 236
	virtestmock.la \
	$(NULL)
237 238
endif WITH_LINUX

239 240 241 242
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

243
if WITH_DBUS
244
test_programs += virdbustest \
245 246
                 virsystemdtest \
                 $(NULL)
247
test_libraries += virdbusmock.la
248 249 250
if WITH_POLKIT1
test_programs += virpolkittest
endif WITH_POLKIT1
251
endif WITH_DBUS
252

253
if WITH_SECDRIVER_SELINUX
254
if WITH_ATTR
255 256
test_programs += securityselinuxtest \
                 viridentitytest
257
if WITH_QEMU
258
test_programs += securityselinuxlabeltest
259 260 261
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
262

263 264
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
265
endif WITH_DRIVER_MODULES
266

267 268 269
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
270

271
if WITH_XEN
272
test_programs += xml2sexprtest sexpr2xmltest \
273
	xmconfigtest xencapstest
274
endif WITH_XEN
275 276 277 278 279

if WITH_LIBXL
test_programs += xlconfigtest
endif WITH_LIBXL

280
if WITH_QEMU
J
Jiri Denemark 已提交
281
test_programs += qemuxml2argvtest qemuxml2xmltest \
282
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
283
	qemumonitortest qemumonitorjsontest qemuhotplugtest \
284
	qemuagenttest qemucapabilitiestest qemucaps2xmltest \
285
	qemumemlocktest \
286
	qemucommandutiltest
J
Jiri Denemark 已提交
287
test_helpers += qemucapsprobe
288 289 290 291 292
test_libraries += libqemumonitortestutils.la \
		libqemutestdriver.la \
		qemuxml2argvmock.la \
		qemucaps2xmlmock.la \
		qemucapsprobemock.la \
293
		qemucpumock.la \
294
		$(NULL)
295
endif WITH_QEMU
296

297
if WITH_LXC
298
test_programs += lxcxml2xmltest lxcconf2xmltest
299
endif WITH_LXC
300

301
if WITH_OPENVZ
302
test_programs += openvzutilstest
303
endif WITH_OPENVZ
304

305
if WITH_ESX
306
test_programs += esxutilstest
307
endif WITH_ESX
308

Y
Yohan BELLEGUIC 已提交
309 310 311 312
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

313
if WITH_VMX
314
test_programs += vmx2xmltest xml2vmxtest
315
endif WITH_VMX
316

317 318 319 320
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
321
if WITH_BHYVE
322
test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest
323
test_libraries += bhyvexml2argvmock.la bhyveargv2xmlmock.la
R
Roman Bogorodskiy 已提交
324 325
endif WITH_BHYVE

326
if WITH_CIL
327
test_programs += objectlocking
328
endif WITH_CIL
329

330
if WITH_YAJL
331
test_programs += jsontest
332
endif WITH_YAJL
333

334 335 336 337
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
		$(NULL)
338

339
if WITH_NETWORK
340 341 342 343
test_programs += \
		networkxml2conftest \
		networkxml2firewalltest \
		$(NULL)
344
endif WITH_NETWORK
345

346 347
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
348
endif WITH_STORAGE_SHEEPDOG
349

350
test_programs += nwfilterxml2xmltest
351

352 353
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
354
test_programs += nwfilterxml2firewalltest
355 356
endif WITH_NWFILTER

357
if WITH_STORAGE
358
test_programs += storagevolxml2argvtest
359
test_programs += virstorageutiltest
360
endif WITH_STORAGE
361

362 363
if WITH_STORAGE_FS
test_programs += virstoragetest
364
endif WITH_STORAGE_FS
365

O
Osier Yang 已提交
366 367 368 369
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

370
if WITH_NSS
371 372
test_helpers += nsslinktest nssguestlinktest
test_programs += nsstest nssguesttest
373
test_libraries += nssmock.la
374 375
endif WITH_NSS

376
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
377

378
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
379

380
test_programs += interfacexml2xmltest
381

382
test_programs += cputest
383

P
Peter Krempa 已提交
384 385
test_programs += metadatatest

J
Ján Tomko 已提交
386 387
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
388 389
test_programs += genericxml2xmltest

390
if WITH_LINUX
391 392 393
test_programs += virusbtest \
	virnetdevbandwidthtest \
	$(NULL)
394 395
endif WITH_LINUX

J
Ján Tomko 已提交
396
test_scripts =
397
libvirtd_test_scripts =		\
J
Jim Meyering 已提交
398 399
	libvirtd-fail			\
	libvirtd-pool			\
400 401 402
	virsh-cpuset			\
	virsh-define-dev-segfault	\
	virsh-int-overflow		\
403
	virsh-optparse			\
404 405
	virsh-read-bufsiz		\
	virsh-read-non-seekable		\
406
	virsh-schedinfo			\
J
Ján Tomko 已提交
407
	virsh-self-test			\
M
Michal Privoznik 已提交
408
	virt-admin-self-test			\
409
	virsh-start			\
410
	virsh-undefine			\
411 412
	virsh-uriprecedence		\
	virsh-vcpupin			\
413
	$(NULL)
414

415 416 417
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

418
test_programs += 			\
419
	eventtest
420
else ! WITH_LIBVIRTD
421
EXTRA_DIST += $(libvirtd_test_scripts)
422
endif ! WITH_LIBVIRTD
423

424 425
test_programs += objecteventtest

J
Jamie Strandboge 已提交
426 427
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
428
else ! WITH_SECDRIVER_APPARMOR
429
EXTRA_DIST += virt-aa-helper-test
430
endif ! WITH_SECDRIVER_APPARMOR
431

432 433
EXTRA_DIST += $(test_scripts)

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 --trace-children=yes \
	--trace-children-skip="*/tools/virsh","*/tests/commandhelper" \
483
	--suppressions=$(srcdir)/.valgrind.supp
484
valgrind:
485
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
486

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

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

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

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

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

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

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

521 522
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
523 524 525
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
526 527 528 529 530 531 532 533 534 535
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

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

541
if WITH_QEMU
542

543 544
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

556 557 558 559
libqemutestdriver_la_SOURCES =
libqemutestdriver_la_LDFLAGS = $(QEMULIB_LDFLAGS)
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)

560 561 562 563 564 565
qemucpumock_la_SOURCES = \
	qemucpumock.c
qemucpumock_la_CFLAGS = $(AM_CFLAGS)
qemucpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
qemucpumock_la_LIBADD = $(MOCKLIBS_LIBS)

566
qemuxml2argvtest_SOURCES = \
567
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
568
	testutils.c testutils.h
569
qemuxml2argvtest_LDADD = libqemutestdriver.la $(LDADDS) $(LIBXML_LIBS)
570

571 572 573
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
qemuxml2argvmock_la_CFLAGS = $(AM_CFLAGS)
574
qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
575
qemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
576

577
qemuxml2xmltest_SOURCES = \
578
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
579
	testutils.c testutils.h
580
qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
581 582 583 584

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
585
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
586 587

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
588
qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
589

590 591 592 593 594 595
qemumonitortest_SOURCES = \
	qemumonitortest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h
qemumonitortest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
596

597 598 599 600 601
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
602 603
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
604

605 606 607 608 609
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
610 611
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
612

J
Jiri Denemark 已提交
613 614 615 616 617 618 619 620 621 622 623
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)

624 625 626 627 628 629 630 631
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)

632 633 634 635
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
	$(NULL)
636
qemucaps2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
637

P
Pavel Hrdina 已提交
638 639 640
qemucaps2xmlmock_la_SOURCES = \
	qemucaps2xmlmock.c
qemucaps2xmlmock_la_CFLAGS = $(AM_CFLAGS)
641
qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
642
qemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
643

P
Peter Krempa 已提交
644 645 646 647 648
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
649
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
P
Peter Krempa 已提交
650

651 652 653 654 655
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
656
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
657

658 659 660
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
661
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
662 663 664 665 666 667

qemumemlocktest_SOURCES = \
	qemumemlocktest.c \
	testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemumemlocktest_LDADD = $(qemu_LDADDS) $(LDADDS)
668
else ! WITH_QEMU
669
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
J
Jiri Denemark 已提交
670
	qemuhelptest.c domainsnapshotxml2xmltest.c \
671
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
672
	qemumonitorjsontest.c qemuhotplugtest.c \
673
	qemuagenttest.c qemucapabilitiestest.c \
674
	qemucaps2xmltest.c qemucommandutiltest.c \
675
	qemumemlocktest.c \
676
	$(QEMUMONITORTESTUTILS_SOURCES)
677
endif ! WITH_QEMU
678

679 680
if WITH_LXC

E
Eric Blake 已提交
681
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
682
if WITH_NETWORK
E
Eric Blake 已提交
683
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
684
endif WITH_NETWORK
685
lxc_LDADDS += $(LDADDS)
686 687 688 689

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
690
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
691 692

lxcconf2xmltest_SOURCES = \
693
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
694 695
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
696
else ! WITH_LXC
697
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
698
endif ! WITH_LXC
699

700 701 702 703
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
704
openvzutilstest_LDADD = $(LDADDS)
705
else ! WITH_OPENVZ
706
EXTRA_DIST += openvzutilstest.c
707
endif ! WITH_OPENVZ
708 709
EXTRA_DIST += openvzutilstest.conf

710 711 712 713
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
714
esxutilstest_LDADD = $(LDADDS)
715
else ! WITH_ESX
716
EXTRA_DIST += esxutilstest.c
717
endif ! WITH_ESX
718

Y
Yohan BELLEGUIC 已提交
719 720 721 722 723 724 725 726 727 728
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

729
if WITH_VMX
730 731 732
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
733
vmx2xmltest_LDADD = $(LDADDS)
734 735 736 737

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
738
xml2vmxtest_LDADD = $(LDADDS)
739
else ! WITH_VMX
740
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
741
endif ! WITH_VMX
742

743 744 745 746 747 748 749 750 751
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 已提交
752 753 754 755
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
bhyvexml2argvmock_la_CFLAGS = $(AM_CFLAGS)
756
bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
757
bhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
758

759 760 761 762 763 764
bhyveargv2xmlmock_la_SOURCES = \
	bhyveargv2xmlmock.c
bhyveargv2xmlmock_la_CFLAGS = $(AM_CFLAGS)
bhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
bhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)

R
Roman Bogorodskiy 已提交
765
bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
R
Roman Bogorodskiy 已提交
766 767 768
if WITH_STORAGE
bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
R
Roman Bogorodskiy 已提交
769 770 771 772 773
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
774 775 776 777 778

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
779 780 781 782 783

bhyveargv2xmltest_SOURCES = \
	bhyveargv2xmltest.c \
	testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
784
else ! WITH_BHYVE
785 786 787 788 789 790
EXTRA_DIST += \
	bhyvexml2argvtest.c \
	bhyveargv2xmltest.c \
	bhyvexml2xmltest.c \
	bhyvexml2argvmock.c \
	bhyveargv2xmlmock.c
R
Roman Bogorodskiy 已提交
791 792
endif ! WITH_BHYVE

793 794 795 796 797
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
798 799 800 801 802
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

803
if WITH_NETWORK
804 805
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
806
	testutils.c testutils.h
807
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
808 809 810 811 812 813

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

814
else ! WITH_NETWORK
815
EXTRA_DIST += networkxml2conftest.c
816
endif !	WITH_NETWORK
817

818 819 820 821
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
822
storagebackendsheepdogtest_LDADD = \
823 824 825
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_storage_backend_sheepdog_priv.la \
	$(LDADDS)
826
else ! WITH_STORAGE_SHEEPDOG
827
EXTRA_DIST += storagebackendsheepdogtest.c
828
endif ! WITH_STORAGE_SHEEPDOG
829

830 831 832 833
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
834

835 836 837 838 839
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
840 841 842 843 844 845

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

J
Ján Tomko 已提交
848 849 850 851 852
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
853 854 855 856 857
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
858

859
if WITH_STORAGE
860 861 862 863 864 865 866 867 868 869
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

870 871 872 873
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
874
	$(LIBXML_LIBS) \
875
	../src/libvirt_driver_storage_impl.la $(LDADDS)
J
Ján Tomko 已提交
876

877
else ! WITH_STORAGE
878
EXTRA_DIST += storagevolxml2argvtest.c
879
EXTRA_DIST += virstorageutiltest.c
880
endif ! WITH_STORAGE
881

882 883 884 885 886
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

887 888 889 890 891
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
892 893 894
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
895
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
896

897 898 899 900 901
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

902 903 904
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
905
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Jiri Denemark 已提交
906 907 908 909
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS) $(GNULIB_LIBS)
endif WITH_QEMU
910

P
Peter Krempa 已提交
911 912 913 914 915
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

916 917 918 919 920
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

921
virconftest_SOURCES = \
922
	virconftest.c testutils.h testutils.c
923
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
924

925
virhostcputest_SOURCES = \
926
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
927
virhostcputest_LDADD = $(LDADDS)
928

929 930 931 932 933 934
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
935 936 937 938 939 940 941
commandhelper_LDADD = \
	$(WARN_CFLAGS) \
	$(NO_INDIRECT_LDFLAGS) \
	$(PROBES_O) \
	../src/libvirt_util.la \
	$(GNULIB_LIBS)

942
commandhelper_LDFLAGS = -static
943

944

945 946 947 948
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

949
vircapstest_SOURCES = \
950 951 952 953 954 955 956 957 958 959
	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
960
vircapstest_LDADD = $(qemu_LDADDS) $(LDADDS)
961

962 963 964 965 966
domaincapsmock_la_SOURCES = domaincapsmock.c
domaincapsmock_la_CFLAGS = $(AM_CFLAGS)
domaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
domaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
967 968 969 970
domaincapstest_SOURCES = \
	domaincapstest.c testutils.h testutils.c
domaincapstest_LDADD = $(LDADDS)

971 972
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
973
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
974 975
endif WITH_QEMU

976 977
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
978
domaincapstest_LDADD += ../src/libvirt_driver_libxl_impl.la $(GNULIB_LIBS)
979 980
endif WITH_LIBXL

981 982 983 984
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

985 986
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
987
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
988
virnetmessagetest_LDADD = $(LDADDS)
989

990 991
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
992
virnetsockettest_LDADD = $(LDADDS)
993

994 995
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
996
	testutils.h testutils.c
997 998
virnetdaemontest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
virnetdaemontest_LDADD = $(LDADDS)
999

1000 1001 1002 1003 1004 1005
virnetdaemonmock_la_SOURCES = \
	virnetdaemonmock.c
virnetdaemonmock_la_CFLAGS = $(AM_CFLAGS)
virnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)

1006 1007 1008
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
1009
virnetserverclienttest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
1010 1011 1012 1013 1014
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
virnetserverclientmock_la_CFLAGS = $(AM_CFLAGS)
1015
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1016
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1017

1018
if WITH_GNUTLS
1019
virnettlscontexttest_SOURCES = \
1020 1021 1022
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1023
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
1024 1025 1026 1027
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1028
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
1029 1030 1031
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
1032 1033
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
1034
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
1035
EXTRA_DIST += pkix_asn1_tab.c
1036 1037
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
1038
EXTRA_DIST += \
1039 1040 1041
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
1042
endif ! WITH_GNUTLS
1043

1044 1045
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1046
virtimetest_LDADD = $(LDADDS)
1047

J
Ján Tomko 已提交
1048 1049
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1050
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1051

1052 1053 1054 1055
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1056 1057
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1058 1059 1060 1061 1062 1063 1064
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)
1065

1066 1067 1068
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1069
if WITH_SELINUX
1070
viridentitytest_LDADD += $(SELINUX_LIBS)
1071 1072 1073
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1074

J
Ján Tomko 已提交
1075 1076 1077 1078
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1079 1080 1081 1082
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1083 1084 1085 1086
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1087 1088 1089 1090
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1091 1092 1093 1094
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1095
virportallocatormock_la_SOURCES = \
1096
	virportallocatormock.c
1097 1098 1099
virportallocatormock_la_CFLAGS = $(AM_CFLAGS)
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1100

1101 1102 1103 1104 1105 1106 1107
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
1108
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1109
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1110

1111 1112 1113 1114
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1115 1116 1117 1118
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1119 1120 1121 1122 1123 1124 1125
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
1126
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1127
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1128

J
John Ferlan 已提交
1129 1130 1131 1132 1133 1134
virrandommock_la_SOURCES = \
	virrandommock.c
virrandommock_la_CFLAGS = $(AM_CFLAGS)
virrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virrandommock_la_LIBADD = $(MOCKLIBS_LIBS)

1135 1136 1137 1138 1139
virhostcpumock_la_SOURCES = \
	virhostcpumock.c
virhostcpumock_la_CFLAGS = $(AM_CFLAGS)
virhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1140

1141 1142
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1143
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1144 1145
vircaps2xmltest_LDADD = $(LDADDS)

M
Martin Kletzander 已提交
1146 1147 1148 1149 1150
virnumamock_la_SOURCES = \
	virnumamock.c
virnumamock_la_CFLAGS = $(AM_CFLAGS)
virnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1151

1152
else ! WITH_LINUX
1153
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c virfilewrapper.h
1154
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1155

1156
if WITH_NSS
M
Michal Privoznik 已提交
1157 1158 1159 1160 1161 1162 1163 1164 1165
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

1166 1167 1168 1169 1170 1171 1172 1173 1174 1175
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 已提交
1176 1177 1178 1179 1180 1181
nssmock_la_SOURCES = \
	nssmock.c
nssmock_la_CFLAGS = $(AM_CFLAGS)
nssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
nssmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1182 1183 1184 1185 1186 1187 1188 1189 1190
## 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)

1191 1192 1193 1194 1195 1196 1197
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)
1198 1199 1200
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1201

1202
if WITH_YAJL
1203 1204 1205 1206 1207 1208 1209 1210
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
1211
virmacmaptest_CLFAGS = $(AM_CFLAGS)
1212 1213
virmacmaptest_LDADD = $(LDADDS)

1214 1215 1216 1217 1218 1219
test_libraries += virmacmapmock.la
test_programs += virmacmaptest
else ! WITH_YAJL
EXTRA_DIST += virmacmapmock.c virmacmaptest.c
endif ! WITH_YAJL

M
Michal Privoznik 已提交
1220 1221 1222 1223 1224 1225 1226 1227
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)
1228
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1229
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1230

1231 1232 1233 1234 1235
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_CFLAGS = $(AM_CFLAGS)
virrotatingfiletest_LDADD = $(LDADDS)

1236 1237 1238 1239 1240
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1241 1242 1243 1244
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1245 1246
virusbmock_la_SOURCES = virusbmock.c
virusbmock_la_CFLAGS = $(AM_CFLAGS)
1247
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1248
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1249
	$(PROBES_O) \
1250
	../src/libvirt_util.la
1251 1252 1253 1254

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
virnetdevbandwidthmock_la_CFLAGS = $(AM_CFLAGS)
1255
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1256
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1257

1258 1259 1260 1261
virtestmock_la_SOURCES = \
	virtestmock.c
virtestmock_la_CFLAGS = $(AM_CFLAGS)
virtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1262 1263
virtestmock_la_LIBADD = \
	$(MOCKLIBS_LIBS) \
1264
	$(PROBES_O) \
1265
	../src/libvirt_util.la
1266
else ! WITH_LINUX
1267
	EXTRA_DIST += virusbtest.c virusbmock.c \
1268 1269
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1270 1271
endif ! WITH_LINUX

1272 1273 1274 1275
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1276
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1277

1278 1279 1280 1281 1282
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1283

1284 1285 1286 1287 1288
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1289 1290
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1291
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1292
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1293

1294
else ! WITH_DBUS
1295
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1296
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1297

1298 1299
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1300
viruritest_LDADD = $(LDADDS)
1301

1302 1303
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1304
virkeyfiletest_LDADD = $(LDADDS)
1305

1306 1307 1308 1309
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1310 1311
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1312
virauthconfigtest_LDADD = $(LDADDS)
1313

1314
seclabeltest_SOURCES = \
1315
	seclabeltest.c testutils.h testutils.c
1316
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1317

1318
if WITH_SECDRIVER_SELINUX
1319
if WITH_ATTR
1320 1321
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1322
else ! WITH_TESTS
1323
check_LTLIBRARIES += libsecurityselinuxhelper.la
1324
endif ! WITH_TESTS
1325 1326 1327

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1328
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1329 1330 1331

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1332
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1333 1334
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1335 1336 1337 1338 1339

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1340
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(LDADDS) $(SELINUX_LIBS)
1341 1342
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1343 1344 1345
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1346 1347
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1348

1349 1350 1351 1352
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1353 1354 1355
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1356

1357
viratomictest_SOURCES = \
L
Laine Stump 已提交
1358
	viratomictest.c testutils.h testutils.c
1359 1360
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1361 1362 1363 1364
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1365 1366 1367 1368
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1369 1370 1371 1372
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

1373 1374
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1375
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1376 1377
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1378
jsontest_SOURCES = \
1379
	jsontest.c testutils.h testutils.c
1380 1381
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
1382 1383 1384 1385
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1386 1387 1388 1389
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1390
endif WITH_DRIVER_MODULES
1391

1392 1393
if WITH_LIBVIRTD
eventtest_SOURCES = \
1394
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1395
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1396
endif WITH_LIBVIRTD
1397

1398 1399
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1400
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1401 1402 1403

shunloadtest_SOURCES = \
	shunloadtest.c
1404
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1405 1406
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1407 1408 1409 1410
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1411 1412 1413 1414
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1415 1416 1417 1418
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1419 1420 1421 1422 1423
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1424 1425 1426 1427 1428
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1429
if WITH_LINUX
O
Osier Yang 已提交
1430 1431 1432 1433
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1434 1435 1436 1437
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1438 1439
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1440
EXTRA_DIST += scsihosttest.c
1441 1442
endif  ! WITH_LINUX

O
Osier Yang 已提交
1443 1444 1445 1446 1447 1448 1449 1450 1451
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1452 1453 1454 1455 1456 1457
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1458
objectlocking_SOURCES = objectlocking.ml
1459 1460 1461 1462

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

1463
objectlocking: objectlocking.cmx objectlocking-files.txt
1464 1465
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1466

1467
objectlocking-files.txt:
1468 1469
	find $(top_builddir)/src/ -name '*.i' > $@

1470
else ! WITH_CIL
1471
EXTRA_DIST += objectlocking.ml
1472
endif ! WITH_CIL
1473

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