Makefile.am 37.7 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
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"

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
	$(NO_INDIRECT_LDFLAGS) \
78
	$(PROBES_O) \
79 80
	$(GNULIB_LIBS) \
	../src/libvirt.la
K
Karel Zak 已提交
81

82 83 84
MOCKLIBS_LIBS = \
	$(GNULIB_LIBS)

85
EXTRA_DIST = \
86
	.valgrind.supp \
R
Roman Bogorodskiy 已提交
87
	bhyvexml2argvdata \
88
	bhyveargv2xmldata \
89
	bhyvexml2xmloutdata \
90
	capabilityschemadata \
E
Eric Blake 已提交
91 92
	commanddata \
	cputestdata \
M
Michal Privoznik 已提交
93
	domaincapsschemadata \
94
	domainconfdata \
95
	domainschemadata \
E
Eric Blake 已提交
96 97
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
O
Osier Yang 已提交
98
	fchostdata \
C
Cole Robinson 已提交
99 100
	genericxml2xmlindata \
	genericxml2xmloutdata \
101
	interfaceschemadata \
102
	libxlxml2domconfigdata \
103
	lxcconf2xmldata \
104
	lxcxml2xmldata \
105
	lxcxml2xmloutdata \
106 107
	networkxml2confdata \
	networkxml2firewalldata \
E
Eric Blake 已提交
108 109
	networkxml2xmlin \
	networkxml2xmlout \
J
Ján Tomko 已提交
110 111
	networkxml2xmlupdatein \
	networkxml2xmlupdateout \
E
Eric Blake 已提交
112
	nodedevschemadata \
113
	virhostcpudata \
M
Michal Privoznik 已提交
114
	nssdata \
115
	nwfilterxml2firewalldata \
E
Eric Blake 已提交
116 117 118
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
119
	qemuagentdata \
120
	qemuargv2xmldata \
121
	qemucapabilitiesdata \
122
	qemucaps2xmldata \
E
Eric Blake 已提交
123
	qemuhelpdata \
124
	qemuhotplugtestcpus \
125 126
	qemuhotplugtestdevices \
	qemuhotplugtestdomains \
127
	qemumonitorjsondata \
E
Eric Blake 已提交
128 129
	qemuxml2argvdata \
	qemuxml2xmloutdata \
130
	qemumemlockdata \
J
Ján Tomko 已提交
131
	secretxml2xmlin \
132
	securityselinuxhelperdata \
133
	securityselinuxlabeldata \
E
Eric Blake 已提交
134
	sexpr2xmldata \
135
	storagepoolschemadata \
136
	storagepoolxml2xmlin \
E
Eric Blake 已提交
137
	storagepoolxml2xmlout \
138
	storagevolschemadata \
139
	storagevolxml2argvdata \
140
	storagevolxml2xmlin \
E
Eric Blake 已提交
141
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
142
	sysinfodata \
143
	test-lib.sh \
Y
Yohan BELLEGUIC 已提交
144
	vboxsnapshotxmldata \
145
	vircaps2xmldata \
146
	vircgroupdata \
147
	virconfdata \
148
	virfiledata \
149
	virjsondata \
150
	virmacmaptestdata \
151
	virmock.h \
152
	virnetdaemondata \
153
	virnetdevtestdata \
154
	virpcitestdata \
O
Osier Yang 已提交
155
	virscsidata \
156
	virsh-uriprecedence \
157
	virusbtestdata \
158
	vmwareverdata \
159
	vmx2xmldata \
E
Eric Blake 已提交
160
	xencapsdata \
161
	xlconfigdata \
162
	xmconfigdata \
E
Eric Blake 已提交
163
	xml2sexprdata \
164 165
	xml2vmxdata \
	virstorageutildata \
166
	virfilecachedata \
167
	$(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 \
P
Pavel Hrdina 已提交
185
	virfilecachetest \
186
	virfirewalltest \
J
Ján Tomko 已提交
187
	viriscsitest \
188
	virkeycodetest \
189
	virlockspacetest \
190
	virlogtest \
191
	virrotatingfiletest \
J
Ján Tomko 已提交
192
	virschematest \
193
	virstringtest \
194
	virportallocatortest \
V
Viktor Mihajlovski 已提交
195
	sysinfotest \
196
	virkmodtest \
197
	vircapstest \
M
Michal Privoznik 已提交
198
	domaincapstest \
199
	domainconftest \
200
	virhostdevtest \
M
Michal Privoznik 已提交
201
	virnetdevtest \
202
	virtypedparamtest \
203
	$(NULL)
204

205 206 207 208 209 210 211 212 213 214
test_libraries = libshunload.la \
	virportallocatormock.la \
	virnetdaemonmock.la \
	virnetserverclientmock.la \
	vircgroupmock.la \
	virpcimock.la \
	virnetdevmock.la \
	virrandommock.la \
	virhostcpumock.la \
	domaincapsmock.la \
P
Pavel Hrdina 已提交
215
	virfilecachemock.la \
216 217
	$(NULL)

E
Eric Blake 已提交
218 219 220 221
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
222
	virnetdaemontest \
E
Eric Blake 已提交
223 224 225 226 227 228 229
	virnetserverclienttest \
	$(NULL)
if WITH_GNUTLS
test_programs += virnettlscontexttest virnettlssessiontest
endif WITH_GNUTLS
endif WITH_REMOTE

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

241 242 243 244
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

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

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

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

269
if WITH_XEN
270
test_programs += xml2sexprtest sexpr2xmltest \
271
	xmconfigtest xencapstest
272
endif WITH_XEN
273 274

if WITH_LIBXL
275 276
test_programs += xlconfigtest libxlxml2domconfigtest
test_libraries += virmocklibxl.la
277 278
endif WITH_LIBXL

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

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

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

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

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

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

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

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

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

329
if WITH_YAJL
330
test_programs += virjsontest
331
endif WITH_YAJL
332

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

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

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

349
test_programs += nwfilterxml2xmltest
350

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

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

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

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

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

375
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
376

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

379
test_programs += interfacexml2xmltest
380

381
test_programs += cputest
382

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

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

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

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

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

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

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

424 425
test_programs += objecteventtest

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

433 434
EXTRA_DIST += $(test_scripts)

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 469 470 471 472 473 474
TESTS_ENVIRONMENT = \
  abs_top_builddir=$(lv_abs_top_builddir) \
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd` \
  abs_builddir=$(abs_builddir) \
  abs_srcdir=$(abs_srcdir) \
  CONFIG_HEADER="$(lv_abs_top_builddir)/config.h" \
  SHELL="$(SHELL)" \
475
  LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \
476 477 478
  LIBVIRT_AUTOSTART=0 \
  LC_ALL=C \
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \
479 480
  $(VG)

481

482 483
VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \
	--trace-children-skip="*/tools/virsh","*/tests/commandhelper" \
484
	--suppressions=$(srcdir)/.valgrind.supp
485
valgrind:
486
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
487

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

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

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

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

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

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

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

522 523
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
524 525 526
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
527 528 529 530 531 532
libxl_LDADDS += $(LDADDS)

xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
533 534 535 536 537 538 539 540 541 542 543 544

libxlxml2domconfigtest_SOURCES = \
	libxlxml2domconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
libxlxml2domconfigtest_LDADD = $(libxl_LDADDS) $(LIBXML_LIBS)

virmocklibxl_la_SOURCES = \
	virmocklibxl.c
virmocklibxl_la_CFLAGS = $(AM_CFLAGS)
virmocklibxl_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virmocklibxl_la_LIBADD = $(MOCKLIBS_LIBS)

545
else ! WITH_LIBXL
546
EXTRA_DIST += xlconfigtest.c libxlxml2domconfigtest.c
547 548
endif ! WITH_LIBXL

549 550 551 552 553
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

554
if WITH_QEMU
555

556 557
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

558
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
559
if WITH_NETWORK
E
Eric Blake 已提交
560
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
561
endif WITH_NETWORK
562 563 564
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
565
if WITH_DTRACE_PROBES
566
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
567
endif WITH_DTRACE_PROBES
568

569 570 571 572
libqemutestdriver_la_SOURCES =
libqemutestdriver_la_LDFLAGS = $(QEMULIB_LDFLAGS)
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)

573
qemucpumock_la_SOURCES = \
574
	qemucpumock.c testutilshostcpus.h
575 576 577 578
qemucpumock_la_CFLAGS = $(AM_CFLAGS)
qemucpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
qemucpumock_la_LIBADD = $(MOCKLIBS_LIBS)

579
qemuxml2argvtest_SOURCES = \
580
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
581
	testutils.c testutils.h
582
qemuxml2argvtest_LDADD = libqemutestdriver.la $(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 676 677 678 679 680

qemumemlocktest_SOURCES = \
	qemumemlocktest.c \
	testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemumemlocktest_LDADD = $(qemu_LDADDS) $(LDADDS)
681
else ! WITH_QEMU
682
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
J
Jiri Denemark 已提交
683
	qemuhelptest.c domainsnapshotxml2xmltest.c \
684
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
685
	qemumonitorjsontest.c qemuhotplugtest.c \
686
	qemuagenttest.c qemucapabilitiestest.c \
687
	qemucaps2xmltest.c qemucommandutiltest.c \
688
	qemumemlocktest.c qemucpumock.c testutilshostcpus.h \
689
	$(QEMUMONITORTESTUTILS_SOURCES)
690
endif ! WITH_QEMU
691

692 693
if WITH_LXC

E
Eric Blake 已提交
694
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
695
if WITH_NETWORK
E
Eric Blake 已提交
696
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
697
endif WITH_NETWORK
698
lxc_LDADDS += $(LDADDS)
699 700 701 702

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
703
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
704 705

lxcconf2xmltest_SOURCES = \
706
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
707 708
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
709
else ! WITH_LXC
710
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
711
endif ! WITH_LXC
712

713 714 715 716
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
717
openvzutilstest_LDADD = $(LDADDS)
718
else ! WITH_OPENVZ
719
EXTRA_DIST += openvzutilstest.c
720
endif ! WITH_OPENVZ
721 722
EXTRA_DIST += openvzutilstest.conf

723 724 725 726
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
727
esxutilstest_LDADD = $(LDADDS)
728
else ! WITH_ESX
729
EXTRA_DIST += esxutilstest.c
730
endif ! WITH_ESX
731

Y
Yohan BELLEGUIC 已提交
732 733 734 735 736 737 738 739 740 741
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

742
if WITH_VMX
743 744 745
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
746
vmx2xmltest_LDADD = $(LDADDS)
747 748 749 750

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
751
xml2vmxtest_LDADD = $(LDADDS)
752
else ! WITH_VMX
753
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
754
endif ! WITH_VMX
755

756 757 758 759 760 761 762 763 764
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 已提交
765 766 767 768
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
bhyvexml2argvmock_la_CFLAGS = $(AM_CFLAGS)
769
bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
770
bhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
771

772 773 774 775 776 777
bhyveargv2xmlmock_la_SOURCES = \
	bhyveargv2xmlmock.c
bhyveargv2xmlmock_la_CFLAGS = $(AM_CFLAGS)
bhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
bhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)

R
Roman Bogorodskiy 已提交
778
bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
R
Roman Bogorodskiy 已提交
779 780 781
if WITH_STORAGE
bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
R
Roman Bogorodskiy 已提交
782 783 784 785 786
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
787 788 789 790 791

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
792 793 794 795 796

bhyveargv2xmltest_SOURCES = \
	bhyveargv2xmltest.c \
	testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
797
else ! WITH_BHYVE
798 799 800 801 802 803
EXTRA_DIST += \
	bhyvexml2argvtest.c \
	bhyveargv2xmltest.c \
	bhyvexml2xmltest.c \
	bhyvexml2argvmock.c \
	bhyveargv2xmlmock.c
R
Roman Bogorodskiy 已提交
804 805
endif ! WITH_BHYVE

806 807 808 809 810
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
811 812 813 814 815
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

816
if WITH_NETWORK
817 818
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
819
	testutils.c testutils.h
820
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
821 822 823 824 825 826

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

827
else ! WITH_NETWORK
828
EXTRA_DIST += networkxml2conftest.c
829
endif !	WITH_NETWORK
830

831 832 833 834
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
835
storagebackendsheepdogtest_LDADD = \
836 837 838
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_storage_backend_sheepdog_priv.la \
	$(LDADDS)
839
else ! WITH_STORAGE_SHEEPDOG
840
EXTRA_DIST += storagebackendsheepdogtest.c
841
endif ! WITH_STORAGE_SHEEPDOG
842

843 844 845 846
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
847

848 849 850 851 852
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
853 854 855 856 857 858

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

J
Ján Tomko 已提交
861 862 863 864 865
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
866 867 868 869 870
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
871

872
if WITH_STORAGE
873 874 875 876 877 878 879 880 881 882
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

883 884 885 886
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
887
	$(LIBXML_LIBS) \
888 889 890 891
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(LDADDS)
J
Ján Tomko 已提交
892

893
else ! WITH_STORAGE
894
EXTRA_DIST += storagevolxml2argvtest.c
895
EXTRA_DIST += virstorageutiltest.c
896
endif ! WITH_STORAGE
897

898 899 900 901 902
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

903 904 905 906 907
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
908 909 910
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
911
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
912

913 914 915 916 917
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

918 919 920
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
921
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Jiri Denemark 已提交
922 923 924 925
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS) $(GNULIB_LIBS)
endif WITH_QEMU
926

P
Peter Krempa 已提交
927 928 929 930 931
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

932 933 934 935 936
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

937
virconftest_SOURCES = \
938
	virconftest.c testutils.h testutils.c
939
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
940

941
virhostcputest_SOURCES = \
942
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
943
virhostcputest_LDADD = $(LDADDS)
944

945 946 947 948
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

949 950 951 952
# Must not link to any libvirt modules - libc / gnulib only
# otherwise external libraries might unexpectedly leak
# file descriptors into commandhelper invalidating the
# test logic assumptions
953 954
commandhelper_SOURCES = \
	commandhelper.c
955 956 957 958
commandhelper_LDADD = \
	$(NO_INDIRECT_LDFLAGS) \
	$(GNULIB_LIBS)

959
commandhelper_LDFLAGS = -static
960

961

962 963 964 965
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

966
vircapstest_SOURCES = \
967 968 969 970 971 972 973 974 975 976
	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
977
vircapstest_LDADD = $(qemu_LDADDS) $(LDADDS)
978

979 980 981 982 983
domaincapsmock_la_SOURCES = domaincapsmock.c
domaincapsmock_la_CFLAGS = $(AM_CFLAGS)
domaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
domaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
984 985 986 987
domaincapstest_SOURCES = \
	domaincapstest.c testutils.h testutils.c
domaincapstest_LDADD = $(LDADDS)

988 989
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
990
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
991 992
endif WITH_QEMU

993 994
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
995
domaincapstest_LDADD += ../src/libvirt_driver_libxl_impl.la $(GNULIB_LIBS)
996 997
endif WITH_LIBXL

998 999 1000 1001
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

1002 1003
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1004
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
1005
virnetmessagetest_LDADD = $(LDADDS)
1006

1007 1008
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1009
virnetsockettest_LDADD = $(LDADDS)
1010

1011 1012
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1013
	testutils.h testutils.c
1014 1015
virnetdaemontest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
virnetdaemontest_LDADD = $(LDADDS)
1016

1017 1018 1019 1020 1021 1022
virnetdaemonmock_la_SOURCES = \
	virnetdaemonmock.c
virnetdaemonmock_la_CFLAGS = $(AM_CFLAGS)
virnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)

1023 1024 1025
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
1026
virnetserverclienttest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
1027 1028 1029 1030 1031
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
virnetserverclientmock_la_CFLAGS = $(AM_CFLAGS)
1032
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1033
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1034

1035
if WITH_GNUTLS
1036
virnettlscontexttest_SOURCES = \
1037 1038 1039
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1040
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
1041 1042 1043 1044
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1045
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
1046 1047 1048
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
1049 1050
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
1051
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
1052
EXTRA_DIST += pkix_asn1_tab.c
1053 1054
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
1055
EXTRA_DIST += \
1056 1057 1058
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
1059
endif ! WITH_GNUTLS
1060

1061 1062
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1063
virtimetest_LDADD = $(LDADDS)
1064

J
Ján Tomko 已提交
1065 1066
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1067
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1068

1069 1070 1071 1072
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1073 1074
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1075 1076 1077 1078 1079 1080 1081
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)
1082

1083 1084 1085
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1086
if WITH_SELINUX
1087
viridentitytest_LDADD += $(SELINUX_LIBS)
1088 1089 1090
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1091

J
Ján Tomko 已提交
1092 1093 1094 1095
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1096 1097 1098 1099
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1100 1101 1102 1103
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1104 1105 1106 1107
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1108 1109 1110 1111
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1112
virportallocatormock_la_SOURCES = \
1113
	virportallocatormock.c
1114 1115 1116
virportallocatormock_la_CFLAGS = $(AM_CFLAGS)
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1117

1118 1119 1120 1121 1122 1123 1124
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
1125
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1126
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1127

1128 1129 1130 1131
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1132 1133 1134 1135
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1136 1137 1138 1139 1140 1141 1142
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
1143
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1144
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1145

J
John Ferlan 已提交
1146 1147 1148 1149 1150 1151
virrandommock_la_SOURCES = \
	virrandommock.c
virrandommock_la_CFLAGS = $(AM_CFLAGS)
virrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virrandommock_la_LIBADD = $(MOCKLIBS_LIBS)

1152 1153 1154 1155 1156
virhostcpumock_la_SOURCES = \
	virhostcpumock.c
virhostcpumock_la_CFLAGS = $(AM_CFLAGS)
virhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1157

P
Pavel Hrdina 已提交
1158 1159 1160 1161 1162 1163
virfilecachemock_la_SOURCES = \
	virfilecachemock.c
virfilecachemock_la_CFLAGS = $(AM_CFLAGS)
virfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)

1164 1165
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1166
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1167 1168
vircaps2xmltest_LDADD = $(LDADDS)

M
Martin Kletzander 已提交
1169 1170 1171 1172 1173
virnumamock_la_SOURCES = \
	virnumamock.c
virnumamock_la_CFLAGS = $(AM_CFLAGS)
virnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1174

1175
else ! WITH_LINUX
1176
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c virfilewrapper.h
1177
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1178

1179
if WITH_NSS
M
Michal Privoznik 已提交
1180 1181 1182
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
1183
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1184 1185
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
1186
	$(LDADDS) \
M
Michal Privoznik 已提交
1187 1188
	../tools/nss/libnss_libvirt_impl.la

1189 1190 1191
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
1192 1193
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1194 1195
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
1196
	$(LDADDS) \
1197 1198
	../tools/nss/libnss_libvirt_guest_impl.la

M
Michal Privoznik 已提交
1199 1200 1201 1202 1203 1204
nssmock_la_SOURCES = \
	nssmock.c
nssmock_la_CFLAGS = $(AM_CFLAGS)
nssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
nssmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1205 1206 1207
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
1208 1209
nsslinktest_CFLAGS = \
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1210 1211 1212 1213
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

1214
nssguestlinktest_SOURCES = nsslinktest.c
1215 1216 1217
nssguestlinktest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1218 1219 1220
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1221 1222 1223
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1224

1225 1226 1227 1228 1229 1230 1231
virdeterministichashmock_la_SOURCES = \
	virdeterministichashmock.c
virdeterministichashmock_la_CFLAGS = $(AM_CFLAGS)
virdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)

test_libraries += virdeterministichashmock.la
1232

1233
if WITH_YAJL
1234 1235
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
1236
virmacmaptest_CLFAGS = $(AM_CFLAGS)
1237 1238
virmacmaptest_LDADD = $(LDADDS)

1239 1240
test_programs += virmacmaptest
else ! WITH_YAJL
1241
EXTRA_DIST +=  virmacmaptest.c
1242 1243
endif ! WITH_YAJL

M
Michal Privoznik 已提交
1244 1245 1246 1247 1248 1249 1250 1251
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)
1252
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1253
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1254

1255 1256 1257 1258 1259
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_CFLAGS = $(AM_CFLAGS)
virrotatingfiletest_LDADD = $(LDADDS)

1260 1261 1262 1263 1264
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1265 1266 1267 1268
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1269 1270
virusbmock_la_SOURCES = virusbmock.c
virusbmock_la_CFLAGS = $(AM_CFLAGS)
1271
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1272
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1273
	$(PROBES_O) \
1274
	../src/libvirt_util.la
1275 1276 1277 1278

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
virnetdevbandwidthmock_la_CFLAGS = $(AM_CFLAGS)
1279
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1280
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1281

1282 1283 1284 1285
virtestmock_la_SOURCES = \
	virtestmock.c
virtestmock_la_CFLAGS = $(AM_CFLAGS)
virtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1286 1287
virtestmock_la_LIBADD = \
	$(MOCKLIBS_LIBS) \
1288
	$(PROBES_O) \
1289
	../src/libvirt_util.la
1290
else ! WITH_LINUX
1291
	EXTRA_DIST += virusbtest.c virusbmock.c \
1292 1293
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1294 1295
endif ! WITH_LINUX

1296 1297 1298 1299
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1300
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1301

1302 1303 1304 1305 1306
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1307

1308 1309 1310 1311 1312
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1313 1314
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1315
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1316
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1317

1318
else ! WITH_DBUS
1319
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1320
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1321

1322 1323
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1324
viruritest_LDADD = $(LDADDS)
1325

1326 1327
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1328
virkeyfiletest_LDADD = $(LDADDS)
1329

1330 1331 1332 1333
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1334 1335
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1336
virauthconfigtest_LDADD = $(LDADDS)
1337

1338
seclabeltest_SOURCES = \
1339
	seclabeltest.c testutils.h testutils.c
1340
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1341

1342
if WITH_SECDRIVER_SELINUX
1343
if WITH_ATTR
1344 1345
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1346
else ! WITH_TESTS
1347
check_LTLIBRARIES += libsecurityselinuxhelper.la
1348
endif ! WITH_TESTS
1349 1350 1351

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1352
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1353 1354 1355

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1356
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1357 1358
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1359 1360 1361 1362 1363

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1364
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(LDADDS) $(SELINUX_LIBS)
1365 1366
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1367 1368 1369
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1370 1371
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1372

1373 1374 1375 1376
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1377 1378 1379
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1380

1381
viratomictest_SOURCES = \
L
Laine Stump 已提交
1382
	viratomictest.c testutils.h testutils.c
1383 1384
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1385 1386 1387 1388
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1389 1390 1391 1392
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1393 1394 1395 1396
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1397 1398 1399 1400
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1401 1402
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1403
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1404 1405
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1406 1407 1408
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1409

M
Matthias Bolte 已提交
1410 1411 1412 1413
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1414
if WITH_LIBVIRTD
1415 1416 1417
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1418
endif WITH_LIBVIRTD
1419

1420 1421
if WITH_LIBVIRTD
eventtest_SOURCES = \
1422
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1423
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1424
endif WITH_LIBVIRTD
1425

1426 1427
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1428
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1429 1430 1431

shunloadtest_SOURCES = \
	shunloadtest.c
1432
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1433 1434
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1435 1436 1437 1438
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1439 1440 1441 1442
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1443 1444 1445 1446
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1447 1448 1449 1450 1451
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1452 1453 1454 1455 1456
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1457
if WITH_LINUX
O
Osier Yang 已提交
1458 1459 1460 1461
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1462 1463 1464 1465
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1466 1467
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1468
EXTRA_DIST += scsihosttest.c
1469 1470
endif  ! WITH_LINUX

O
Osier Yang 已提交
1471 1472 1473 1474 1475 1476 1477 1478 1479
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1480 1481 1482 1483 1484 1485
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1486
objectlocking_SOURCES = objectlocking.ml
1487 1488 1489 1490

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

1491
objectlocking: objectlocking.cmx objectlocking-files.txt
1492 1493
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1494

1495
objectlocking-files.txt:
1496 1497
	find $(top_builddir)/src/ -name '*.i' > $@

1498
else ! WITH_CIL
1499
EXTRA_DIST += objectlocking.ml
1500
endif ! WITH_CIL
1501

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