Makefile.am 37.1 KB
Newer Older
K
Karel Zak 已提交
1 2
## Process this file with automake to produce Makefile.in

3
## Copyright (C) 2005-2015 Red Hat, Inc.
E
Eric Blake 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library.  If not, see
## <http://www.gnu.org/licenses/>.
18

19 20
# old automake does not provide abs_{src,build}dir variables
abs_builddir = $(shell pwd)
21
abs_topbuilddir = $(shell cd .. && pwd)
22
abs_srcdir = $(shell cd $(srcdir) && pwd)
23
abs_topsrcdir = $(shell cd $(top_srcdir) && pwd)
24

25 26
SHELL = $(PREFERABLY_POSIX_SHELL)

K
Karel Zak 已提交
27
INCLUDES = \
28
	-I$(top_builddir) -I$(top_srcdir) \
29 30 31
	-I$(top_builddir)/gnulib/lib -I$(top_srcdir)/gnulib/lib \
	-I$(top_builddir)/include -I$(top_srcdir)/include \
	-I$(top_builddir)/src -I$(top_srcdir)/src \
32
	-I$(top_srcdir)/src/util \
33 34
	-I$(top_srcdir)/src/conf \
	$(GETTEXT_CPPFLAGS)
E
Eric Blake 已提交
35

36 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
	$(COVERAGE_CFLAGS) \
51
	$(XDR_CFLAGS) \
E
Eric Blake 已提交
52
	$(WARN_CFLAGS)
53

54 55 56
AM_LDFLAGS = \
	-export-dynamic

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

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

66 67 68
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"

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

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

K
Karel Zak 已提交
77
LDADDS = \
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
	libxlxml2domconfigdata \
104
	lxcconf2xmldata \
105
	lxcxml2xmldata \
106
	lxcxml2xmloutdata \
107 108
	networkxml2confdata \
	networkxml2firewalldata \
E
Eric Blake 已提交
109 110
	networkxml2xmlin \
	networkxml2xmlout \
J
Ján Tomko 已提交
111 112
	networkxml2xmlupdatein \
	networkxml2xmlupdateout \
E
Eric Blake 已提交
113
	nodedevschemadata \
114
	virhostcpudata \
M
Michal Privoznik 已提交
115
	nssdata \
116
	nwfilterxml2firewalldata \
E
Eric Blake 已提交
117 118 119
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
120
	qemuagentdata \
121
	qemuargv2xmldata \
122
	qemublocktestdata \
123
	qemucapabilitiesdata \
124
	qemucaps2xmldata \
125
	qemuhotplugtestcpus \
126 127
	qemuhotplugtestdevices \
	qemuhotplugtestdomains \
128
	qemumigparamsdata \
129
	qemumonitorjsondata \
E
Eric Blake 已提交
130
	qemuxml2argvdata \
131
	qemuxml2startupxmloutdata \
E
Eric Blake 已提交
132
	qemuxml2xmloutdata \
133
	qemustatusxml2xmldata \
134
	qemuqapischema.json \
135
	qemumemlockdata \
J
Ján Tomko 已提交
136
	secretxml2xmlin \
137
	securityselinuxhelperdata \
138
	securityselinuxlabeldata \
E
Eric Blake 已提交
139
	sexpr2xmldata \
140
	storagepoolschemadata \
141
	storagepoolxml2xmlin \
E
Eric Blake 已提交
142
	storagepoolxml2xmlout \
143
	storagevolschemadata \
144
	storagevolxml2argvdata \
145
	storagevolxml2xmlin \
E
Eric Blake 已提交
146
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
147
	sysinfodata \
148
	test-lib.sh \
Y
Yohan BELLEGUIC 已提交
149
	vboxsnapshotxmldata \
150
	vircaps2xmldata \
151
	vircgroupdata \
152
	virconfdata \
153
	virfiledata \
154
	virjsondata \
155
	virmacmaptestdata \
156
	virmock.h \
157
	virnetdaemondata \
158
	virnetdevtestdata \
159
	virpcitestdata \
O
Osier Yang 已提交
160
	virscsidata \
161
	virsh-uriprecedence \
162
	virusbtestdata \
163
	vmwareverdata \
164
	vmx2xmldata \
165
	xlconfigdata \
166
	xmconfigdata \
E
Eric Blake 已提交
167
	xml2sexprdata \
168 169
	xml2vmxdata \
	virstorageutildata \
170
	virfilecachedata \
M
Martin Kletzander 已提交
171
	virresctrldata \
172
	$(NULL)
K
Karel Zak 已提交
173

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

210 211 212 213 214 215 216 217 218 219
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 已提交
220
	virfilecachemock.la \
221 222
	$(NULL)

E
Eric Blake 已提交
223 224 225 226
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
227
	virnetdaemontest \
E
Eric Blake 已提交
228 229 230 231 232 233 234
	virnetserverclienttest \
	$(NULL)
if WITH_GNUTLS
test_programs += virnettlscontexttest virnettlssessiontest
endif WITH_GNUTLS
endif WITH_REMOTE

235 236
if WITH_LINUX
test_programs += fchosttest
237
test_programs += scsihosttest
238
test_programs += vircaps2xmltest
M
Martin Kletzander 已提交
239
test_programs += virresctrltest
240 241
test_libraries += virusbmock.la \
	virnetdevbandwidthmock.la \
242
	virnumamock.la \
243 244
	virtestmock.la \
	$(NULL)
245 246
endif WITH_LINUX

247 248 249 250
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

251
if WITH_DBUS
252
test_programs += virdbustest \
253 254
                 virsystemdtest \
                 $(NULL)
255
test_libraries += virdbusmock.la
J
Ján Tomko 已提交
256
if WITH_POLKIT
257
test_programs += virpolkittest
J
Ján Tomko 已提交
258
endif WITH_POLKIT
259
endif WITH_DBUS
260

261
if WITH_SECDRIVER_SELINUX
262
if WITH_ATTR
263 264
test_programs += securityselinuxtest \
                 viridentitytest
265
if WITH_QEMU
266
test_programs += securityselinuxlabeltest
267 268 269
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
270

271 272 273
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
274

275
if WITH_LIBXL
276
test_programs += xlconfigtest xml2sexprtest sexpr2xmltest \
277
	xmconfigtest libxlxml2domconfigtest
278
test_libraries += virmocklibxl.la
279 280
endif WITH_LIBXL

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

301
if WITH_LXC
302
test_programs += lxcxml2xmltest lxcconf2xmltest
303
endif WITH_LXC
304

305
if WITH_OPENVZ
306
test_programs += openvzutilstest
307
endif WITH_OPENVZ
308

309
if WITH_ESX
310
test_programs += esxutilstest
311
endif WITH_ESX
312

Y
Yohan BELLEGUIC 已提交
313 314 315 316
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

317
if WITH_VMX
318
test_programs += vmx2xmltest xml2vmxtest
319
endif WITH_VMX
320

321 322 323 324
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
325
if WITH_BHYVE
326
test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest
327
test_libraries += bhyvexml2argvmock.la bhyveargv2xmlmock.la
R
Roman Bogorodskiy 已提交
328 329
endif WITH_BHYVE

330
if WITH_CIL
331
test_programs += objectlocking
332
endif WITH_CIL
333

334
if WITH_YAJL
335
test_programs += virjsontest
336
endif WITH_YAJL
337

338 339 340 341
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
		$(NULL)
342

343
if WITH_NETWORK
344 345 346 347
test_programs += \
		networkxml2conftest \
		networkxml2firewalltest \
		$(NULL)
348
endif WITH_NETWORK
349

350 351
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
352
endif WITH_STORAGE_SHEEPDOG
353

354
test_programs += nwfilterxml2xmltest
355

356 357
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
358
test_programs += nwfilterxml2firewalltest
359 360
endif WITH_NWFILTER

361
if WITH_STORAGE
362
test_programs += storagevolxml2argvtest
363
test_programs += virstorageutiltest
364
endif WITH_STORAGE
365

366 367
if WITH_STORAGE_FS
test_programs += virstoragetest
368
endif WITH_STORAGE_FS
369

O
Osier Yang 已提交
370 371 372 373
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

374
if WITH_NSS
375 376
test_helpers += nsslinktest nssguestlinktest
test_programs += nsstest nssguesttest
377
test_libraries += nssmock.la
378 379
endif WITH_NSS

380
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
381

382
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
383

384
test_programs += interfacexml2xmltest
385

386
test_programs += cputest
387

P
Peter Krempa 已提交
388 389
test_programs += metadatatest

J
Ján Tomko 已提交
390 391
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
392 393
test_programs += genericxml2xmltest

394
if WITH_LINUX
395 396 397
test_programs += virusbtest \
	virnetdevbandwidthtest \
	$(NULL)
398 399
endif WITH_LINUX

J
Ján Tomko 已提交
400
test_scripts =
401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416
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 \
417
	$(NULL)
418

419 420 421
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

422
test_programs += \
423 424
	eventtest \
	virdrivermoduletest
425
else ! WITH_LIBVIRTD
426
EXTRA_DIST += $(libvirtd_test_scripts)
427
endif ! WITH_LIBVIRTD
428

429 430
test_programs += objecteventtest

J
Jamie Strandboge 已提交
431
if WITH_SECDRIVER_APPARMOR
432
if WITH_LIBVIRTD
J
Jamie Strandboge 已提交
433
test_scripts += virt-aa-helper-test
434 435
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
436 437
EXTRA_DIST += virt-aa-helper-test

438 439
EXTRA_DIST += $(test_scripts)

440 441 442 443 444 445 446 447 448 449 450 451 452
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

453 454
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
455
noinst_LTLIBRARIES = $(test_libraries)
456
else ! WITH_TESTS
457
check_PROGRAMS = $(test_programs) $(test_helpers)
458
check_LTLIBRARIES = $(test_libraries)
459
endif ! WITH_TESTS
460

461 462
TESTS = $(test_programs) \
	$(test_scripts)
463

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

470
lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd)
471

472
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
473 474 475 476 477 478 479
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)" \
480
  LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \
481 482 483
  LIBVIRT_AUTOSTART=0 \
  LC_ALL=C \
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \
484 485
  $(VG)

486

487 488
VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \
	--trace-children-skip="*/tools/virsh","*/tests/commandhelper" \
489
	--suppressions=$(srcdir)/.valgrind.supp
490
valgrind:
491
	$(MAKE) check VG="$(LIBTOOL) --mode=execute $(VALGRIND)"
492

493 494 495
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
496
sockettest_LDADD = $(LDADDS)
497

498 499
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
500 501 502
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
503 504 505 506 507 508
libxl_LDADDS += $(LDADDS)

xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
509

510 511 512 513 514
xml2sexprtest_SOURCES = \
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xml2sexprtest_LDADD = $(libxl_LDADDS)

515 516 517 518 519
sexpr2xmltest_SOURCES = \
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
sexpr2xmltest_LDADD = $(libxl_LDADDS)

520 521 522 523 524
xmconfigtest_SOURCES = \
	xmconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xmconfigtest_LDADD = $(libxl_LDADDS)

525 526 527 528 529 530 531
libxlxml2domconfigtest_SOURCES = \
	libxlxml2domconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
libxlxml2domconfigtest_LDADD = $(libxl_LDADDS) $(LIBXML_LIBS)

virmocklibxl_la_SOURCES = \
	virmocklibxl.c
532
virmocklibxl_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS)
533 534 535
virmocklibxl_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virmocklibxl_la_LIBADD = $(MOCKLIBS_LIBS)

536
else ! WITH_LIBXL
537
EXTRA_DIST += xlconfigtest.c xml2sexprtest.c sexpr2xmltest.c \
538
	xmconfigtest.c libxlxml2domconfigtest.c
539 540
endif ! WITH_LIBXL

541 542 543
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
544
	testutilsqemuschema.h testutilsqemuschema.c \
545 546
	$(NULL)

547
if WITH_QEMU
548

549 550
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

551
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
552
if WITH_NETWORK
E
Eric Blake 已提交
553
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
554
endif WITH_NETWORK
555 556 557
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
558
if WITH_DTRACE_PROBES
559
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
560
endif WITH_DTRACE_PROBES
561

562 563 564 565
libqemutestdriver_la_SOURCES =
libqemutestdriver_la_LDFLAGS = $(QEMULIB_LDFLAGS)
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)

566
qemucpumock_la_SOURCES = \
567
	qemucpumock.c testutilshostcpus.h
568 569 570
qemucpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
qemucpumock_la_LIBADD = $(MOCKLIBS_LIBS)

571
qemuxml2argvtest_SOURCES = \
572
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
573
	testutils.c testutils.h
574 575
qemuxml2argvtest_LDADD = libqemutestdriver.la \
	$(LDADDS) $(LIBXML_LIBS)
576

577 578
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
579
qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
580
qemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
581

582
qemuxml2xmltest_SOURCES = \
583
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
584
	testutils.c testutils.h
585
qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
586 587 588 589

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
590
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
591

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

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

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

J
Jiri Denemark 已提交
615 616 617 618 619 620 621 622 623 624
qemucapsprobe_SOURCES = \
	qemucapsprobe.c
qemucapsprobe_LDADD = \
	libqemutestdriver.la $(LDADDS)

qemucapsprobemock_la_SOURCES = \
	qemucapsprobemock.c
qemucapsprobemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
qemucapsprobemock_la_LIBADD = $(MOCKLIBS_LIBS)

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

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

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

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

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

658
qemublocktest_SOURCES = \
659 660
	qemublocktest.c \
	testutils.h testutils.c \
661
	testutilsqemu.h testutilsqemu.c \
662 663
	$(NULL)
qemublocktest_LDADD = \
664
	libqemumonitortestutils.la \
665 666 667
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(qemu_LDADDS) \
668
	$(LDADDS) \
669 670
	$(NULL)

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 682 683 684 685 686 687 688 689

qemumigparamstest_SOURCES = \
	qemumigparamstest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemumigparamstest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)

690
else ! WITH_QEMU
691
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
J
Ján Tomko 已提交
692
	domainsnapshotxml2xmltest.c \
693
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
694
	testutilsqemuschema.c testutilsqemuschema.h \
695
	qemumonitorjsontest.c qemuhotplugtest.c \
696
	qemuagenttest.c qemucapabilitiestest.c \
697
	qemucaps2xmltest.c qemucommandutiltest.c \
698
	qemumemlocktest.c qemucpumock.c testutilshostcpus.h \
699
	qemublocktest.c \
700
	qemumigparamstest.c \
701
	$(QEMUMONITORTESTUTILS_SOURCES)
702
endif ! WITH_QEMU
703

704 705
if WITH_LXC

E
Eric Blake 已提交
706
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
707
if WITH_NETWORK
E
Eric Blake 已提交
708
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
709
endif WITH_NETWORK
710
lxc_LDADDS += $(LDADDS)
711 712 713 714

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
715
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
716 717

lxcconf2xmltest_SOURCES = \
718
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
719 720
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
721
else ! WITH_LXC
722
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
723
endif ! WITH_LXC
724

725 726 727 728
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
729
openvzutilstest_LDADD = $(LDADDS)
730
else ! WITH_OPENVZ
731
EXTRA_DIST += openvzutilstest.c
732
endif ! WITH_OPENVZ
733 734
EXTRA_DIST += openvzutilstest.conf

735 736 737 738
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
739
esxutilstest_LDADD = $(LDADDS)
740
else ! WITH_ESX
741
EXTRA_DIST += esxutilstest.c
742
endif ! WITH_ESX
743

Y
Yohan BELLEGUIC 已提交
744 745 746 747 748 749 750 751 752 753
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

754
if WITH_VMX
755 756 757
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
758
vmx2xmltest_LDADD = $(LDADDS)
759 760 761 762

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
763
xml2vmxtest_LDADD = $(LDADDS)
764
else ! WITH_VMX
765
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
766
endif ! WITH_VMX
767

768 769 770 771 772 773 774 775 776
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 已提交
777 778 779
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
780
bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
781
bhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
782

783 784 785 786 787
bhyveargv2xmlmock_la_SOURCES = \
	bhyveargv2xmlmock.c
bhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
bhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)

R
Roman Bogorodskiy 已提交
788
bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
R
Roman Bogorodskiy 已提交
789 790 791
if WITH_STORAGE
bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
R
Roman Bogorodskiy 已提交
792 793 794 795 796
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
797 798 799 800 801

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
802 803 804 805 806

bhyveargv2xmltest_SOURCES = \
	bhyveargv2xmltest.c \
	testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
807
else ! WITH_BHYVE
808 809 810 811 812 813
EXTRA_DIST += \
	bhyvexml2argvtest.c \
	bhyveargv2xmltest.c \
	bhyvexml2xmltest.c \
	bhyvexml2argvmock.c \
	bhyveargv2xmlmock.c
R
Roman Bogorodskiy 已提交
814 815
endif ! WITH_BHYVE

816 817 818 819 820
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
821 822 823 824 825
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

826
if WITH_NETWORK
827 828
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
829
	testutils.c testutils.h
830
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
831 832 833 834 835 836

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

837
else ! WITH_NETWORK
838
EXTRA_DIST += networkxml2conftest.c
839
endif !	WITH_NETWORK
840

841 842 843 844
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
845
storagebackendsheepdogtest_LDADD = \
846
	../src/libvirt_storage_backend_sheepdog_priv.la \
847
	../src/libvirt_driver_storage_impl.la \
848
	$(LDADDS)
849
else ! WITH_STORAGE_SHEEPDOG
850
EXTRA_DIST += storagebackendsheepdogtest.c
851
endif ! WITH_STORAGE_SHEEPDOG
852

853 854 855 856
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
857

858 859 860 861 862
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
863 864 865 866 867 868

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

J
Ján Tomko 已提交
871 872 873 874 875
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
876 877 878 879 880
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
881

882
if WITH_STORAGE
883 884 885 886 887 888 889 890 891 892
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

893 894 895 896
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
897
	$(LIBXML_LIBS) \
898 899 900 901
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(LDADDS)
J
Ján Tomko 已提交
902

903
else ! WITH_STORAGE
904
EXTRA_DIST += storagevolxml2argvtest.c
905
EXTRA_DIST += virstorageutiltest.c
906
endif ! WITH_STORAGE
907

908 909 910 911 912
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

913 914 915 916 917
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
918 919 920
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
921
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
922

923 924 925 926 927
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

928 929 930
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
931
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Jiri Denemark 已提交
932 933 934 935
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS) $(GNULIB_LIBS)
endif WITH_QEMU
936

P
Peter Krempa 已提交
937 938 939 940 941
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

942 943 944 945 946
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

947
virconftest_SOURCES = \
948
	virconftest.c testutils.h testutils.c
949
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
950

951
virhostcputest_SOURCES = \
952
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
953
virhostcputest_LDADD = $(LDADDS)
954

955 956 957 958
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

959 960 961 962
# 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
963 964
commandhelper_SOURCES = \
	commandhelper.c
965 966 967 968
commandhelper_LDADD = \
	$(NO_INDIRECT_LDFLAGS) \
	$(GNULIB_LIBS)

969
commandhelper_LDFLAGS = -static
970

971

972 973 974 975
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

976
vircapstest_SOURCES = \
977 978 979 980 981 982 983
	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
984
vircapstest_LDADD = $(qemu_LDADDS) $(LDADDS)
985

986 987 988 989
domaincapsmock_la_SOURCES = domaincapsmock.c
domaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
domaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
990 991 992 993
domaincapstest_SOURCES = \
	domaincapstest.c testutils.h testutils.c
domaincapstest_LDADD = $(LDADDS)

994 995
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
996
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
997 998
endif WITH_QEMU

999 1000
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
1001
domaincapstest_LDADD += ../src/libvirt_driver_libxl_impl.la $(GNULIB_LIBS)
1002 1003
endif WITH_LIBXL

1004 1005 1006 1007
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

1008 1009
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1010
virnetmessagetest_LDADD = $(LDADDS)
1011

1012 1013
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1014
virnetsockettest_LDADD = $(LDADDS)
1015

1016 1017
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1018
	testutils.h testutils.c
1019
virnetdaemontest_LDADD = $(LDADDS)
1020

1021 1022 1023 1024 1025
virnetdaemonmock_la_SOURCES = \
	virnetdaemonmock.c
virnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)

1026 1027 1028 1029 1030 1031 1032
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
1033
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1034
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1035

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

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

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

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

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

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

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

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

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

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

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

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

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

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
1124
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1125
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1126

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

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

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

virpcimock_la_SOURCES = \
	virpcimock.c
1141
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1142
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1143

J
John Ferlan 已提交
1144 1145 1146 1147 1148
virrandommock_la_SOURCES = \
	virrandommock.c
virrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virrandommock_la_LIBADD = $(MOCKLIBS_LIBS)

1149 1150 1151 1152
virhostcpumock_la_SOURCES = \
	virhostcpumock.c
virhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1153

P
Pavel Hrdina 已提交
1154 1155 1156 1157 1158
virfilecachemock_la_SOURCES = \
	virfilecachemock.c
virfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)

1159 1160
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1161
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1162 1163
vircaps2xmltest_LDADD = $(LDADDS)

M
Martin Kletzander 已提交
1164 1165 1166 1167
virnumamock_la_SOURCES = \
	virnumamock.c
virnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1168

M
Martin Kletzander 已提交
1169 1170 1171 1172
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

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

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

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

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

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

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

1223 1224 1225 1226 1227 1228
virdeterministichashmock_la_SOURCES = \
	virdeterministichashmock.c
virdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)

test_libraries += virdeterministichashmock.la
1229

1230
if WITH_YAJL
1231 1232 1233 1234
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

1235 1236
test_programs += virmacmaptest
else ! WITH_YAJL
1237
EXTRA_DIST +=  virmacmaptest.c
1238 1239
endif ! WITH_YAJL

M
Michal Privoznik 已提交
1240 1241 1242 1243 1244 1245 1246 1247
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)
1248
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1249
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1250

1251 1252 1253 1254
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

1255 1256 1257 1258 1259
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1260 1261 1262 1263
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1264
virusbmock_la_SOURCES = virusbmock.c
1265
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1266
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1267
	$(PROBES_O) \
1268
	../src/libvirt_util.la
1269 1270 1271

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
1272
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1273
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1274

1275 1276 1277
virtestmock_la_SOURCES = \
	virtestmock.c
virtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1278 1279
virtestmock_la_LIBADD = \
	$(MOCKLIBS_LIBS) \
1280
	$(PROBES_O) \
1281
	../src/libvirt_util.la
1282
else ! WITH_LINUX
1283
	EXTRA_DIST += virusbtest.c virusbmock.c \
1284 1285
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1286 1287
endif ! WITH_LINUX

1288 1289 1290 1291
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1292
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1293

1294 1295 1296 1297 1298
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1299

1300 1301 1302 1303 1304
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1305 1306
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1307
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1308
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1309

1310
else ! WITH_DBUS
1311
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1312
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1313

1314 1315
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1316
viruritest_LDADD = $(LDADDS)
1317

1318 1319
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1320
virkeyfiletest_LDADD = $(LDADDS)
1321

1322 1323 1324 1325
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1326 1327
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1328
virauthconfigtest_LDADD = $(LDADDS)
1329

1330
seclabeltest_SOURCES = \
1331
	seclabeltest.c testutils.h testutils.c
1332
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1333

1334
if WITH_SECDRIVER_SELINUX
1335
if WITH_ATTR
1336 1337
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1338
else ! WITH_TESTS
1339
check_LTLIBRARIES += libsecurityselinuxhelper.la
1340
endif ! WITH_TESTS
1341 1342 1343

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1344
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1345 1346 1347

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1348
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1349 1350
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1351 1352 1353 1354 1355

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1356
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(LDADDS) $(SELINUX_LIBS)
1357 1358
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1359 1360 1361
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1362 1363
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1364

1365 1366 1367 1368
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1369 1370 1371
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1372

1373
viratomictest_SOURCES = \
L
Laine Stump 已提交
1374
	viratomictest.c testutils.h testutils.c
1375 1376
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1377 1378 1379 1380
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1381 1382 1383 1384
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1385 1386 1387 1388
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1389 1390 1391 1392
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1393 1394
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1395
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1396 1397
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1398 1399 1400
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1401

M
Matthias Bolte 已提交
1402 1403 1404 1405
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1406
if WITH_LIBVIRTD
1407 1408 1409
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1410
endif WITH_LIBVIRTD
1411

1412 1413
if WITH_LIBVIRTD
eventtest_SOURCES = \
1414
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1415
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1416
endif WITH_LIBVIRTD
1417

1418 1419
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1420
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1421 1422 1423

shunloadtest_SOURCES = \
	shunloadtest.c
1424
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1425 1426
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1427 1428 1429 1430
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1431 1432 1433 1434
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1435 1436 1437 1438
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1439 1440 1441 1442 1443
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1444 1445 1446 1447 1448
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1449
if WITH_LINUX
O
Osier Yang 已提交
1450 1451 1452 1453
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1454 1455 1456 1457
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1458 1459
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1460
EXTRA_DIST += scsihosttest.c
1461 1462
endif  ! WITH_LINUX

O
Osier Yang 已提交
1463 1464 1465 1466 1467 1468 1469 1470 1471
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1472 1473 1474 1475 1476 1477
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1478
objectlocking_SOURCES = objectlocking.ml
1479 1480 1481 1482

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

1483
objectlocking: objectlocking.cmx objectlocking-files.txt
1484 1485
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1486

1487
objectlocking-files.txt:
1488 1489
	find $(top_builddir)/src/ -name '*.i' > $@

1490
else ! WITH_CIL
1491
EXTRA_DIST += objectlocking.ml
1492
endif ! WITH_CIL
1493

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