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

3
## Copyright (C) 2005-2019 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
SHELL = $(PREFERABLY_POSIX_SHELL)

21
AM_CPPFLAGS = \
22
	-I$(top_builddir) -I$(top_srcdir) \
23 24 25
	-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 \
26
	-I$(top_srcdir)/src/util \
27
	-I$(top_srcdir)/src/conf \
28
	$(NULL)
E
Eric Blake 已提交
29

30 31
WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)

E
Eric Blake 已提交
32
AM_CFLAGS = \
33
	-Dabs_builddir="\"$(abs_builddir)\"" \
34
	-Dabs_top_builddir="\"$(abs_top_builddir)\"" \
35
	-Dabs_srcdir="\"$(abs_srcdir)\"" \
36
	-Dabs_top_srcdir="\"$(abs_top_srcdir)\"" \
37
	$(LIBXML_CFLAGS) \
38
	$(LIBNL_CFLAGS) \
39
	$(GNUTLS_CFLAGS) \
40
	$(SASL_CFLAGS) \
41
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
42
	$(APPARMOR_CFLAGS) \
43
	$(YAJL_CFLAGS) \
44
	$(XDR_CFLAGS) \
E
Eric Blake 已提交
45
	$(WARN_CFLAGS)
46

47 48 49
AM_LDFLAGS = \
	-export-dynamic

50 51 52 53
MOCKLIBS_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
	$(MINGW_EXTRA_LDFLAGS)

54
DRIVERLIB_LDFLAGS = \
55 56 57 58
	-avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
	$(MINGW_EXTRA_LDFLAGS)

59
PROBES_O =
60
if WITH_DTRACE_PROBES
61
PROBES_O += ../src/libvirt_probes.lo
62
endif WITH_DTRACE_PROBES
63

64 65 66
GNULIB_LIBS = \
       ../gnulib/lib/libgnu.la

K
Karel Zak 已提交
67
LDADDS = \
68
	$(NO_INDIRECT_LDFLAGS) \
69
	$(PROBES_O) \
70 71
	$(GNULIB_LIBS) \
	../src/libvirt.la
K
Karel Zak 已提交
72

73
MOCKLIBS_LIBS = \
74 75
	$(GNULIB_LIBS) \
	../src/libvirt.la
76

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

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

206 207 208 209 210 211 212 213 214 215
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 已提交
216
	virfilecachemock.la \
217 218
	$(NULL)

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

230 231
if WITH_LINUX
test_programs += fchosttest
232
test_programs += scsihosttest
233
test_programs += vircaps2xmltest
M
Martin Kletzander 已提交
234
test_programs += virresctrltest
235 236
test_libraries += virusbmock.la \
	virnetdevbandwidthmock.la \
237
	virnumamock.la \
238
	virtestmock.la \
239
	virfilemock.la \
240
	$(NULL)
241 242
endif WITH_LINUX

243 244 245 246
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

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

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

267 268
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
269

270
if WITH_LIBXL
271
test_programs += xlconfigtest xml2sexprtest sexpr2xmltest \
272
	xmconfigtest libxlxml2domconfigtest
273
test_libraries += libxltestdriver.la libxlmock.la
274 275
endif WITH_LIBXL

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

298
if WITH_LXC
299
test_programs += lxcxml2xmltest lxcconf2xmltest
300
endif WITH_LXC
301

302
if WITH_OPENVZ
303
test_programs += openvzutilstest
304
endif WITH_OPENVZ
305

306
if WITH_ESX
307
test_programs += esxutilstest
308
endif WITH_ESX
309

Y
Yohan BELLEGUIC 已提交
310 311 312 313
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

314
if WITH_VMX
315
test_programs += vmx2xmltest xml2vmxtest
316
endif WITH_VMX
317

318 319 320 321
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

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

327
if WITH_CIL
328
test_programs += objectlocking
329
endif WITH_CIL
330

331
if WITH_YAJL
332
test_programs += virjsontest
333
endif WITH_YAJL
334

335 336 337
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
338
		virnetworkportxml2xmltest \
339
		$(NULL)
340

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

348 349
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
350
endif WITH_STORAGE_SHEEPDOG
351

352
test_programs += nwfilterxml2xmltest
353
test_programs += virnwfilterbindingxml2xmltest
354

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

360
if WITH_STORAGE
361
test_programs += storagevolxml2argvtest
362
test_programs += storagepoolxml2argvtest
363
test_programs += virstorageutiltest
364
test_programs += storagepoolxml2xmltest
365
test_programs += storagepoolcapstest
366
endif WITH_STORAGE
367

368 369
if WITH_STORAGE_FS
test_programs += virstoragetest
370
endif WITH_STORAGE_FS
371

O
Osier Yang 已提交
372 373 374 375
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

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

382
test_programs += storagevolxml2xmltest
383

384
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
385

386
test_programs += interfacexml2xmltest
387

388
test_programs += cputest
389

P
Peter Krempa 已提交
390 391
test_programs += metadatatest

J
Ján Tomko 已提交
392 393
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
394 395
test_programs += genericxml2xmltest

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

J
Ján Tomko 已提交
402
test_scripts =
403 404 405 406 407 408 409 410 411 412 413 414
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 \
415
	virsh-snapshot \
416 417 418 419
	virsh-start \
	virsh-undefine \
	virsh-uriprecedence \
	virsh-vcpupin \
420
	$(NULL)
421

422 423 424
if WITH_LIBVIRTD
test_scripts += $(libvirtd_test_scripts)

425
test_programs += \
426 427
	eventtest \
	virdrivermoduletest
428
else ! WITH_LIBVIRTD
429
EXTRA_DIST += $(libvirtd_test_scripts)
430
endif ! WITH_LIBVIRTD
431

432 433
test_programs += objecteventtest

J
Jamie Strandboge 已提交
434
if WITH_SECDRIVER_APPARMOR
435
if WITH_LIBVIRTD
J
Jamie Strandboge 已提交
436
test_scripts += virt-aa-helper-test
437 438
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
439 440
EXTRA_DIST += virt-aa-helper-test

441 442
EXTRA_DIST += $(test_scripts)

443 444 445 446 447 448 449 450 451 452 453 454 455
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

456 457
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
458
noinst_LTLIBRARIES = $(test_libraries)
459
else ! WITH_TESTS
460
check_PROGRAMS = $(test_programs) $(test_helpers)
461
check_LTLIBRARIES = $(test_libraries)
462
endif ! WITH_TESTS
463

464 465
TESTS = $(test_programs) \
	$(test_scripts)
466

467
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
468
TESTS_ENVIRONMENT = \
469 470 471 472
  abs_top_builddir="$(abs_top_builddir)" \
  abs_top_srcdir="$(abs_top_srcdir)" \
  abs_builddir="$(abs_builddir)" \
  abs_srcdir="$(abs_srcdir)" \
473 474 475 476
  SHELL="$(SHELL)" \
  LIBVIRT_AUTOSTART=0 \
  LC_ALL=C \
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \
477 478
  $(VG)

479

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

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

491 492
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
493 494 495
if WITH_NETWORK
libxl_LDADDS += ../src/libvirt_driver_network_impl.la
endif WITH_NETWORK
496 497
libxl_LDADDS += $(LDADDS)

498 499 500 501
libxltestdriver_la_SOURCES =
libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
libxltestdriver_la_LIBADD = $(libxl_LDADDS)

502 503 504 505
xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
506

507 508 509 510 511
xml2sexprtest_SOURCES = \
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xml2sexprtest_LDADD = $(libxl_LDADDS)

512 513 514 515 516
sexpr2xmltest_SOURCES = \
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
sexpr2xmltest_LDADD = $(libxl_LDADDS)

517 518 519 520 521
xmconfigtest_SOURCES = \
	xmconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xmconfigtest_LDADD = $(libxl_LDADDS)

522 523 524 525 526
libxlxml2domconfigtest_SOURCES = \
	libxlxml2domconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
libxlxml2domconfigtest_LDADD = $(libxl_LDADDS) $(LIBXML_LIBS)

527 528 529 530 531
libxlmock_la_SOURCES = \
	libxlmock.c
libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS)
libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libxlmock_la_LIBADD = $(MOCKLIBS_LIBS)
532

533
else ! WITH_LIBXL
534
EXTRA_DIST += xlconfigtest.c xml2sexprtest.c sexpr2xmltest.c \
535
	xmconfigtest.c libxlxml2domconfigtest.c
536 537
endif ! WITH_LIBXL

538 539 540
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
541
	testutilsqemuschema.h testutilsqemuschema.c \
542 543
	$(NULL)

544
if WITH_QEMU
545

546 547
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

548
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
549
if WITH_NETWORK
E
Eric Blake 已提交
550
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
551
endif WITH_NETWORK
552 553 554
if WITH_STORAGE
qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
555
if WITH_DTRACE_PROBES
556
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
557
endif WITH_DTRACE_PROBES
558
qemu_LDADDS += $(LDADDS)
559

560
libqemutestdriver_la_SOURCES =
561
libqemutestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
562
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)
563

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

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

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

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

587 588 589 590 591
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
592
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
593
	$(qemu_LDADDS)
594

595 596 597 598 599
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
600
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
601
	$(qemu_LDADDS)
602

J
Jiri Denemark 已提交
603 604 605 606 607 608 609 610 611 612
qemucapsprobe_SOURCES = \
	qemucapsprobe.c
qemucapsprobe_LDADD = \
	libqemutestdriver.la $(LDADDS)

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

613 614 615 616 617 618
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
619
	$(qemu_LDADDS)
620

621 622 623
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
624
	testutilsqemu.c testutilsqemu.h \
625
	$(NULL)
626
qemucaps2xmltest_LDADD = $(qemu_LDADDS)
627

P
Pavel Hrdina 已提交
628 629
qemucaps2xmlmock_la_SOURCES = \
	qemucaps2xmlmock.c
630
qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
631
qemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
632

P
Peter Krempa 已提交
633 634 635 636 637
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
638
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
P
Peter Krempa 已提交
639

640 641 642 643 644
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
645
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
646

647
qemublocktest_SOURCES = \
648 649
	qemublocktest.c \
	testutils.h testutils.c \
650
	testutilsqemu.h testutilsqemu.c \
651 652
	$(NULL)
qemublocktest_LDADD = \
653
	libqemumonitortestutils.la \
654 655 656 657 658
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(qemu_LDADDS) \
	$(NULL)

659 660 661
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
662
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
663 664 665 666 667

qemumemlocktest_SOURCES = \
	qemumemlocktest.c \
	testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
668
qemumemlocktest_LDADD = $(qemu_LDADDS)
669 670 671 672 673 674 675

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

678 679 680 681 682
qemusecuritytest_SOURCES = \
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
	testutils.h testutils.c \
	testutilsqemu.h testutilsqemu.c
683
qemusecuritytest_LDADD = $(qemu_LDADDS)
684

685 686 687
qemufirmwaretest_SOURCES = \
	qemufirmwaretest.c \
	testutils.h testutils.c \
688
	virfilewrapper.c virfilewrapper.h \
689
	$(NULL)
690
qemufirmwaretest_LDADD = $(qemu_LDADDS)
691

692
else ! WITH_QEMU
P
Peter Krempa 已提交
693
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c \
J
Ján Tomko 已提交
694
	domainsnapshotxml2xmltest.c \
P
Peter Krempa 已提交
695
	testutilsqemu.c testutilsqemu.h \
696
	testutilsqemuschema.c testutilsqemuschema.h \
697
	qemumonitorjsontest.c qemuhotplugtest.c \
698
	qemuagenttest.c qemucapabilitiestest.c \
699
	qemucaps2xmltest.c qemucommandutiltest.c \
700
	qemumemlocktest.c qemucpumock.c testutilshostcpus.h \
701
	qemublocktest.c \
702
	qemumigparamstest.c \
703 704
	qemusecuritytest.c qemusecuritytest.h \
	qemusecuritymock.c \
705
	qemufirmwaretest.c \
706
	$(QEMUMONITORTESTUTILS_SOURCES)
707
endif ! WITH_QEMU
708

709 710
if WITH_LXC

E
Eric Blake 已提交
711
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
712
if WITH_NETWORK
E
Eric Blake 已提交
713
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
714
endif WITH_NETWORK
715
lxc_LDADDS += $(LDADDS)
716 717 718 719

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
720
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
721 722

lxcconf2xmltest_SOURCES = \
723
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
724 725
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
726
else ! WITH_LXC
727
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
728
endif ! WITH_LXC
729

730 731 732 733
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
734
openvzutilstest_LDADD = $(LDADDS)
735
else ! WITH_OPENVZ
736
EXTRA_DIST += openvzutilstest.c
737
endif ! WITH_OPENVZ
738 739
EXTRA_DIST += openvzutilstest.conf

740 741 742 743
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
744
esxutilstest_LDADD = $(LDADDS)
745
else ! WITH_ESX
746
EXTRA_DIST += esxutilstest.c
747
endif ! WITH_ESX
748

Y
Yohan BELLEGUIC 已提交
749 750 751 752 753 754 755 756 757 758
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

759
if WITH_VMX
760 761 762
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
763
vmx2xmltest_LDADD = $(LDADDS)
764 765 766 767

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
768
xml2vmxtest_LDADD = $(LDADDS)
769
else ! WITH_VMX
770
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
771
endif ! WITH_VMX
772

773 774 775 776 777 778 779 780 781
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 已提交
782 783 784
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
785
bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
786
bhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
787

788 789 790 791 792
bhyveargv2xmlmock_la_SOURCES = \
	bhyveargv2xmlmock.c
bhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
bhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)

R
Roman Bogorodskiy 已提交
793
bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
R
Roman Bogorodskiy 已提交
794 795 796
if WITH_STORAGE
bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
R
Roman Bogorodskiy 已提交
797 798 799 800 801
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
802 803 804 805 806

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
807 808 809 810 811

bhyveargv2xmltest_SOURCES = \
	bhyveargv2xmltest.c \
	testutils.c testutils.h
bhyveargv2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
812
else ! WITH_BHYVE
813 814 815 816 817 818
EXTRA_DIST += \
	bhyvexml2argvtest.c \
	bhyveargv2xmltest.c \
	bhyvexml2xmltest.c \
	bhyvexml2argvmock.c \
	bhyveargv2xmlmock.c
R
Roman Bogorodskiy 已提交
819 820
endif ! WITH_BHYVE

821 822 823 824 825
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
826 827 828 829 830
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

831 832 833 834 835
virnetworkportxml2xmltest_SOURCES = \
	virnetworkportxml2xmltest.c \
	testutils.c testutils.h
virnetworkportxml2xmltest_LDADD = $(LDADDS)

836
if WITH_NETWORK
837 838
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
839
	testutils.c testutils.h
840
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
841 842 843 844 845 846

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

847
else ! WITH_NETWORK
848
EXTRA_DIST += networkxml2conftest.c
849
endif !	WITH_NETWORK
850

851 852 853 854
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
855
storagebackendsheepdogtest_LDADD = \
856
	../src/libvirt_storage_backend_sheepdog_priv.la \
857
	../src/libvirt_driver_storage_impl.la \
858
	$(LDADDS)
859
else ! WITH_STORAGE_SHEEPDOG
860
EXTRA_DIST += storagebackendsheepdogtest.c
861
endif ! WITH_STORAGE_SHEEPDOG
862

863 864 865 866
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
867

868 869 870 871 872
virnwfilterbindingxml2xmltest_SOURCES = \
	virnwfilterbindingxml2xmltest.c \
	testutils.c testutils.h
virnwfilterbindingxml2xmltest_LDADD = $(LDADDS)

873 874 875 876 877
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
878 879 880 881 882 883

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

J
Ján Tomko 已提交
886 887 888 889 890
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
891 892 893 894 895
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
896

897
if WITH_STORAGE
898 899 900 901 902 903 904 905 906 907
virstorageutiltest_SOURCES = \
	virstorageutiltest.c \
	testutils.c \
	testutils.h \
	$(NULL)
virstorageutiltest_LDADD = \
	../src/libvirt_driver_storage_impl.la \
	$(LDADDS) \
	$(NULL)

908 909 910 911
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
912
	$(LIBXML_LIBS) \
913 914 915 916
	../src/libvirt_driver_storage_impl.la \
	../src/libvirt_conf.la \
	../src/libvirt_util.la \
	$(LDADDS)
J
Ján Tomko 已提交
917

918 919 920 921 922 923 924 925 926 927
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)

928 929 930 931 932 933 934
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS) \
	../src/libvirt_driver_storage_impl.la \
	$(GNULIB_LIBS)

935 936 937 938
storagepoolcapstest_SOURCES = \
        storagepoolcapstest.c testutils.h testutils.c
storagepoolcapstest_LDADD = $(LDADDS)

939
else ! WITH_STORAGE
940
EXTRA_DIST += storagevolxml2argvtest.c
941
EXTRA_DIST += virstorageutiltest.c
942
EXTRA_DIST += storagepoolxml2argvtest.c
943
EXTRA_DIST += storagepoolxml2xmltest.c
944
EXTRA_DIST += storagepoolcapstest.c
945
endif ! WITH_STORAGE
946

947 948 949 950 951
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
952 953 954
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
955
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
956

957 958 959 960 961
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

962 963 964
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
A
Andrea Bolognani 已提交
965
cputest_LDADD = $(LIBXML_LIBS)
J
Jiri Denemark 已提交
966 967
if WITH_QEMU
cputest_SOURCES += testutilsqemu.c testutilsqemu.h
968
cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS)
A
Andrea Bolognani 已提交
969 970 971
else ! WITH_QEMU
cputest_LDADD += $(LDADDS)
endif ! WITH_QEMU
972

P
Peter Krempa 已提交
973 974 975 976 977
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

978 979 980 981 982
virerrortest_SOURCES = \
	virerrortest.c \
	testutils.c testutils.h
virerrortest_LDADD = $(LDADDS)

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

990 991 992 993 994
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

995
virconftest_SOURCES = \
996
	virconftest.c testutils.h testutils.c
997
virconftest_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
998

999
virhostcputest_SOURCES = \
1000
	virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1001
virhostcputest_LDADD = $(LDADDS)
1002

1003 1004 1005 1006
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

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

1017
commandhelper_LDFLAGS = -static
1018

1019

1020 1021 1022 1023
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

1024
vircapstest_SOURCES = \
1025 1026 1027 1028 1029 1030 1031
	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
1032
if WITH_QEMU
1033
vircapstest_LDADD = $(qemu_LDADDS)
1034 1035 1036
else ! WITH_QEMU
vircapstest_LDADD = $(LDADDS)
endif ! WITH_QEMU
1037

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

M
Michal Privoznik 已提交
1042
domaincapstest_SOURCES = \
1043 1044 1045
	domaincapstest.c testutils.h testutils.c \
	virfilewrapper.c virfilewrapper.h \
	$(NULL)
M
Michal Privoznik 已提交
1046 1047
domaincapstest_LDADD = $(LDADDS)

1048 1049
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
1050
domaincapstest_LDADD += libqemutestdriver.la $(GNULIB_LIBS)
1051 1052
endif WITH_QEMU

1053 1054
if WITH_LIBXL
domaincapstest_SOURCES += testutilsxen.c testutilsxen.h
1055
domaincapstest_LDADD += libxltestdriver.la $(GNULIB_LIBS)
1056 1057
endif WITH_LIBXL

1058 1059 1060 1061
if WITH_BHYVE
domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la $(GNULIB_LIBS)
endif WITH_BHYVE

1062 1063
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
1064
virnetmessagetest_LDADD = $(LDADDS)
1065

1066 1067
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
1068
virnetsockettest_LDADD = $(LDADDS)
1069

1070 1071
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
1072
	testutils.h testutils.c
1073
virnetdaemontest_LDADD = $(LDADDS)
1074

1075 1076 1077 1078 1079
virnetdaemonmock_la_SOURCES = \
	virnetdaemonmock.c
virnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS)

1080 1081 1082 1083 1084 1085 1086
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
1087
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1088
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
1089

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

1109 1110
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
1111
virtimetest_LDADD = $(LDADDS)
1112

J
Ján Tomko 已提交
1113 1114
virschematest_SOURCES = \
	virschematest.c testutils.h testutils.c
1115
virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS)
J
Ján Tomko 已提交
1116

1117 1118 1119 1120
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

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

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

J
Ján Tomko 已提交
1140 1141 1142 1143
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1144 1145 1146 1147
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1148 1149 1150 1151
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1152 1153 1154 1155
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1156 1157 1158 1159
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1160
virportallocatormock_la_SOURCES = \
1161
	virportallocatormock.c
1162 1163
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1164

1165 1166 1167 1168 1169 1170
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
1171
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1172
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1173

1174 1175 1176 1177
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1178 1179 1180 1181
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1182 1183 1184 1185 1186 1187
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
1188
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1189
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1190

J
John Ferlan 已提交
1191 1192 1193 1194 1195
virrandommock_la_SOURCES = \
	virrandommock.c
virrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virrandommock_la_LIBADD = $(MOCKLIBS_LIBS)

1196 1197 1198 1199
virhostcpumock_la_SOURCES = \
	virhostcpumock.c
virhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS)
1200

P
Pavel Hrdina 已提交
1201 1202 1203 1204 1205
virfilecachemock_la_SOURCES = \
	virfilecachemock.c
virfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS)

1206 1207
if WITH_LINUX
vircaps2xmltest_SOURCES = \
1208
	vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
1209 1210
vircaps2xmltest_LDADD = $(LDADDS)

M
Martin Kletzander 已提交
1211 1212 1213 1214
virnumamock_la_SOURCES = \
	virnumamock.c
virnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virnumamock_la_LIBADD = $(MOCKLIBS_LIBS)
1215

M
Martin Kletzander 已提交
1216 1217 1218 1219
virresctrltest_SOURCES = \
	virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c
virresctrltest_LDADD = $(LDADDS)

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

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

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

M
Michal Privoznik 已提交
1249 1250 1251 1252 1253
nssmock_la_SOURCES = \
	nssmock.c
nssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
nssmock_la_LIBADD = $(MOCKLIBS_LIBS)

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

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

1274 1275 1276 1277 1278 1279
virdeterministichashmock_la_SOURCES = \
	virdeterministichashmock.c
virdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS)

test_libraries += virdeterministichashmock.la
1280

1281
if WITH_YAJL
1282 1283 1284 1285
virmacmaptest_SOURCES = \
	virmacmaptest.c testutils.h testutils.c
virmacmaptest_LDADD = $(LDADDS)

1286
test_programs += virmacmaptest
1287
else ! WITH_YAJL
1288
EXTRA_DIST +=  virmacmaptest.c
1289
endif ! WITH_YAJL
1290

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

1302 1303 1304 1305
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_LDADD = $(LDADDS)

1306 1307 1308 1309 1310
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1311 1312 1313 1314
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

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

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
1323
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1324
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1325

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

1339 1340 1341 1342
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1343
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1344

1345 1346 1347 1348 1349
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1350

1351 1352 1353 1354 1355
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1356 1357
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1358
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1359
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1360

1361
else ! WITH_DBUS
1362
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1363
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1364

1365 1366
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1367
viruritest_LDADD = $(LDADDS)
1368

1369 1370
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1371
virkeyfiletest_LDADD = $(LDADDS)
1372

1373 1374 1375 1376
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1377 1378
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1379
virauthconfigtest_LDADD = $(LDADDS)
1380

1381
seclabeltest_SOURCES = \
1382
	seclabeltest.c testutils.h testutils.c
1383
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1384

1385
if WITH_SECDRIVER_SELINUX
1386
if WITH_ATTR
1387 1388
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1389
else ! WITH_TESTS
1390
check_LTLIBRARIES += libsecurityselinuxhelper.la
1391
endif ! WITH_TESTS
1392 1393 1394

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1395
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1396 1397 1398

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

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

1416 1417 1418 1419
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1420 1421 1422
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1423

1424
viratomictest_SOURCES = \
L
Laine Stump 已提交
1425
	viratomictest.c testutils.h testutils.c
1426 1427
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1428 1429 1430 1431
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1432 1433 1434 1435
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1436 1437 1438 1439
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

P
Pavel Hrdina 已提交
1440 1441 1442 1443
virfilecachetest_SOURCES = \
	virfilecachetest.c testutils.h testutils.c
virfilecachetest_LDADD = $(LDADDS)

1444 1445
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1446
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1447 1448
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1449 1450 1451
virjsontest_SOURCES = \
	virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)
1452

M
Matthias Bolte 已提交
1453 1454 1455 1456
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1457
if WITH_LIBVIRTD
1458 1459 1460
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1461
endif WITH_LIBVIRTD
1462

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

1469 1470
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1471
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1472 1473 1474

shunloadtest_SOURCES = \
	shunloadtest.c
1475
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
1476 1477
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1478 1479 1480 1481
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1482 1483 1484 1485
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1486 1487 1488 1489
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1490 1491 1492 1493 1494
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1495 1496 1497 1498 1499
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1500
if WITH_LINUX
O
Osier Yang 已提交
1501 1502 1503 1504
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1505 1506 1507 1508
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1509 1510
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1511
EXTRA_DIST += scsihosttest.c
1512 1513
endif  ! WITH_LINUX

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

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

1523 1524 1525 1526 1527 1528
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1529
objectlocking_SOURCES = objectlocking.ml
1530 1531 1532 1533

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

1534
objectlocking: objectlocking.cmx objectlocking-files.txt
1535 1536
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1537

1538
objectlocking-files.txt:
1539 1540
	find $(top_builddir)/src/ -name '*.i' > $@

1541
else ! WITH_CIL
1542
EXTRA_DIST += objectlocking.ml
1543
endif ! WITH_CIL
1544

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