Makefile.am 38.5 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)

27
AM_CPPFLAGS = \
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
	-I$(top_srcdir)/src/conf \
34
	$(NULL)
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
DRIVERLIB_LDFLAGS = \
62 63 64 65
	-avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
	$(MINGW_EXTRA_LDFLAGS)

66
AM_CPPFLAGS += \
67 68
	-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
MOCKLIBS_LIBS = \
84 85
	$(GNULIB_LIBS) \
	../src/libvirt.la
86

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

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

215 216 217 218 219 220 221 222 223 224
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 已提交
225
	virfilecachemock.la \
226 227
	$(NULL)

E
Eric Blake 已提交
228 229 230 231
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
232
	virnetdaemontest \
E
Eric Blake 已提交
233
	virnetserverclienttest \
234 235
	virnettlscontexttest \
	virnettlssessiontest \
E
Eric Blake 已提交
236 237 238
	$(NULL)
endif WITH_REMOTE

239 240
if WITH_LINUX
test_programs += fchosttest
241
test_programs += scsihosttest
242
test_programs += vircaps2xmltest
M
Martin Kletzander 已提交
243
test_programs += virresctrltest
244 245
test_libraries += virusbmock.la \
	virnetdevbandwidthmock.la \
246
	virnumamock.la \
247
	virtestmock.la \
248
	virfilemock.la \
249
	$(NULL)
250 251
endif WITH_LINUX

252 253 254 255
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

256
if WITH_DBUS
257
test_programs += virdbustest \
258 259
                 virsystemdtest \
                 $(NULL)
260
test_libraries += virdbusmock.la
J
Ján Tomko 已提交
261
if WITH_POLKIT
262
test_programs += virpolkittest
J
Ján Tomko 已提交
263
endif WITH_POLKIT
264
endif WITH_DBUS
265

266
if WITH_SECDRIVER_SELINUX
267
if WITH_ATTR
268 269
test_programs += securityselinuxtest \
                 viridentitytest
270
if WITH_QEMU
271
test_programs += securityselinuxlabeltest
272 273 274
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
275

276 277 278
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
279

280
if WITH_LIBXL
281
test_programs += xlconfigtest xml2sexprtest sexpr2xmltest \
282
	xmconfigtest libxlxml2domconfigtest
283
test_libraries += libxltestdriver.la libxlmock.la
284 285
endif WITH_LIBXL

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

308
if WITH_LXC
309
test_programs += lxcxml2xmltest lxcconf2xmltest
310
endif WITH_LXC
311

312
if WITH_OPENVZ
313
test_programs += openvzutilstest
314
endif WITH_OPENVZ
315

316
if WITH_ESX
317
test_programs += esxutilstest
318
endif WITH_ESX
319

Y
Yohan BELLEGUIC 已提交
320 321 322 323
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

324
if WITH_VMX
325
test_programs += vmx2xmltest xml2vmxtest
326
endif WITH_VMX
327

328 329 330 331
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
332
if WITH_BHYVE
333
test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest
334
test_libraries += bhyvexml2argvmock.la bhyveargv2xmlmock.la
R
Roman Bogorodskiy 已提交
335 336
endif WITH_BHYVE

337
if WITH_CIL
338
test_programs += objectlocking
339
endif WITH_CIL
340

341
if WITH_YAJL
342
test_programs += virjsontest
343
endif WITH_YAJL
344

345 346 347 348
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
		$(NULL)
349

350
if WITH_NETWORK
351 352 353 354
test_programs += \
		networkxml2conftest \
		networkxml2firewalltest \
		$(NULL)
355
endif WITH_NETWORK
356

357 358
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
359
endif WITH_STORAGE_SHEEPDOG
360

361
test_programs += nwfilterxml2xmltest
362
test_programs += virnwfilterbindingxml2xmltest
363

364 365
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
366
test_programs += nwfilterxml2firewalltest
367 368
endif WITH_NWFILTER

369
if WITH_STORAGE
370
test_programs += storagevolxml2argvtest
371
test_programs += storagepoolxml2argvtest
372
test_programs += virstorageutiltest
373
test_programs += storagepoolxml2xmltest
374
test_programs += storagepoolcapstest
375
endif WITH_STORAGE
376

377 378
if WITH_STORAGE_FS
test_programs += virstoragetest
379
endif WITH_STORAGE_FS
380

O
Osier Yang 已提交
381 382 383 384
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

385
if WITH_NSS
386 387
test_helpers += nsslinktest nssguestlinktest
test_programs += nsstest nssguesttest
388
test_libraries += nssmock.la
389 390
endif WITH_NSS

391
test_programs += storagevolxml2xmltest
392

393
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
394

395
test_programs += interfacexml2xmltest
396

397
test_programs += cputest
398

P
Peter Krempa 已提交
399 400
test_programs += metadatatest

J
Ján Tomko 已提交
401 402
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
403 404
test_programs += genericxml2xmltest

405
if WITH_LINUX
406 407 408
test_programs += virusbtest \
	virnetdevbandwidthtest \
	$(NULL)
409 410
endif WITH_LINUX

J
Ján Tomko 已提交
411
test_scripts =
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427
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 \
428
	$(NULL)
429

430 431 432
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

433
test_programs += \
434 435
	eventtest \
	virdrivermoduletest
436
else ! WITH_LIBVIRTD
437
EXTRA_DIST += $(libvirtd_test_scripts)
438
endif ! WITH_LIBVIRTD
439

440 441
test_programs += objecteventtest

J
Jamie Strandboge 已提交
442
if WITH_SECDRIVER_APPARMOR
443
if WITH_LIBVIRTD
J
Jamie Strandboge 已提交
444
test_scripts += virt-aa-helper-test
445 446
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
447 448
EXTRA_DIST += virt-aa-helper-test

449 450
EXTRA_DIST += $(test_scripts)

451 452 453 454 455 456 457 458 459 460 461 462 463
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

464 465
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
466
noinst_LTLIBRARIES = $(test_libraries)
467
else ! WITH_TESTS
468
check_PROGRAMS = $(test_programs) $(test_helpers)
469
check_LTLIBRARIES = $(test_libraries)
470
endif ! WITH_TESTS
471

472 473
TESTS = $(test_programs) \
	$(test_scripts)
474

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

481
lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd)
482

483
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
484 485 486 487 488 489 490
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)" \
491
  LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \
492 493 494
  LIBVIRT_AUTOSTART=0 \
  LC_ALL=C \
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \
495 496
  $(VG)

497

498 499
VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \
	--trace-children-skip="*/tools/virsh","*/tests/commandhelper" \
500
	--suppressions=$(abs_srcdir)/.valgrind.supp
501
valgrind:
502
	$(MAKE) check VG="$(LIBTOOL) --mode=execute $(VALGRIND)"
503

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

509 510
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
511 512 513
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
514 515
libxl_LDADDS += $(LDADDS)

516 517 518 519
libxltestdriver_la_SOURCES =
libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
libxltestdriver_la_LIBADD = $(libxl_LDADDS)

520 521 522 523
xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
524

525 526 527 528 529
xml2sexprtest_SOURCES = \
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xml2sexprtest_LDADD = $(libxl_LDADDS)

530 531 532 533 534
sexpr2xmltest_SOURCES = \
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
sexpr2xmltest_LDADD = $(libxl_LDADDS)

535 536 537 538 539
xmconfigtest_SOURCES = \
	xmconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xmconfigtest_LDADD = $(libxl_LDADDS)

540 541 542 543 544
libxlxml2domconfigtest_SOURCES = \
	libxlxml2domconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
libxlxml2domconfigtest_LDADD = $(libxl_LDADDS) $(LIBXML_LIBS)

545 546 547 548 549
libxlmock_la_SOURCES = \
	libxlmock.c
libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS)
libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libxlmock_la_LIBADD = $(MOCKLIBS_LIBS)
550

551
else ! WITH_LIBXL
552
EXTRA_DIST += xlconfigtest.c xml2sexprtest.c sexpr2xmltest.c \
553
	xmconfigtest.c libxlxml2domconfigtest.c
554 555
endif ! WITH_LIBXL

556 557 558
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
559
	testutilsqemuschema.h testutilsqemuschema.c \
560 561
	$(NULL)

562
if WITH_QEMU
563

564 565
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

577
libqemutestdriver_la_SOURCES =
578
libqemutestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
579 580
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)

581
qemucpumock_la_SOURCES = \
582
	qemucpumock.c testutilshostcpus.h
583 584 585
qemucpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
qemucpumock_la_LIBADD = $(MOCKLIBS_LIBS)

586
qemuxml2argvtest_SOURCES = \
587
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
588
	testutils.c testutils.h
589 590
qemuxml2argvtest_LDADD = libqemutestdriver.la \
	$(LDADDS) $(LIBXML_LIBS)
591

592 593
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
594
qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
595
qemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
596

597
qemuxml2xmltest_SOURCES = \
598
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
599
	testutils.c testutils.h
600
qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
601 602 603 604

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
605
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
606

607 608 609 610 611
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
612 613
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
614

615 616 617 618 619
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
620 621
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
622

J
Jiri Denemark 已提交
623 624 625 626 627 628 629 630 631 632
qemucapsprobe_SOURCES = \
	qemucapsprobe.c
qemucapsprobe_LDADD = \
	libqemutestdriver.la $(LDADDS)

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

633 634 635 636 637 638 639 640
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)

641 642 643 644
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
	$(NULL)
645
qemucaps2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
646

P
Pavel Hrdina 已提交
647 648
qemucaps2xmlmock_la_SOURCES = \
	qemucaps2xmlmock.c
649
qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
650
qemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
651

P
Peter Krempa 已提交
652 653 654 655 656
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
657
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
P
Peter Krempa 已提交
658

659 660 661 662 663
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
664
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
665

666
qemublocktest_SOURCES = \
667 668
	qemublocktest.c \
	testutils.h testutils.c \
669
	testutilsqemu.h testutilsqemu.c \
670 671
	$(NULL)
qemublocktest_LDADD = \
672
	libqemumonitortestutils.la \
673 674 675
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(qemu_LDADDS) \
676
	$(LDADDS) \
677 678
	$(NULL)

679 680 681
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
682
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
683 684 685 686 687 688

qemumemlocktest_SOURCES = \
	qemumemlocktest.c \
	testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemumemlocktest_LDADD = $(qemu_LDADDS) $(LDADDS)
689 690 691 692 693 694 695 696 697

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

698 699 700 701 702 703 704
qemusecuritytest_SOURCES = \
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
	testutils.h testutils.c \
	testutilsqemu.h testutilsqemu.c
qemusecuritytest_LDADD = $(qemu_LDADDS) $(LDADDS)

705 706 707 708 709 710
qemufirmwaretest_SOURCES = \
	qemufirmwaretest.c \
	testutils.h testutils.c \
	$(NULL)
qemufirmwaretest_LDADD = $(qemu_LDADDS) $(LDADDS)

711
else ! WITH_QEMU
712
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
J
Ján Tomko 已提交
713
	domainsnapshotxml2xmltest.c \
P
Peter Krempa 已提交
714
	testutilsqemu.c testutilsqemu.h \
715
	testutilsqemuschema.c testutilsqemuschema.h \
716
	qemumonitorjsontest.c qemuhotplugtest.c \
717
	qemuagenttest.c qemucapabilitiestest.c \
718
	qemucaps2xmltest.c qemucommandutiltest.c \
719
	qemumemlocktest.c qemucpumock.c testutilshostcpus.h \
720
	qemublocktest.c \
721
	qemumigparamstest.c \
722 723
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
724
	qemufirmwaretest.c \
725
	$(QEMUMONITORTESTUTILS_SOURCES)
726
endif ! WITH_QEMU
727

728 729
if WITH_LXC

E
Eric Blake 已提交
730
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
731
if WITH_NETWORK
E
Eric Blake 已提交
732
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
733
endif WITH_NETWORK
734
lxc_LDADDS += $(LDADDS)
735 736 737 738

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
739
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
740 741

lxcconf2xmltest_SOURCES = \
742
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
743 744
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
745
else ! WITH_LXC
746
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
747
endif ! WITH_LXC
748

749 750 751 752
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
753
openvzutilstest_LDADD = $(LDADDS)
754
else ! WITH_OPENVZ
755
EXTRA_DIST += openvzutilstest.c
756
endif ! WITH_OPENVZ
757 758
EXTRA_DIST += openvzutilstest.conf

759 760 761 762
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
763
esxutilstest_LDADD = $(LDADDS)
764
else ! WITH_ESX
765
EXTRA_DIST += esxutilstest.c
766
endif ! WITH_ESX
767

Y
Yohan BELLEGUIC 已提交
768 769 770 771 772 773 774 775 776 777
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

778
if WITH_VMX
779 780 781
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
782
vmx2xmltest_LDADD = $(LDADDS)
783 784 785 786

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
787
xml2vmxtest_LDADD = $(LDADDS)
788
else ! WITH_VMX
789
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
790
endif ! WITH_VMX
791

792 793 794 795 796 797 798 799 800
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 已提交
801 802 803
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
804
bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
805
bhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
806

807 808 809 810 811
bhyveargv2xmlmock_la_SOURCES = \
	bhyveargv2xmlmock.c
bhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
bhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)

R
Roman Bogorodskiy 已提交
812
bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
R
Roman Bogorodskiy 已提交
813 814 815
if WITH_STORAGE
bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
R
Roman Bogorodskiy 已提交
816 817 818 819 820
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
821 822 823 824 825

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
826 827 828 829 830

bhyveargv2xmltest_SOURCES = \
	bhyveargv2xmltest.c \
	testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
831
else ! WITH_BHYVE
832 833 834 835 836 837
EXTRA_DIST += \
	bhyvexml2argvtest.c \
	bhyveargv2xmltest.c \
	bhyvexml2xmltest.c \
	bhyvexml2argvmock.c \
	bhyveargv2xmlmock.c
R
Roman Bogorodskiy 已提交
838 839
endif ! WITH_BHYVE

840 841 842 843 844
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
845 846 847 848 849
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

850
if WITH_NETWORK
851 852
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
853
	testutils.c testutils.h
854
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
855 856 857 858 859 860

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

861
else ! WITH_NETWORK
862
EXTRA_DIST += networkxml2conftest.c
863
endif !	WITH_NETWORK
864

865 866 867 868
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
869
storagebackendsheepdogtest_LDADD = \
870
	../src/libvirt_storage_backend_sheepdog_priv.la \
871
	../src/libvirt_driver_storage_impl.la \
872
	$(LDADDS)
873
else ! WITH_STORAGE_SHEEPDOG
874
EXTRA_DIST += storagebackendsheepdogtest.c
875
endif ! WITH_STORAGE_SHEEPDOG
876

877 878 879 880
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
881

882 883 884 885 886
virnwfilterbindingxml2xmltest_SOURCES = \
	virnwfilterbindingxml2xmltest.c \
	testutils.c testutils.h
virnwfilterbindingxml2xmltest_LDADD = $(LDADDS)

887 888 889 890 891
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
892 893 894 895 896 897

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

J
Ján Tomko 已提交
900 901 902 903 904
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
905 906 907 908 909
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
910

911
if WITH_STORAGE
912 913 914 915 916 917 918 919 920 921
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

922 923 924 925
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
926
	$(LIBXML_LIBS) \
927 928 929 930
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(LDADDS)
J
Ján Tomko 已提交
931

932 933 934 935 936 937 938 939 940 941
storagepoolxml2argvtest_SOURCES = \
    storagepoolxml2argvtest.c \
    testutils.c testutils.h
storagepoolxml2argvtest_LDADD = \
	$(LIBXML_LIBS) \
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(LDADDS)

942 943 944 945 946 947 948
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS) \
	../src/libvirt_driver_storage_impl.la \
	$(GNULIB_LIBS)

949 950 951 952
storagepoolcapstest_SOURCES = \
        storagepoolcapstest.c testutils.h testutils.c
storagepoolcapstest_LDADD = $(LDADDS)

953
else ! WITH_STORAGE
954
EXTRA_DIST += storagevolxml2argvtest.c
955
EXTRA_DIST += virstorageutiltest.c
956
EXTRA_DIST += storagepoolxml2argvtest.c
957
EXTRA_DIST += storagepoolxml2xmltest.c
958
EXTRA_DIST += storagepoolcapstest.c
959
endif ! WITH_STORAGE
960

961 962 963 964 965
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
966 967 968
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
969
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
970

971 972 973 974 975
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

976 977 978
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
979
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Jiri Denemark 已提交
980 981 982 983
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS) $(GNULIB_LIBS)
endif WITH_QEMU
984

P
Peter Krempa 已提交
985 986 987 988 989
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

990 991 992 993 994
virerrortest_SOURCES = \
	virerrortest.c \
	testutils.c testutils.h
virerrortest_LDADD = $(LDADDS)

S
Simon Kobyda 已提交
995 996 997 998 999 1000 1001
vshtabletest_SOURCES = \
	vshtabletest.c \
	testutils.c testutils.h
vshtabletest_LDADD = \
	$(LDADDS) \
	../tools/libvirt_shell.la

1002 1003 1004 1005 1006
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

1007
virconftest_SOURCES = \
1008
	virconftest.c testutils.h testutils.c
1009
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
1010

1011
virhostcputest_SOURCES = \
1012
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1013
virhostcputest_LDADD = $(LDADDS)
1014

1015 1016 1017 1018
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

1019 1020 1021 1022
# 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
1023 1024
commandhelper_SOURCES = \
	commandhelper.c
1025 1026 1027 1028
commandhelper_LDADD = \
	$(NO_INDIRECT_LDFLAGS) \
	$(GNULIB_LIBS)

1029
commandhelper_LDFLAGS = -static
1030

1031

1032 1033 1034 1035
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

1036
vircapstest_SOURCES = \
1037 1038 1039 1040 1041 1042 1043
	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
1044
vircapstest_LDADD = $(qemu_LDADDS) $(LDADDS)
1045

1046 1047 1048 1049
domaincapsmock_la_SOURCES = domaincapsmock.c
domaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
domaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1050 1051 1052 1053
domaincapstest_SOURCES = \
	domaincapstest.c testutils.h testutils.c
domaincapstest_LDADD = $(LDADDS)

1054 1055
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
1056
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
1057 1058
endif WITH_QEMU

1059 1060
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
1061
domaincapstest_LDADD += libxltestdriver.la $(GNULIB_LIBS)
1062 1063
endif WITH_LIBXL

1064 1065 1066 1067
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

1068 1069
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1070
virnetmessagetest_LDADD = $(LDADDS)
1071

1072 1073
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1074
virnetsockettest_LDADD = $(LDADDS)
1075

1076 1077
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1078
	testutils.h testutils.c
1079
virnetdaemontest_LDADD = $(LDADDS)
1080

1081 1082 1083 1084 1085
virnetdaemonmock_la_SOURCES = \
	virnetdaemonmock.c
virnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)

1086 1087 1088 1089 1090 1091 1092
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
1093
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1094
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1095

1096
virnettlscontexttest_SOURCES = \
1097 1098 1099
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1100
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
1101 1102 1103 1104
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1105
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
1106 1107 1108
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
1109 1110
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
1111
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
1112
EXTRA_DIST += pkix_asn1_tab.c
1113
endif ! HAVE_LIBTASN1
1114

1115 1116
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1117
virtimetest_LDADD = $(LDADDS)
1118

J
Ján Tomko 已提交
1119 1120
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1121
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1122

1123 1124 1125 1126
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1127 1128
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1129 1130 1131 1132 1133 1134 1135
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)
1136

1137 1138 1139
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1140
if WITH_SELINUX
1141
viridentitytest_LDADD += $(SELINUX_LIBS)
1142 1143 1144
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1145

J
Ján Tomko 已提交
1146 1147 1148 1149
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1150 1151 1152 1153
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1154 1155 1156 1157
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1158 1159 1160 1161
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1162 1163 1164 1165
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1166
virportallocatormock_la_SOURCES = \
1167
	virportallocatormock.c
1168 1169
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1170

1171 1172 1173 1174 1175 1176
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
1177
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1178
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1179

1180 1181 1182 1183
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1184 1185 1186 1187
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1188 1189 1190 1191 1192 1193
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
1194
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1195
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1196

J
John Ferlan 已提交
1197 1198 1199 1200 1201
virrandommock_la_SOURCES = \
	virrandommock.c
virrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virrandommock_la_LIBADD = $(MOCKLIBS_LIBS)

1202 1203 1204 1205
virhostcpumock_la_SOURCES = \
	virhostcpumock.c
virhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1206

P
Pavel Hrdina 已提交
1207 1208 1209 1210 1211
virfilecachemock_la_SOURCES = \
	virfilecachemock.c
virfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)

1212 1213
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1214
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1215 1216
vircaps2xmltest_LDADD = $(LDADDS)

M
Martin Kletzander 已提交
1217 1218 1219 1220
virnumamock_la_SOURCES = \
	virnumamock.c
virnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1221

M
Martin Kletzander 已提交
1222 1223 1224 1225
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

1226 1227 1228 1229
virfilemock_la_SOURCES = \
	virfilemock.c
virfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilemock_la_LIBADD = $(MOCKLIBS_LIBS)
1230
else ! WITH_LINUX
M
Martin Kletzander 已提交
1231
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \
1232
			  virfilewrapper.h virresctrltest.c virfilemock.c
1233
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1234

1235
if WITH_NSS
M
Michal Privoznik 已提交
1236 1237 1238
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
1239
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1240 1241
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
1242
	$(LDADDS) \
M
Michal Privoznik 已提交
1243 1244
	../tools/nss/libnss_libvirt_impl.la

1245 1246 1247
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
1248 1249
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1250 1251
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
1252
	$(LDADDS) \
1253 1254
	../tools/nss/libnss_libvirt_guest_impl.la

M
Michal Privoznik 已提交
1255 1256 1257 1258 1259
nssmock_la_SOURCES = \
	nssmock.c
nssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
nssmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1260 1261 1262
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
1263 1264
nsslinktest_CFLAGS = \
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1265 1266 1267 1268
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

1269
nssguestlinktest_SOURCES = nsslinktest.c
1270 1271 1272
nssguestlinktest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1273 1274 1275
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1276 1277 1278
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1279

1280 1281 1282 1283 1284 1285
virdeterministichashmock_la_SOURCES = \
	virdeterministichashmock.c
virdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)

test_libraries += virdeterministichashmock.la
1286

1287
if WITH_YAJL
1288 1289 1290 1291
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

1292
test_programs += virmacmaptest
1293
else ! WITH_YAJL
1294
EXTRA_DIST +=  virmacmaptest.c
1295
endif ! WITH_YAJL
1296

M
Michal Privoznik 已提交
1297 1298 1299 1300 1301 1302 1303 1304
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)
1305
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1306
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1307

1308 1309 1310 1311
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

1312 1313 1314 1315 1316
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1317 1318 1319 1320
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1321
virusbmock_la_SOURCES = virusbmock.c
1322
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1323
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1324
	$(PROBES_O) \
1325
	../src/libvirt_util.la
1326 1327 1328

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
1329
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1330
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1331

1332 1333 1334
virtestmock_la_SOURCES = \
	virtestmock.c
virtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1335 1336
virtestmock_la_LIBADD = \
	$(MOCKLIBS_LIBS) \
1337
	$(PROBES_O) \
1338
	../src/libvirt_util.la
1339
else ! WITH_LINUX
1340
	EXTRA_DIST += virusbtest.c virusbmock.c \
1341 1342
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1343 1344
endif ! WITH_LINUX

1345 1346 1347 1348
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1349
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1350

1351 1352 1353 1354 1355
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1356

1357 1358 1359 1360 1361
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1362 1363
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1364
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1365
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1366

1367
else ! WITH_DBUS
1368
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1369
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1370

1371 1372
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1373
viruritest_LDADD = $(LDADDS)
1374

1375 1376
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1377
virkeyfiletest_LDADD = $(LDADDS)
1378

1379 1380 1381 1382
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1383 1384
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1385
virauthconfigtest_LDADD = $(LDADDS)
1386

1387
seclabeltest_SOURCES = \
1388
	seclabeltest.c testutils.h testutils.c
1389
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1390

1391
if WITH_SECDRIVER_SELINUX
1392
if WITH_ATTR
1393 1394
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1395
else ! WITH_TESTS
1396
check_LTLIBRARIES += libsecurityselinuxhelper.la
1397
endif ! WITH_TESTS
1398 1399 1400

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1401
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1402 1403 1404

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1405
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1406 1407
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1408 1409 1410 1411 1412

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1413
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(LDADDS) $(SELINUX_LIBS)
1414 1415
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1416 1417 1418
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1419 1420
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1421

1422 1423 1424 1425
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1426 1427 1428
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1429

1430
viratomictest_SOURCES = \
L
Laine Stump 已提交
1431
	viratomictest.c testutils.h testutils.c
1432 1433
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1434 1435 1436 1437
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1438 1439 1440 1441
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1442 1443 1444 1445
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1446 1447 1448 1449
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1450 1451
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1452
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1453 1454
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1455 1456 1457
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1458

M
Matthias Bolte 已提交
1459 1460 1461 1462
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1463
if WITH_LIBVIRTD
1464 1465 1466
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1467
endif WITH_LIBVIRTD
1468

1469 1470
if WITH_LIBVIRTD
eventtest_SOURCES = \
1471
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1472
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1473
endif WITH_LIBVIRTD
1474

1475 1476
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1477
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1478 1479 1480

shunloadtest_SOURCES = \
	shunloadtest.c
1481
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1482 1483
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1484 1485 1486 1487
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1488 1489 1490 1491
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1492 1493 1494 1495
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1496 1497 1498 1499 1500
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1501 1502 1503 1504 1505
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1506
if WITH_LINUX
O
Osier Yang 已提交
1507 1508 1509 1510
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1511 1512 1513 1514
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1515 1516
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1517
EXTRA_DIST += scsihosttest.c
1518 1519
endif  ! WITH_LINUX

O
Osier Yang 已提交
1520 1521 1522 1523 1524 1525 1526 1527 1528
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1529 1530 1531 1532 1533 1534
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1535
objectlocking_SOURCES = objectlocking.ml
1536 1537 1538 1539

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

1540
objectlocking: objectlocking.cmx objectlocking-files.txt
1541 1542
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1543

1544
objectlocking-files.txt:
1545 1546
	find $(top_builddir)/src/ -name '*.i' > $@

1547
else ! WITH_CIL
1548
EXTRA_DIST += objectlocking.ml
1549
endif ! WITH_CIL
1550

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