Makefile.am 33.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

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

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

E
Eric Blake 已提交
205 206 207 208
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
209
	virnetdaemontest \
E
Eric Blake 已提交
210 211 212 213 214 215 216
	virnetserverclienttest \
	$(NULL)
if WITH_GNUTLS
test_programs += virnettlscontexttest virnettlssessiontest
endif WITH_GNUTLS
endif WITH_REMOTE

217 218
if WITH_LINUX
test_programs += fchosttest
219
test_programs += scsihosttest
220 221
endif WITH_LINUX

222 223 224 225
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

226
if WITH_DBUS
227
test_programs += virdbustest \
228 229 230 231 232
                 virsystemdtest \
                 $(NULL)
if WITH_POLKIT1
test_programs += virpolkittest
endif WITH_POLKIT1
233
endif WITH_DBUS
234

235
if WITH_SECDRIVER_SELINUX
236
if WITH_ATTR
237 238
test_programs += securityselinuxtest \
                 viridentitytest
239
if WITH_QEMU
240
test_programs += securityselinuxlabeltest
241 242 243
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
244

245 246
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
247
endif WITH_DRIVER_MODULES
248

249 250 251
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
252

253
if WITH_XEN
254
test_programs += xml2sexprtest sexpr2xmltest \
255
	xmconfigtest xencapstest
256
endif WITH_XEN
257 258 259 260 261

if WITH_LIBXL
test_programs += xlconfigtest
endif WITH_LIBXL

262
if WITH_QEMU
J
Jiri Denemark 已提交
263
test_programs += qemuxml2argvtest qemuxml2xmltest \
264
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
265
	qemumonitortest qemumonitorjsontest qemuhotplugtest \
266 267
	qemuagenttest qemucapabilitiestest qemucaps2xmltest \
	qemucommandutiltest
J
Jiri Denemark 已提交
268
test_helpers += qemucapsprobe
269
endif WITH_QEMU
270

271
if WITH_LXC
272
test_programs += lxcxml2xmltest lxcconf2xmltest
273
endif WITH_LXC
274

275
if WITH_OPENVZ
276
test_programs += openvzutilstest
277
endif WITH_OPENVZ
278

279
if WITH_ESX
280
test_programs += esxutilstest
281
endif WITH_ESX
282

Y
Yohan BELLEGUIC 已提交
283 284 285 286
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

287
if WITH_VMX
288
test_programs += vmx2xmltest xml2vmxtest
289
endif WITH_VMX
290

291 292 293 294
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
295
if WITH_BHYVE
296
test_programs += bhyvexml2argvtest bhyvexml2xmltest
R
Roman Bogorodskiy 已提交
297 298
endif WITH_BHYVE

299
if WITH_CIL
300
test_programs += objectlocking
301
endif WITH_CIL
302

303
if WITH_YAJL
304
test_programs += jsontest
305
endif WITH_YAJL
306

307 308 309 310
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
		$(NULL)
311

312
if WITH_NETWORK
313 314 315 316
test_programs += \
		networkxml2conftest \
		networkxml2firewalltest \
		$(NULL)
317
endif WITH_NETWORK
318

319 320
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
321
endif WITH_STORAGE_SHEEPDOG
322

323
test_programs += nwfilterxml2xmltest
324

325 326
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
327
test_programs += nwfilterxml2firewalltest
328 329
endif WITH_NWFILTER

330
if WITH_STORAGE
331
test_programs += storagevolxml2argvtest
332
endif WITH_STORAGE
333

334 335
if WITH_STORAGE_FS
test_programs += virstoragetest
336
endif WITH_STORAGE_FS
337

O
Osier Yang 已提交
338 339 340 341
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

342 343 344 345 346
if WITH_NSS
test_helpers += nsslinktest
test_programs += nsstest
endif WITH_NSS

347
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
348

349
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
350

351
test_programs += interfacexml2xmltest
352

353
test_programs += cputest
354

P
Peter Krempa 已提交
355 356
test_programs += metadatatest

J
Ján Tomko 已提交
357 358
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
359 360
test_programs += genericxml2xmltest

361
if WITH_LINUX
362 363 364
test_programs += virusbtest \
	virnetdevbandwidthtest \
	$(NULL)
365 366
endif WITH_LINUX

367 368
test_scripts = \
	capabilityschematest \
369
	interfaceschematest \
370 371 372
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
M
Michal Privoznik 已提交
373
	domaincapsschematest \
374
	domainschematest \
375
	nodedevschematest \
376
	nwfilterschematest \
J
Ján Tomko 已提交
377 378
	domainsnapshotschematest \
	secretschematest
379

380
libvirtd_test_scripts =		\
J
Jim Meyering 已提交
381 382
	libvirtd-fail			\
	libvirtd-pool			\
383
	virconftest.sh			\
384
	virsh-all			\
385 386 387
	virsh-cpuset			\
	virsh-define-dev-segfault	\
	virsh-int-overflow		\
388
	virsh-optparse			\
389 390
	virsh-read-bufsiz		\
	virsh-read-non-seekable		\
391
	virsh-schedinfo			\
392
	virsh-start			\
393 394
	virsh-synopsis			\
	virsh-undefine			\
395 396
	virsh-uriprecedence		\
	virsh-vcpupin			\
397
	$(NULL)
398

399 400 401
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

402 403 404
test_programs += 			\
	eventtest			\
	libvirtdconftest
405
else ! WITH_LIBVIRTD
406
EXTRA_DIST += $(libvirtd_test_scripts)
407
endif ! WITH_LIBVIRTD
408

409 410
test_programs += objecteventtest

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

417 418
EXTRA_DIST += $(test_scripts)

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

R
Roman Bogorodskiy 已提交
438 439 440 441
if WITH_BHYVE
test_libraries += bhyvexml2argvmock.la
endif WITH_BHYVE

442
if WITH_DBUS
443
test_libraries += \
444
		virdbusmock.la
445
endif WITH_DBUS
446

447
if WITH_LINUX
448 449
test_libraries += virusbmock.la \
		virnetdevbandwidthmock.la \
450
		virtestmock.la
451
		$(NULL)
452 453
endif WITH_LINUX

454 455 456 457 458 459 460 461 462 463 464 465 466
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

467 468
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
469
noinst_LTLIBRARIES = $(test_libraries)
470
else ! WITH_TESTS
471
check_PROGRAMS = $(test_programs) $(test_helpers)
472
check_LTLIBRARIES = $(test_libraries)
473
endif ! WITH_TESTS
474

475 476
TESTS = $(test_programs) \
	$(test_scripts)
477

478
# NB, automake < 1.10 does not provide the real
479
# abs_top_{src/build}dir or builddir variables, so don't rely
480
# on them here. Fake them with 'pwd'
481 482 483
# 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

484
lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd)
485

486
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
487
TESTS_ENVIRONMENT =				\
488
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
489
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
490 491 492
  abs_builddir=$(abs_builddir)			\
  abs_srcdir=$(abs_srcdir)			\
  CONFIG_HEADER="$(lv_abs_top_builddir)/config.h"	\
493
  SHELL="$(SHELL)"				\
494
  LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \
495
  LIBVIRT_AUTOSTART=0				\
496
  LC_ALL=C					\
497
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE)	\
498 499
  $(VG)

500

501 502
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(srcdir)/.valgrind.supp
503
valgrind:
504
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
505

506 507 508
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
509
sockettest_LDADD = $(LDADDS)
510

511
if WITH_XEN
E
Eric Blake 已提交
512
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
513 514
xen_LDADDS += $(LDADDS)

515
xml2sexprtest_SOURCES = \
516
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
517
	testutils.c testutils.h
518
xml2sexprtest_LDADD = $(xen_LDADDS)
519 520

sexpr2xmltest_SOURCES = \
521
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
522
	testutils.c testutils.h
523
sexpr2xmltest_LDADD = $(xen_LDADDS)
524

525
xmconfigtest_SOURCES = \
526
	xmconfigtest.c testutilsxen.c testutilsxen.h \
527
	testutils.c testutils.h
528
xmconfigtest_LDADD = $(xen_LDADDS)
529

530 531
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
532
xencapstest_LDADD = $(xen_LDADDS)
533

534
else ! WITH_XEN
535
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
536
	xencapstest.c \
537
	testutilsxen.c testutilsxen.h
538
endif ! WITH_XEN
539

540 541
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
542 543 544
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
545 546 547 548 549 550 551 552 553 554
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

555 556 557 558 559
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

560
if WITH_QEMU
561

562 563
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

564
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
565
if WITH_NETWORK
E
Eric Blake 已提交
566
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
567
endif WITH_NETWORK
568 569 570
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
571
if WITH_DTRACE_PROBES
572
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
573
endif WITH_DTRACE_PROBES
574

575 576 577 578
libqemutestdriver_la_SOURCES =
libqemutestdriver_la_LDFLAGS = $(QEMULIB_LDFLAGS)
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)

579
qemuxml2argvtest_SOURCES = \
580
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
581
	testutils.c testutils.h
582
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LDADDS) $(LIBXML_LIBS)
583

584 585 586
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
qemuxml2argvmock_la_CFLAGS = $(AM_CFLAGS)
587
qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
588
qemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
589

590
qemuxml2xmltest_SOURCES = \
591
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
592
	testutils.c testutils.h
593
qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
594 595 596 597

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
598
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
599 600

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
601
qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
602

603 604 605 606 607 608
qemumonitortest_SOURCES = \
	qemumonitortest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h
qemumonitortest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
609

610 611 612 613 614
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
615 616
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
617

618 619 620 621 622
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
623 624
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
625

J
Jiri Denemark 已提交
626 627 628 629 630 631 632 633 634 635 636
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)

637 638 639 640 641 642 643 644
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)

645 646 647 648
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
	$(NULL)
649
qemucaps2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
650

P
Pavel Hrdina 已提交
651 652 653
qemucaps2xmlmock_la_SOURCES = \
	qemucaps2xmlmock.c
qemucaps2xmlmock_la_CFLAGS = $(AM_CFLAGS)
654
qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
655
qemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
656

P
Peter Krempa 已提交
657 658 659 660 661
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
662
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
P
Peter Krempa 已提交
663

664 665 666 667 668
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
669
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
670

671 672 673
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
674
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
675
else ! WITH_QEMU
676
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
J
Jiri Denemark 已提交
677
	qemuhelptest.c domainsnapshotxml2xmltest.c \
678
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
679
	qemumonitorjsontest.c qemuhotplugtest.c \
680
	qemuagenttest.c qemucapabilitiestest.c \
681
	qemucaps2xmltest.c qemucommandutiltest.c \
682
	$(QEMUMONITORTESTUTILS_SOURCES)
683
endif ! WITH_QEMU
684

685 686
if WITH_LXC

E
Eric Blake 已提交
687
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
688
if WITH_NETWORK
E
Eric Blake 已提交
689
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
690
endif WITH_NETWORK
691
lxc_LDADDS += $(LDADDS)
692 693 694 695

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
696
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
697 698

lxcconf2xmltest_SOURCES = \
699
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
700 701
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
702
else ! WITH_LXC
703
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
704
endif ! WITH_LXC
705

706 707 708 709
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
710
openvzutilstest_LDADD = $(LDADDS)
711
else ! WITH_OPENVZ
712
EXTRA_DIST += openvzutilstest.c
713
endif ! WITH_OPENVZ
714 715
EXTRA_DIST += openvzutilstest.conf

716 717 718 719
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
720
esxutilstest_LDADD = $(LDADDS)
721
else ! WITH_ESX
722
EXTRA_DIST += esxutilstest.c
723
endif ! WITH_ESX
724

Y
Yohan BELLEGUIC 已提交
725 726 727 728 729 730 731 732 733 734
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

735
if WITH_VMX
736 737 738
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
739
vmx2xmltest_LDADD = $(LDADDS)
740 741 742 743

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
744
xml2vmxtest_LDADD = $(LDADDS)
745
else ! WITH_VMX
746
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
747
endif ! WITH_VMX
748

749 750 751 752 753 754 755 756 757
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 已提交
758 759 760 761
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
bhyvexml2argvmock_la_CFLAGS = $(AM_CFLAGS)
762
bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
763
bhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
764 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)
R
Roman Bogorodskiy 已提交
779
else ! WITH_BHYVE
780
EXTRA_DIST += bhyvexml2argvtest.c bhyvexml2xmltest.c bhyvexml2argvmock.c
R
Roman Bogorodskiy 已提交
781 782
endif ! WITH_BHYVE

783 784 785 786 787
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
788 789 790 791 792
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

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

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

804
else ! WITH_NETWORK
805
EXTRA_DIST += networkxml2conftest.c
806
endif !	WITH_NETWORK
807

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

818 819 820 821
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
822

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

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

J
Ján Tomko 已提交
836 837 838 839 840
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
841 842 843 844 845
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
846

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

855
else ! WITH_STORAGE
856
EXTRA_DIST += storagevolxml2argvtest.c
857
endif ! WITH_STORAGE
858

859 860 861 862 863
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

864 865 866 867 868
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
869 870 871
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
872
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
873

874 875 876 877 878
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

879 880 881
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
882
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
883

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

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

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

898 899 900 901
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

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

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

915
commandhelper_LDFLAGS = -static
916

917

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

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

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

M
Michal Privoznik 已提交
939 940 941 942
domaincapstest_SOURCES = \
	domaincapstest.c testutils.h testutils.c
domaincapstest_LDADD = $(LDADDS)

943 944
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
945
domaincapstest_LDADD += $(qemu_LDADDS) $(GNULIB_LIBS)
946 947
endif WITH_QEMU

948 949 950
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
951 952
	$(NULL)
libvirtdconftest_LDADD = ../daemon/libvirtd_conf.la $(LDADDS)
953
else ! WITH_LIBVIRTD
954
EXTRA_DIST += libvirtdconftest.c
955
endif ! WITH_LIBVIRTD
956

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

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

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

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

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

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

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

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

1020 1021 1022 1023
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1024 1025
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1026 1027 1028 1029 1030 1031 1032
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)
1033

1034 1035 1036
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1037
if WITH_SELINUX
1038
viridentitytest_LDADD += $(SELINUX_LIBS)
1039 1040 1041
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1042

J
Ján Tomko 已提交
1043 1044 1045 1046
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1047 1048 1049 1050
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1051 1052 1053 1054
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1055 1056 1057 1058
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1059 1060 1061 1062
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1063
virportallocatormock_la_SOURCES = \
1064
	virportallocatormock.c
1065 1066 1067
virportallocatormock_la_CFLAGS = $(AM_CFLAGS)
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1068

1069 1070 1071 1072 1073 1074 1075
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
1076
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1077
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1078

1079 1080 1081 1082
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1083 1084 1085 1086
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1087 1088 1089 1090 1091 1092 1093
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
1094
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1095
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1096

1097 1098 1099 1100
nodeinfomock_la_SOURCES = \
	nodeinfomock.c
nodeinfomock_la_CFLAGS = $(AM_CFLAGS)
nodeinfomock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1101
nodeinfomock_la_LIBADD = $(MOCKLIBS_LIBS)
1102

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

1138 1139 1140 1141 1142
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_CFLAGS = $(AM_CFLAGS)
virrotatingfiletest_LDADD = $(LDADDS)

1143 1144 1145 1146 1147
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1148 1149 1150 1151
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1152 1153
virusbmock_la_SOURCES = virusbmock.c
virusbmock_la_CFLAGS = $(AM_CFLAGS)
1154
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1155
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS)
1156 1157 1158 1159

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
virnetdevbandwidthmock_la_CFLAGS = $(AM_CFLAGS)
1160
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1161
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1162

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

1176 1177 1178 1179
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1180
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1181

1182 1183 1184 1185 1186
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1187

1188 1189 1190 1191 1192
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1193 1194
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1195
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1196
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1197

1198
else ! WITH_DBUS
1199
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1200
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1201

1202 1203
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1204
viruritest_LDADD = $(LDADDS)
1205

1206 1207
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1208
virkeyfiletest_LDADD = $(LDADDS)
1209

1210 1211 1212 1213
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1214 1215
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1216
virauthconfigtest_LDADD = $(LDADDS)
1217

1218
seclabeltest_SOURCES = \
1219
	seclabeltest.c testutils.h testutils.c
1220
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1221

1222
if WITH_SECDRIVER_SELINUX
1223
if WITH_ATTR
1224 1225
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1226
else ! WITH_TESTS
1227
check_LTLIBRARIES += libsecurityselinuxhelper.la
1228
endif ! WITH_TESTS
1229 1230 1231

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1232
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1233 1234 1235

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1236
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1237 1238
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1239 1240 1241 1242 1243

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

1253 1254 1255 1256
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1257 1258 1259
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1260

1261
viratomictest_SOURCES = \
L
Laine Stump 已提交
1262
	viratomictest.c testutils.h testutils.c
1263 1264
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1265 1266 1267 1268
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1269 1270 1271 1272
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1273 1274 1275 1276
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

1277 1278
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1279
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1280 1281
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1282
jsontest_SOURCES = \
1283
	jsontest.c testutils.h testutils.c
1284 1285
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
1286 1287 1288 1289
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1290 1291 1292 1293
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1294
endif WITH_DRIVER_MODULES
1295

1296 1297
if WITH_LIBVIRTD
eventtest_SOURCES = \
1298
	eventtest.c testutils.h testutils.c
1299
eventtest_LDADD = -lrt $(LDADDS)
1300
endif WITH_LIBVIRTD
1301

1302 1303
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1304
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1305 1306 1307

shunloadtest_SOURCES = \
	shunloadtest.c
1308
shunloadtest_LDADD = $(LIB_PTHREAD)
1309 1310
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1311 1312 1313 1314
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1315 1316 1317 1318
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1319 1320 1321 1322
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1323 1324 1325 1326 1327
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1328 1329 1330 1331 1332
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1333
if WITH_LINUX
O
Osier Yang 已提交
1334 1335 1336 1337
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1338 1339 1340 1341
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1342 1343
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1344
EXTRA_DIST += scsihosttest.c
1345 1346
endif  ! WITH_LINUX

O
Osier Yang 已提交
1347 1348 1349 1350 1351 1352 1353 1354 1355
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1356 1357 1358 1359 1360 1361
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1362
objectlocking_SOURCES = objectlocking.ml
1363 1364 1365 1366

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

1367
objectlocking: objectlocking.cmx objectlocking-files.txt
1368 1369
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1370

1371
objectlocking-files.txt:
1372 1373
	find $(top_builddir)/src/ -name '*.i' > $@

1374
else ! WITH_CIL
1375
EXTRA_DIST += objectlocking.ml
1376
endif ! WITH_CIL
1377

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