Makefile.am 34.4 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 125
	qemuhotplugtestdevices \
	qemuhotplugtestdomains \
126
	qemumonitorjsondata \
E
Eric Blake 已提交
127 128
	qemuxml2argvdata \
	qemuxml2xmloutdata \
J
Ján Tomko 已提交
129
	secretxml2xmlin \
130
	securityselinuxhelperdata \
131
	securityselinuxlabeldata \
E
Eric Blake 已提交
132
	sexpr2xmldata \
133
	storagepoolschemadata \
134
	storagepoolxml2xmlin \
E
Eric Blake 已提交
135
	storagepoolxml2xmlout \
136
	storagevolschemadata \
137
	storagevolxml2argvdata \
138
	storagevolxml2xmlin \
E
Eric Blake 已提交
139
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
140
	sysinfodata \
E
Eric Blake 已提交
141
	test-lib.sh	\
Y
Yohan BELLEGUIC 已提交
142
	vboxsnapshotxmldata \
143
	vircaps2xmldata \
144
	vircgroupdata \
145
	virconfdata \
146
	virfiledata \
147
	virmock.h \
148
	virnetdaemondata \
149
	virnetdevtestdata \
150
	virpcitestdata \
O
Osier Yang 已提交
151
	virscsidata \
152
	virsh-uriprecedence \
153
	virusbtestdata \
154
	vmwareverdata \
155
	vmx2xmldata \
E
Eric Blake 已提交
156
	xencapsdata \
157
	xlconfigdata \
158
	xmconfigdata \
E
Eric Blake 已提交
159
	xml2sexprdata \
160
	xml2vmxdata
K
Karel Zak 已提交
161

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

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

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

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

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

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

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

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

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

if WITH_LIBXL
test_programs += xlconfigtest
endif WITH_LIBXL

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

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

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

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

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

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

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

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

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

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

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

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

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

316
test_programs += nwfilterxml2xmltest
317

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

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

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

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

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

340
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
341

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

344
test_programs += interfacexml2xmltest
345

346
test_programs += cputest
347

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

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

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

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

J
Ján Tomko 已提交
360
test_scripts =
361
libvirtd_test_scripts =		\
J
Jim Meyering 已提交
362 363
	libvirtd-fail			\
	libvirtd-pool			\
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			\
J
Ján Tomko 已提交
371
	virsh-self-test			\
M
Michal Privoznik 已提交
372
	virt-admin-self-test			\
373
	virsh-start			\
374
	virsh-undefine			\
375 376
	virsh-uriprecedence		\
	virsh-vcpupin			\
377
	$(NULL)
378

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

382
test_programs += 			\
383
	eventtest
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 \
408
		domaincapsmock.la \
D
Daniel P. Berrange 已提交
409
		$(NULL)
410
if WITH_QEMU
411
test_libraries += libqemumonitortestutils.la \
412
		libqemutestdriver.la \
413
		qemuxml2argvmock.la \
P
Pavel Hrdina 已提交
414
		qemucaps2xmlmock.la \
J
Jiri Denemark 已提交
415
		qemucapsprobemock.la \
416
		$(NULL)
417
endif WITH_QEMU
418

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

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

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

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

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

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

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

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

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

481

482 483
VALGRIND = valgrind --quiet --leak-check=full \
	--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
qemuxml2argvtest_SOURCES = \
561
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
562
	testutils.c testutils.h
563
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LDADDS) $(LIBXML_LIBS)
564

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

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

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

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

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

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

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

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

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

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

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

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

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

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

666 667
if WITH_LXC

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

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

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

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

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

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

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

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

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

746 747 748 749 750 751
bhyveargv2xmlmock_la_SOURCES = \
	bhyveargv2xmlmock.c
bhyveargv2xmlmock_la_CFLAGS = $(AM_CFLAGS)
bhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
bhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)

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

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
766 767 768 769 770

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

780 781 782 783 784
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
785 786 787 788 789
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

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

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

801
else ! WITH_NETWORK
802
EXTRA_DIST += networkxml2conftest.c
803
endif !	WITH_NETWORK
804

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

815 816 817 818
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
819

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

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

J
Ján Tomko 已提交
833 834 835 836 837
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
838 839 840 841 842
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
843

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

852
else ! WITH_STORAGE
853
EXTRA_DIST += storagevolxml2argvtest.c
854
endif ! WITH_STORAGE
855

856 857 858 859 860
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

861 862 863 864 865
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
866 867 868
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
869
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
870

871 872 873 874 875
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

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

P
Peter Krempa 已提交
885 886 887 888 889
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

890 891 892 893 894
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

895
virconftest_SOURCES = \
896
	virconftest.c testutils.h testutils.c
897
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
898

899 900 901
virhostcputest_SOURCES = \
	virhostcputest.c testutils.h testutils.c
virhostcputest_LDADD = $(LDADDS)
902

903 904 905 906 907 908
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
909 910 911 912 913 914 915
commandhelper_LDADD = \
	$(WARN_CFLAGS) \
	$(NO_INDIRECT_LDFLAGS) \
	$(PROBES_O) \
	../src/libvirt_util.la \
	$(GNULIB_LIBS)

916
commandhelper_LDFLAGS = -static
917

918

919 920 921 922
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

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

936 937 938 939
vircaps2xmltest_SOURCES = \
	vircaps2xmltest.c testutils.h testutils.c
vircaps2xmltest_LDADD = $(LDADDS)

940 941 942 943 944 945

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

M
Michal Privoznik 已提交
946 947 948 949
domaincapstest_SOURCES = \
	domaincapstest.c testutils.h testutils.c
domaincapstest_LDADD = $(LDADDS)

950 951
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
952
domaincapstest_LDADD += $(qemu_LDADDS) $(GNULIB_LIBS)
953 954
endif WITH_QEMU

955 956
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
957
domaincapstest_LDADD += ../src/libvirt_driver_libxl_impl.la $(GNULIB_LIBS)
958 959
endif WITH_LIBXL

960 961
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
962
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
963
virnetmessagetest_LDADD = $(LDADDS)
964

965 966
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
967
virnetsockettest_LDADD = $(LDADDS)
968

969 970
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
971
	testutils.h testutils.c
972 973
virnetdaemontest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
virnetdaemontest_LDADD = $(LDADDS)
974

975 976 977 978 979 980
virnetdaemonmock_la_SOURCES = \
	virnetdaemonmock.c
virnetdaemonmock_la_CFLAGS = $(AM_CFLAGS)
virnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)

981 982 983
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
984
virnetserverclienttest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
985 986 987 988 989
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
virnetserverclientmock_la_CFLAGS = $(AM_CFLAGS)
990
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
991
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
992

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

1019 1020
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1021
virtimetest_LDADD = $(LDADDS)
1022

J
Ján Tomko 已提交
1023 1024
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1025
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1026

1027 1028 1029 1030
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

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

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

J
Ján Tomko 已提交
1050 1051 1052 1053
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1054 1055 1056 1057
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1058 1059 1060 1061
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1062 1063 1064 1065
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1066 1067 1068 1069
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

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

1076 1077 1078 1079 1080 1081 1082
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
1083
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1084
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1085

1086 1087 1088 1089
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1090 1091 1092 1093
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1094 1095 1096 1097 1098 1099 1100
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
1101
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1102
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1103

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

1110 1111 1112 1113 1114
virhostcpumock_la_SOURCES = \
	virhostcpumock.c
virhostcpumock_la_CFLAGS = $(AM_CFLAGS)
virhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1115

M
Michal Privoznik 已提交
1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130
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 已提交
1131 1132 1133 1134 1135 1136 1137 1138 1139
## 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 已提交
1140 1141 1142 1143 1144 1145 1146 1147
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)
1148
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1149
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1150

1151 1152 1153 1154 1155
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_CFLAGS = $(AM_CFLAGS)
virrotatingfiletest_LDADD = $(LDADDS)

1156 1157 1158 1159 1160
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1161 1162 1163 1164
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1165 1166
virusbmock_la_SOURCES = virusbmock.c
virusbmock_la_CFLAGS = $(AM_CFLAGS)
1167
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1168
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS)
1169 1170 1171 1172

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
virnetdevbandwidthmock_la_CFLAGS = $(AM_CFLAGS)
1173
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1174
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1175

1176 1177 1178 1179
virtestmock_la_SOURCES = \
	virtestmock.c
virtestmock_la_CFLAGS = $(AM_CFLAGS)
virtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1180 1181
virtestmock_la_LIBADD = \
	$(MOCKLIBS_LIBS) \
1182
	$(PROBES_O) \
1183
	../src/libvirt_util.la
1184
else ! WITH_LINUX
1185
	EXTRA_DIST += virusbtest.c virusbmock.c \
1186 1187
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1188 1189
endif ! WITH_LINUX

1190 1191 1192 1193
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1194
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1195

1196 1197 1198 1199 1200
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1201

1202 1203 1204 1205 1206
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1207 1208
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1209
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1210
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1211

1212
else ! WITH_DBUS
1213
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1214
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1215

1216 1217
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1218
viruritest_LDADD = $(LDADDS)
1219

1220 1221
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1222
virkeyfiletest_LDADD = $(LDADDS)
1223

1224 1225 1226 1227
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1228 1229
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1230
virauthconfigtest_LDADD = $(LDADDS)
1231

1232
seclabeltest_SOURCES = \
1233
	seclabeltest.c testutils.h testutils.c
1234
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1235

1236
if WITH_SECDRIVER_SELINUX
1237
if WITH_ATTR
1238 1239
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1240
else ! WITH_TESTS
1241
check_LTLIBRARIES += libsecurityselinuxhelper.la
1242
endif ! WITH_TESTS
1243 1244 1245

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1246
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1247 1248 1249

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1250
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1251 1252
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1253 1254 1255 1256 1257

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1258
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(LDADDS) $(SELINUX_LIBS)
1259 1260
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1261 1262 1263
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1264 1265
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1266

1267 1268 1269 1270
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1271 1272 1273
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1274

1275
viratomictest_SOURCES = \
L
Laine Stump 已提交
1276
	viratomictest.c testutils.h testutils.c
1277 1278
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1279 1280 1281 1282
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1283 1284 1285 1286
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1287 1288 1289 1290
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

1291 1292
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1293
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1294 1295
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1296
jsontest_SOURCES = \
1297
	jsontest.c testutils.h testutils.c
1298 1299
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
1300 1301 1302 1303
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1304 1305 1306 1307
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1308
endif WITH_DRIVER_MODULES
1309

1310 1311
if WITH_LIBVIRTD
eventtest_SOURCES = \
1312
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1313
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1314
endif WITH_LIBVIRTD
1315

1316 1317
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1318
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1319 1320 1321

shunloadtest_SOURCES = \
	shunloadtest.c
1322
shunloadtest_LDADD = $(LIB_PTHREAD)
1323 1324
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1325 1326 1327 1328
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1329 1330 1331 1332
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1333 1334 1335 1336
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1337 1338 1339 1340 1341
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1342 1343 1344 1345 1346
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1347
if WITH_LINUX
O
Osier Yang 已提交
1348 1349 1350 1351
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1352 1353 1354 1355
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1356 1357
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1358
EXTRA_DIST += scsihosttest.c
1359 1360
endif  ! WITH_LINUX

O
Osier Yang 已提交
1361 1362 1363 1364 1365 1366 1367 1368 1369
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1370 1371 1372 1373 1374 1375
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1376
objectlocking_SOURCES = objectlocking.ml
1377 1378 1379 1380

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

1381
objectlocking: objectlocking.cmx objectlocking-files.txt
1382 1383
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1384

1385
objectlocking-files.txt:
1386 1387
	find $(top_builddir)/src/ -name '*.i' > $@

1388
else ! WITH_CIL
1389
EXTRA_DIST += objectlocking.ml
1390
endif ! WITH_CIL
1391

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