Makefile.am 38.3 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 \
J
Ján Tomko 已提交
135
	secretxml2xmlin \
136
	securityselinuxhelperdata \
137
	securityselinuxlabeldata \
E
Eric Blake 已提交
138
	sexpr2xmldata \
139
	storagepoolcapsschemadata \
140
	storagepoolschemadata \
141
	storagepoolxml2xmlin \
E
Eric Blake 已提交
142
	storagepoolxml2xmlout \
143
	storagepoolxml2argvdata \
144
	storagevolschemadata \
145
	storagevolxml2argvdata \
146
	storagevolxml2xmlin \
E
Eric Blake 已提交
147
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
148
	sysinfodata \
149
	test-lib.sh \
Y
Yohan BELLEGUIC 已提交
150
	vboxsnapshotxmldata \
151
	vircaps2xmldata \
152
	vircgroupdata \
153
	virconfdata \
154
	virfiledata \
155
	virjsondata \
156
	virmacmaptestdata \
157
	virmock.h \
158
	virnetdaemondata \
159
	virnetdevtestdata \
160
	virnwfilterbindingxml2xmldata \
161
	virpcitestdata \
O
Osier Yang 已提交
162
	virscsidata \
163
	virsh-uriprecedence \
164
	virusbtestdata \
165
	vmwareverdata \
166
	vmx2xmldata \
167
	xlconfigdata \
168
	xmconfigdata \
E
Eric Blake 已提交
169
	xml2sexprdata \
170 171
	xml2vmxdata \
	virstorageutildata \
172
	virfilecachedata \
M
Martin Kletzander 已提交
173
	virresctrldata \
174
	$(NULL)
K
Karel Zak 已提交
175

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

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

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

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

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

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

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

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

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

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

306
if WITH_LXC
307
test_programs += lxcxml2xmltest lxcconf2xmltest
308
endif WITH_LXC
309

310
if WITH_OPENVZ
311
test_programs += openvzutilstest
312
endif WITH_OPENVZ
313

314
if WITH_ESX
315
test_programs += esxutilstest
316
endif WITH_ESX
317

Y
Yohan BELLEGUIC 已提交
318 319 320 321
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

322
if WITH_VMX
323
test_programs += vmx2xmltest xml2vmxtest
324
endif WITH_VMX
325

326 327 328 329
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

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

335
if WITH_CIL
336
test_programs += objectlocking
337
endif WITH_CIL
338

339
if WITH_YAJL
340
test_programs += virjsontest
341
endif WITH_YAJL
342

343 344 345 346
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
		$(NULL)
347

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

355 356
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
357
endif WITH_STORAGE_SHEEPDOG
358

359
test_programs += nwfilterxml2xmltest
360
test_programs += virnwfilterbindingxml2xmltest
361

362 363
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
364
test_programs += nwfilterxml2firewalltest
365 366
endif WITH_NWFILTER

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

375 376
if WITH_STORAGE_FS
test_programs += virstoragetest
377
endif WITH_STORAGE_FS
378

O
Osier Yang 已提交
379 380 381 382
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

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

389
test_programs += storagevolxml2xmltest
390

391
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
392

393
test_programs += interfacexml2xmltest
394

395
test_programs += cputest
396

P
Peter Krempa 已提交
397 398
test_programs += metadatatest

J
Ján Tomko 已提交
399 400
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
401 402
test_programs += genericxml2xmltest

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

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

428 429 430
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

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

438 439
test_programs += objecteventtest

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

447 448
EXTRA_DIST += $(test_scripts)

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

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

470 471
TESTS = $(test_programs) \
	$(test_scripts)
472

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

479
lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd)
480

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

495

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

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

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

514 515 516 517
libxltestdriver_la_SOURCES =
libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
libxltestdriver_la_LIBADD = $(libxl_LDADDS)

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

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

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

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

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

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

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

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

560
if WITH_QEMU
561

562 563
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

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

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

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

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

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

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
603
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
604

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

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

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

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

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

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

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

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

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

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

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

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

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

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

703
else ! WITH_QEMU
704
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
J
Ján Tomko 已提交
705
	domainsnapshotxml2xmltest.c \
P
Peter Krempa 已提交
706
	testutilsqemu.c testutilsqemu.h \
707
	testutilsqemuschema.c testutilsqemuschema.h \
708
	qemumonitorjsontest.c qemuhotplugtest.c \
709
	qemuagenttest.c qemucapabilitiestest.c \
710
	qemucaps2xmltest.c qemucommandutiltest.c \
711
	qemumemlocktest.c qemucpumock.c testutilshostcpus.h \
712
	qemublocktest.c \
713
	qemumigparamstest.c \
714 715
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
716
	$(QEMUMONITORTESTUTILS_SOURCES)
717
endif ! WITH_QEMU
718

719 720
if WITH_LXC

E
Eric Blake 已提交
721
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
722
if WITH_NETWORK
E
Eric Blake 已提交
723
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
724
endif WITH_NETWORK
725
lxc_LDADDS += $(LDADDS)
726 727 728 729

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
730
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
731 732

lxcconf2xmltest_SOURCES = \
733
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
734 735
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
736
else ! WITH_LXC
737
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
738
endif ! WITH_LXC
739

740 741 742 743
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
744
openvzutilstest_LDADD = $(LDADDS)
745
else ! WITH_OPENVZ
746
EXTRA_DIST += openvzutilstest.c
747
endif ! WITH_OPENVZ
748 749
EXTRA_DIST += openvzutilstest.conf

750 751 752 753
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
754
esxutilstest_LDADD = $(LDADDS)
755
else ! WITH_ESX
756
EXTRA_DIST += esxutilstest.c
757
endif ! WITH_ESX
758

Y
Yohan BELLEGUIC 已提交
759 760 761 762 763 764 765 766 767 768
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

769
if WITH_VMX
770 771 772
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
773
vmx2xmltest_LDADD = $(LDADDS)
774 775 776 777

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
778
xml2vmxtest_LDADD = $(LDADDS)
779
else ! WITH_VMX
780
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
781
endif ! WITH_VMX
782

783 784 785 786 787 788 789 790 791
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 已提交
792 793 794
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
795
bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
796
bhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
797

798 799 800 801 802
bhyveargv2xmlmock_la_SOURCES = \
	bhyveargv2xmlmock.c
bhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
bhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)

R
Roman Bogorodskiy 已提交
803
bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
R
Roman Bogorodskiy 已提交
804 805 806
if WITH_STORAGE
bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
R
Roman Bogorodskiy 已提交
807 808 809 810 811
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
812 813 814 815 816

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
817 818 819 820 821

bhyveargv2xmltest_SOURCES = \
	bhyveargv2xmltest.c \
	testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
822
else ! WITH_BHYVE
823 824 825 826 827 828
EXTRA_DIST += \
	bhyvexml2argvtest.c \
	bhyveargv2xmltest.c \
	bhyvexml2xmltest.c \
	bhyvexml2argvmock.c \
	bhyveargv2xmlmock.c
R
Roman Bogorodskiy 已提交
829 830
endif ! WITH_BHYVE

831 832 833 834 835
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
836 837 838 839 840
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

841
if WITH_NETWORK
842 843
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
844
	testutils.c testutils.h
845
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
846 847 848 849 850 851

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

852
else ! WITH_NETWORK
853
EXTRA_DIST += networkxml2conftest.c
854
endif !	WITH_NETWORK
855

856 857 858 859
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
860
storagebackendsheepdogtest_LDADD = \
861
	../src/libvirt_storage_backend_sheepdog_priv.la \
862
	../src/libvirt_driver_storage_impl.la \
863
	$(LDADDS)
864
else ! WITH_STORAGE_SHEEPDOG
865
EXTRA_DIST += storagebackendsheepdogtest.c
866
endif ! WITH_STORAGE_SHEEPDOG
867

868 869 870 871
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
872

873 874 875 876 877
virnwfilterbindingxml2xmltest_SOURCES = \
	virnwfilterbindingxml2xmltest.c \
	testutils.c testutils.h
virnwfilterbindingxml2xmltest_LDADD = $(LDADDS)

878 879 880 881 882
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
883 884 885 886 887 888

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

J
Ján Tomko 已提交
891 892 893 894 895
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
896 897 898 899 900
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
901

902
if WITH_STORAGE
903 904 905 906 907 908 909 910 911 912
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

913 914 915 916
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
917
	$(LIBXML_LIBS) \
918 919 920 921
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(LDADDS)
J
Ján Tomko 已提交
922

923 924 925 926 927 928 929 930 931 932
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)

933 934 935 936 937 938 939
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS) \
	../src/libvirt_driver_storage_impl.la \
	$(GNULIB_LIBS)

940 941 942 943
storagepoolcapstest_SOURCES = \
        storagepoolcapstest.c testutils.h testutils.c
storagepoolcapstest_LDADD = $(LDADDS)

944
else ! WITH_STORAGE
945
EXTRA_DIST += storagevolxml2argvtest.c
946
EXTRA_DIST += virstorageutiltest.c
947
EXTRA_DIST += storagepoolxml2argvtest.c
948
EXTRA_DIST += storagepoolxml2xmltest.c
949
EXTRA_DIST += storagepoolcapstest.c
950
endif ! WITH_STORAGE
951

952 953 954 955 956
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
957 958 959
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
960
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
961

962 963 964 965 966
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

967 968 969
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
970
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Jiri Denemark 已提交
971 972 973 974
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS) $(GNULIB_LIBS)
endif WITH_QEMU
975

P
Peter Krempa 已提交
976 977 978 979 980
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

981 982 983 984 985
virerrortest_SOURCES = \
	virerrortest.c \
	testutils.c testutils.h
virerrortest_LDADD = $(LDADDS)

S
Simon Kobyda 已提交
986 987 988 989 990 991 992
vshtabletest_SOURCES = \
	vshtabletest.c \
	testutils.c testutils.h
vshtabletest_LDADD = \
	$(LDADDS) \
	../tools/libvirt_shell.la

993 994 995 996 997
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

998
virconftest_SOURCES = \
999
	virconftest.c testutils.h testutils.c
1000
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
1001

1002
virhostcputest_SOURCES = \
1003
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1004
virhostcputest_LDADD = $(LDADDS)
1005

1006 1007 1008 1009
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

1010 1011 1012 1013
# 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
1014 1015
commandhelper_SOURCES = \
	commandhelper.c
1016 1017 1018 1019
commandhelper_LDADD = \
	$(NO_INDIRECT_LDFLAGS) \
	$(GNULIB_LIBS)

1020
commandhelper_LDFLAGS = -static
1021

1022

1023 1024 1025 1026
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

1027
vircapstest_SOURCES = \
1028 1029 1030 1031 1032 1033 1034
	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
1035
vircapstest_LDADD = $(qemu_LDADDS) $(LDADDS)
1036

1037 1038 1039 1040
domaincapsmock_la_SOURCES = domaincapsmock.c
domaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
domaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1041 1042 1043 1044
domaincapstest_SOURCES = \
	domaincapstest.c testutils.h testutils.c
domaincapstest_LDADD = $(LDADDS)

1045 1046
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
1047
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
1048 1049
endif WITH_QEMU

1050 1051
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
1052
domaincapstest_LDADD += libxltestdriver.la $(GNULIB_LIBS)
1053 1054
endif WITH_LIBXL

1055 1056 1057 1058
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

1059 1060
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1061
virnetmessagetest_LDADD = $(LDADDS)
1062

1063 1064
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1065
virnetsockettest_LDADD = $(LDADDS)
1066

1067 1068
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1069
	testutils.h testutils.c
1070
virnetdaemontest_LDADD = $(LDADDS)
1071

1072 1073 1074 1075 1076
virnetdaemonmock_la_SOURCES = \
	virnetdaemonmock.c
virnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)

1077 1078 1079 1080 1081 1082 1083
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
1084
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1085
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1086

1087
virnettlscontexttest_SOURCES = \
1088 1089 1090
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1091
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
1092 1093 1094 1095
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
1096
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
1097 1098 1099
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
1100 1101
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
1102
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
1103
EXTRA_DIST += pkix_asn1_tab.c
1104
endif ! HAVE_LIBTASN1
1105

1106 1107
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1108
virtimetest_LDADD = $(LDADDS)
1109

J
Ján Tomko 已提交
1110 1111
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1112
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1113

1114 1115 1116 1117
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

1118 1119
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
1120 1121 1122 1123 1124 1125 1126
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)
1127

1128 1129 1130
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1131
if WITH_SELINUX
1132
viridentitytest_LDADD += $(SELINUX_LIBS)
1133 1134 1135
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1136

J
Ján Tomko 已提交
1137 1138 1139 1140
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1141 1142 1143 1144
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1145 1146 1147 1148
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1149 1150 1151 1152
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1153 1154 1155 1156
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1157
virportallocatormock_la_SOURCES = \
1158
	virportallocatormock.c
1159 1160
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1161

1162 1163 1164 1165 1166 1167
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
1168
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1169
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1170

1171 1172 1173 1174
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1175 1176 1177 1178
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1179 1180 1181 1182 1183 1184
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
1185
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1186
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1187

J
John Ferlan 已提交
1188 1189 1190 1191 1192
virrandommock_la_SOURCES = \
	virrandommock.c
virrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virrandommock_la_LIBADD = $(MOCKLIBS_LIBS)

1193 1194 1195 1196
virhostcpumock_la_SOURCES = \
	virhostcpumock.c
virhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1197

P
Pavel Hrdina 已提交
1198 1199 1200 1201 1202
virfilecachemock_la_SOURCES = \
	virfilecachemock.c
virfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)

1203 1204
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1205
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1206 1207
vircaps2xmltest_LDADD = $(LDADDS)

M
Martin Kletzander 已提交
1208 1209 1210 1211
virnumamock_la_SOURCES = \
	virnumamock.c
virnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1212

M
Martin Kletzander 已提交
1213 1214 1215 1216
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

1217 1218 1219 1220
virfilemock_la_SOURCES = \
	virfilemock.c
virfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilemock_la_LIBADD = $(MOCKLIBS_LIBS)
1221
else ! WITH_LINUX
M
Martin Kletzander 已提交
1222
EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \
1223
			  virfilewrapper.h virresctrltest.c virfilemock.c
1224
endif ! WITH_LINUX
M
Martin Kletzander 已提交
1225

1226
if WITH_NSS
M
Michal Privoznik 已提交
1227 1228 1229
nsstest_SOURCES = \
	nsstest.c testutils.h testutils.c
nsstest_CFLAGS = \
1230
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1231 1232
	-I$(top_srcdir)/tools/nss
nsstest_LDADD = \
1233
	$(LDADDS) \
M
Michal Privoznik 已提交
1234 1235
	../tools/nss/libnss_libvirt_impl.la

1236 1237 1238
nssguesttest_SOURCES = \
	nsstest.c testutils.h testutils.c
nssguesttest_CFLAGS = \
1239 1240
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1241 1242
	-I$(top_srcdir)/tools/nss
nssguesttest_LDADD = \
1243
	$(LDADDS) \
1244 1245
	../tools/nss/libnss_libvirt_guest_impl.la

M
Michal Privoznik 已提交
1246 1247 1248 1249 1250
nssmock_la_SOURCES = \
	nssmock.c
nssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
nssmock_la_LIBADD = $(MOCKLIBS_LIBS)

M
Michal Privoznik 已提交
1251 1252 1253
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
nsslinktest_SOURCES = nsslinktest.c
1254 1255
nsslinktest_CFLAGS = \
	$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1256 1257 1258 1259
	-I$(top_srcdir)/tools/nss
nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
nsslinktest_LDFLAGS = $(NULL)

1260
nssguestlinktest_SOURCES = nsslinktest.c
1261 1262 1263
nssguestlinktest_CFLAGS = \
	-DLIBVIRT_NSS_GUEST \
	$(AM_CFLAGS) \
1264 1265 1266
	-I$(top_srcdir)/tools/nss
nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
nssguestlinktest_LDFLAGS = $(NULL)
1267 1268 1269
else ! WITH_NSS
EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c
endif ! WITH_NSS
1270

1271 1272 1273 1274 1275 1276
virdeterministichashmock_la_SOURCES = \
	virdeterministichashmock.c
virdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)

test_libraries += virdeterministichashmock.la
1277

1278
if WITH_YAJL
1279 1280 1281 1282
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

1283
test_programs += virmacmaptest
1284
else ! WITH_YAJL
1285
EXTRA_DIST +=  virmacmaptest.c
1286
endif ! WITH_YAJL
1287

M
Michal Privoznik 已提交
1288 1289 1290 1291 1292 1293 1294 1295
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)
1296
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1297
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1298

1299 1300 1301 1302
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

1303 1304 1305 1306 1307
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1308 1309 1310 1311
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1312
virusbmock_la_SOURCES = virusbmock.c
1313
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1314
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \
J
John Ferlan 已提交
1315
	$(PROBES_O) \
1316
	../src/libvirt_util.la
1317 1318 1319

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
1320
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1321
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1322

1323 1324 1325
virtestmock_la_SOURCES = \
	virtestmock.c
virtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1326 1327
virtestmock_la_LIBADD = \
	$(MOCKLIBS_LIBS) \
1328
	$(PROBES_O) \
1329
	../src/libvirt_util.la
1330
else ! WITH_LINUX
1331
	EXTRA_DIST += virusbtest.c virusbmock.c \
1332 1333
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c \
		virtestmock.c
1334 1335
endif ! WITH_LINUX

1336 1337 1338 1339
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1340
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1341

1342 1343 1344 1345 1346
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1347

1348 1349 1350 1351 1352
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1353 1354
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1355
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1356
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1357

1358
else ! WITH_DBUS
1359
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1360
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1361

1362 1363
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1364
viruritest_LDADD = $(LDADDS)
1365

1366 1367
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1368
virkeyfiletest_LDADD = $(LDADDS)
1369

1370 1371 1372 1373
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1374 1375
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1376
virauthconfigtest_LDADD = $(LDADDS)
1377

1378
seclabeltest_SOURCES = \
1379
	seclabeltest.c testutils.h testutils.c
1380
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1381

1382
if WITH_SECDRIVER_SELINUX
1383
if WITH_ATTR
1384 1385
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1386
else ! WITH_TESTS
1387
check_LTLIBRARIES += libsecurityselinuxhelper.la
1388
endif ! WITH_TESTS
1389 1390 1391

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1392
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1393 1394 1395

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1396
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1397 1398
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1399 1400 1401 1402 1403

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1404
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(LDADDS) $(SELINUX_LIBS)
1405 1406
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1407 1408 1409
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1410 1411
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1412

1413 1414 1415 1416
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1417 1418 1419
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1420

1421
viratomictest_SOURCES = \
L
Laine Stump 已提交
1422
	viratomictest.c testutils.h testutils.c
1423 1424
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1425 1426 1427 1428
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1429 1430 1431 1432
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1433 1434 1435 1436
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1437 1438 1439 1440
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1441 1442
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1443
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1444 1445
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1446 1447 1448
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1449

M
Matthias Bolte 已提交
1450 1451 1452 1453
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1454
if WITH_LIBVIRTD
1455 1456 1457
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1458
endif WITH_LIBVIRTD
1459

1460 1461
if WITH_LIBVIRTD
eventtest_SOURCES = \
1462
	eventtest.c testutils.h testutils.c
R
Roman Bogorodskiy 已提交
1463
eventtest_LDADD = $(LIB_CLOCK_GETTIME) $(LDADDS)
1464
endif WITH_LIBVIRTD
1465

1466 1467
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1468
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1469 1470 1471

shunloadtest_SOURCES = \
	shunloadtest.c
1472
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1473 1474
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1475 1476 1477 1478
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1479 1480 1481 1482
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1483 1484 1485 1486
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1487 1488 1489 1490 1491
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1492 1493 1494 1495 1496
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1497
if WITH_LINUX
O
Osier Yang 已提交
1498 1499 1500 1501
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1502 1503 1504 1505
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1506 1507
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1508
EXTRA_DIST += scsihosttest.c
1509 1510
endif  ! WITH_LINUX

O
Osier Yang 已提交
1511 1512 1513 1514 1515 1516 1517 1518 1519
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1520 1521 1522 1523 1524 1525
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1526
objectlocking_SOURCES = objectlocking.ml
1527 1528 1529 1530

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

1531
objectlocking: objectlocking.cmx objectlocking-files.txt
1532 1533
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1534

1535
objectlocking-files.txt:
1536 1537
	find $(top_builddir)/src/ -name '*.i' > $@

1538
else ! WITH_CIL
1539
EXTRA_DIST += objectlocking.ml
1540
endif ! WITH_CIL
1541

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