Makefile.am 31.9 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 21 22
# old automake does not provide abs_{src,build}dir variables
abs_builddir = $(shell pwd)
abs_srcdir = $(shell cd $(srcdir) && pwd)

23 24
SHELL = $(PREFERABLY_POSIX_SHELL)

K
Karel Zak 已提交
25
INCLUDES = \
26
	-I$(top_builddir) -I$(top_srcdir) \
27 28 29
	-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 \
30
	-I$(top_srcdir)/src/util \
31 32
	-I$(top_srcdir)/src/conf \
	$(GETTEXT_CPPFLAGS)
E
Eric Blake 已提交
33 34

AM_CFLAGS = \
35 36
	-Dabs_builddir="\"$(abs_builddir)\"" \
	-Dabs_srcdir="\"$(abs_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) \
E
Eric Blake 已提交
44 45
	$(COVERAGE_CFLAGS) \
	$(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 55 56
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
57
endif WITH_DRIVER_MODULES
58

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
	$(WARN_CFLAGS) \
69
	$(NO_INDIRECT_LDFLAGS) \
70
	$(PROBES_O) \
71 72
	$(GNULIB_LIBS) \
	../src/libvirt.la
K
Karel Zak 已提交
73

74 75 76
MOCKLIBS_LIBS = \
	$(GNULIB_LIBS)

77
EXTRA_DIST =		\
78
	.valgrind.supp \
R
Roman Bogorodskiy 已提交
79
	bhyvexml2argvdata \
80
	bhyvexml2xmloutdata \
81
	capabilityschemadata \
E
Eric Blake 已提交
82 83 84 85
	capabilityschematest \
	commanddata \
	confdata \
	cputestdata \
M
Michal Privoznik 已提交
86 87
	domaincapsschemadata \
	domaincapsschematest \
88
	domainconfdata \
89
	domainschemadata \
E
Eric Blake 已提交
90 91 92 93
	domainschematest \
	domainsnapshotschematest \
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
O
Osier Yang 已提交
94
	fchostdata \
C
Cole Robinson 已提交
95 96
	genericxml2xmlindata \
	genericxml2xmloutdata \
97
	interfaceschemadata \
98
	lxcconf2xmldata \
99
	lxcxml2xmldata \
100
	lxcxml2xmloutdata \
E
Eric Blake 已提交
101
	networkschematest \
102 103
	networkxml2confdata \
	networkxml2firewalldata \
E
Eric Blake 已提交
104 105
	networkxml2xmlin \
	networkxml2xmlout \
J
Ján Tomko 已提交
106 107
	networkxml2xmlupdatein \
	networkxml2xmlupdateout \
E
Eric Blake 已提交
108 109 110 111
	nodedevschemadata \
	nodedevschematest \
	nodeinfodata     \
	nwfilterschematest \
112
	nwfilterxml2firewalldata \
E
Eric Blake 已提交
113 114 115
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
116
	qemuagentdata \
117
	qemuargv2xmldata \
118
	qemucapabilitiesdata \
119
	qemucaps2xmldata \
E
Eric Blake 已提交
120
	qemuhelpdata \
121
	qemuhotplugtestdata \
122
	qemumonitorjsondata \
E
Eric Blake 已提交
123 124
	qemuxml2argvdata \
	qemuxml2xmloutdata \
125
	schematestutils.sh \
J
Ján Tomko 已提交
126
	secretxml2xmlin \
127
	securityselinuxhelperdata \
128
	securityselinuxlabeldata \
E
Eric Blake 已提交
129
	sexpr2xmldata \
130
	storagepoolschemadata \
131
	storagepoolschematest \
132
	storagepoolxml2xmlin \
E
Eric Blake 已提交
133
	storagepoolxml2xmlout \
134
	storagevolschemadata \
135
	storagevolschematest \
136
	storagevolxml2argvdata \
137
	storagevolxml2xmlin \
E
Eric Blake 已提交
138
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
139
	sysinfodata \
E
Eric Blake 已提交
140
	test-lib.sh	\
Y
Yohan BELLEGUIC 已提交
141
	vboxsnapshotxmldata \
142
	vircaps2xmldata \
143
	vircgroupdata \
144
	virfiledata \
145
	virmock.h \
146
	virnetdaemondata \
147
	virnetdevtestdata \
148
	virpcitestdata \
O
Osier Yang 已提交
149
	virscsidata \
150
	virsh-uriprecedence \
151
	virusbtestdata \
152
	vmwareverdata \
153
	vmx2xmldata \
E
Eric Blake 已提交
154
	xencapsdata \
155
	xlconfigdata \
156
	xmconfigdata \
E
Eric Blake 已提交
157
	xml2sexprdata \
158
	xml2vmxdata
K
Karel Zak 已提交
159

G
Gene Czarcinski 已提交
160
test_helpers = commandhelper ssh test_conf
161
test_programs = virshtest sockettest \
E
Eric Blake 已提交
162
	nodeinfotest virbuftest \
163
	commandtest seclabeltest \
E
Eric Blake 已提交
164 165
	virhashtest \
	viratomictest \
166
	utiltest shunloadtest \
167
	virtimetest viruritest virkeyfiletest \
168
	viralloctest \
H
Hu Tao 已提交
169
	virauthconfigtest \
170 171
	virbitmaptest \
	vircgrouptest \
172
	vircryptotest \
M
Michal Privoznik 已提交
173
	virpcitest \
174
	virendiantest \
175
	virfiletest \
176
	virfirewalltest \
J
Ján Tomko 已提交
177
	viriscsitest \
178
	virkeycodetest \
179
	virlockspacetest \
180
	virlogtest \
181
	virrotatingfiletest \
182
	virstringtest \
183
	virportallocatortest \
V
Viktor Mihajlovski 已提交
184
	sysinfotest \
185
	virkmodtest \
186
	vircapstest \
M
Michal Privoznik 已提交
187
	domaincapstest \
188
	domainconftest \
189
	virhostdevtest \
190
	vircaps2xmltest \
M
Michal Privoznik 已提交
191
	virnetdevtest \
192
	virtypedparamtest \
193
	$(NULL)
194

E
Eric Blake 已提交
195 196 197 198
if WITH_REMOTE
test_programs += \
	virnetmessagetest \
	virnetsockettest \
199
	virnetdaemontest \
E
Eric Blake 已提交
200 201 202 203 204 205 206
	virnetserverclienttest \
	$(NULL)
if WITH_GNUTLS
test_programs += virnettlscontexttest virnettlssessiontest
endif WITH_GNUTLS
endif WITH_REMOTE

207 208
if WITH_LINUX
test_programs += fchosttest
209
test_programs += scsihosttest
210 211
endif WITH_LINUX

212 213 214 215
if WITH_LIBVIRTD
test_programs += fdstreamtest
endif WITH_LIBVIRTD

216
if WITH_DBUS
217
test_programs += virdbustest \
218 219 220 221 222
                 virsystemdtest \
                 $(NULL)
if WITH_POLKIT1
test_programs += virpolkittest
endif WITH_POLKIT1
223
endif WITH_DBUS
224

225
if WITH_SECDRIVER_SELINUX
226
if WITH_ATTR
227 228
test_programs += securityselinuxtest \
                 viridentitytest
229
if WITH_QEMU
230
test_programs += securityselinuxlabeltest
231 232 233
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
234

235 236
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
237
endif WITH_DRIVER_MODULES
238

239 240 241
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
242

243
if WITH_XEN
244
test_programs += xml2sexprtest sexpr2xmltest \
245
	xmconfigtest xencapstest statstest reconnect
246
endif WITH_XEN
247 248 249 250 251

if WITH_LIBXL
test_programs += xlconfigtest
endif WITH_LIBXL

252
if WITH_QEMU
J
Jiri Denemark 已提交
253
test_programs += qemuxml2argvtest qemuxml2xmltest \
254
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
255
	qemumonitortest qemumonitorjsontest qemuhotplugtest \
256 257
	qemuagenttest qemucapabilitiestest qemucaps2xmltest \
	qemucommandutiltest
258
endif WITH_QEMU
259

260
if WITH_LXC
261
test_programs += lxcxml2xmltest lxcconf2xmltest
262
endif WITH_LXC
263

264
if WITH_OPENVZ
265
test_programs += openvzutilstest
266
endif WITH_OPENVZ
267

268
if WITH_ESX
269
test_programs += esxutilstest
270
endif WITH_ESX
271

Y
Yohan BELLEGUIC 已提交
272 273 274 275
if WITH_VBOX
test_programs += vboxsnapshotxmltest
endif WITH_VBOX

276
if WITH_VMX
277
test_programs += vmx2xmltest xml2vmxtest
278
endif WITH_VMX
279

280 281 282 283
if WITH_VMWARE
test_programs += vmwarevertest
endif WITH_VMWARE

R
Roman Bogorodskiy 已提交
284
if WITH_BHYVE
285
test_programs += bhyvexml2argvtest bhyvexml2xmltest
R
Roman Bogorodskiy 已提交
286 287
endif WITH_BHYVE

288
if WITH_CIL
289
test_programs += objectlocking
290
endif WITH_CIL
291

292
if WITH_YAJL
293
test_programs += jsontest
294
endif WITH_YAJL
295

296 297 298 299
test_programs += \
		networkxml2xmltest \
		networkxml2xmlupdatetest \
		$(NULL)
300

301
if WITH_NETWORK
302 303 304 305
test_programs += \
		networkxml2conftest \
		networkxml2firewalltest \
		$(NULL)
306
endif WITH_NETWORK
307

308 309
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
310
endif WITH_STORAGE_SHEEPDOG
311

312
test_programs += nwfilterxml2xmltest
313

314 315
if WITH_NWFILTER
test_programs += nwfilterebiptablestest
316
test_programs += nwfilterxml2firewalltest
317 318
endif WITH_NWFILTER

319
if WITH_STORAGE
320
test_programs += storagevolxml2argvtest
321
endif WITH_STORAGE
322

323 324
if WITH_STORAGE_FS
test_programs += virstoragetest
325
endif WITH_STORAGE_FS
326

O
Osier Yang 已提交
327 328 329 330
if WITH_LINUX
test_programs += virscsitest
endif WITH_LINUX

331
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
332

333
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
334

335
test_programs += interfacexml2xmltest
336

337
test_programs += cputest
338

P
Peter Krempa 已提交
339 340
test_programs += metadatatest

J
Ján Tomko 已提交
341 342
test_programs += secretxml2xmltest

C
Cole Robinson 已提交
343 344
test_programs += genericxml2xmltest

345
if WITH_LINUX
346 347 348
test_programs += virusbtest \
	virnetdevbandwidthtest \
	$(NULL)
349 350
endif WITH_LINUX

351 352
test_scripts = \
	capabilityschematest \
353
	interfaceschematest \
354 355 356
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
M
Michal Privoznik 已提交
357
	domaincapsschematest \
358
	domainschematest \
359
	nodedevschematest \
360
	nwfilterschematest \
J
Ján Tomko 已提交
361 362
	domainsnapshotschematest \
	secretschematest
363

A
Atsushi SAKAI 已提交
364
if WITH_LIBVIRTD
365 366 367 368 369
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
370 371
	libvirtd-fail			\
	libvirtd-pool			\
372 373 374
	read-bufsiz			\
	read-non-seekable		\
	start				\
375
	virsh-uriprecedence		\
376 377
	vcpupin				\
	virsh-all			\
378
	virsh-optparse			\
379
	virsh-schedinfo			\
380 381 382
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
383

384 385 386
test_programs += 			\
	eventtest			\
	libvirtdconftest
387
else ! WITH_LIBVIRTD
388 389 390 391 392 393 394 395 396 397 398 399 400 401
EXTRA_DIST += 				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
	libvirtd-fail			\
	libvirtd-pool			\
	read-bufsiz			\
	read-non-seekable		\
	start				\
	vcpupin				\
	virsh-all			\
	virsh-optparse			\
	virsh-schedinfo			\
402 403 404
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
405
endif ! WITH_LIBVIRTD
406

407 408
test_programs += objecteventtest

J
Jamie Strandboge 已提交
409 410
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
411
else ! WITH_SECDRIVER_APPARMOR
412
EXTRA_DIST += virt-aa-helper-test
413
endif ! WITH_SECDRIVER_APPARMOR
414

415 416
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
417
test_libraries = libshunload.la \
418
		virportallocatormock.la \
419
		virnetserverclientmock.la \
420
		vircgroupmock.la \
M
Michal Privoznik 已提交
421
		virpcimock.la \
M
Michal Privoznik 已提交
422
		virnetdevmock.la \
423
		nodeinfomock.la \
D
Daniel P. Berrange 已提交
424
		$(NULL)
425
if WITH_QEMU
426 427
test_libraries += libqemumonitortestutils.la \
		qemuxml2argvmock.la \
P
Pavel Hrdina 已提交
428
		qemucaps2xmlmock.la \
429
		$(NULL)
430
endif WITH_QEMU
431

R
Roman Bogorodskiy 已提交
432 433 434 435
if WITH_BHYVE
test_libraries += bhyvexml2argvmock.la
endif WITH_BHYVE

436
if WITH_DBUS
437
test_libraries += \
438
		virdbusmock.la
439
endif WITH_DBUS
440

441
if WITH_LINUX
442 443 444
test_libraries += virusbmock.la \
		virnetdevbandwidthmock.la \
		$(NULL)
445 446
endif WITH_LINUX

447 448
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
449
noinst_LTLIBRARIES = $(test_libraries)
450
else ! WITH_TESTS
451
check_PROGRAMS = $(test_programs) $(test_helpers)
452
check_LTLIBRARIES = $(test_libraries)
453
endif ! WITH_TESTS
454

455 456
TESTS = $(test_programs) \
	$(test_scripts)
457

458
# NB, automake < 1.10 does not provide the real
459
# abs_top_{src/build}dir or builddir variables, so don't rely
460
# on them here. Fake them with 'pwd'
461 462 463
# 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

464
lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd)
465

466
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
467
TESTS_ENVIRONMENT =				\
468
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
469
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
470 471 472
  abs_builddir=$(abs_builddir)			\
  abs_srcdir=$(abs_srcdir)			\
  CONFIG_HEADER="$(lv_abs_top_builddir)/config.h"	\
473
  SHELL="$(SHELL)"				\
474
  LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \
475
  LIBVIRT_AUTOSTART=0				\
476
  LC_ALL=C					\
477
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE)	\
478 479
  $(VG)

480

481 482
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(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
if WITH_XEN
E
Eric Blake 已提交
492
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
493 494
xen_LDADDS += $(LDADDS)

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

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

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

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

reconnect_SOURCES = \
515
	reconnect.c testutils.h testutils.c
516 517
reconnect_LDADD = $(LDADDS)

518 519
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
520
statstest_LDADD = $(xen_LDADDS)
521

522
else ! WITH_XEN
523 524 525
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
526
endif ! WITH_XEN
527

528 529 530 531 532 533 534 535 536 537 538 539
if WITH_LIBXL
libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
libxl_LDADDS += $(LDADDS)

xlconfigtest_SOURCES = \
	xlconfigtest.c testutilsxen.c testutilsxen.h \
	testutils.c testutils.h
xlconfigtest_LDADD =$(libxl_LDADDS)
else ! WITH_LIBXL
EXTRA_DIST += xlconfigtest.c
endif ! WITH_LIBXL

540 541 542 543 544
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

545
if WITH_QEMU
546

547 548
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

560
qemuxml2argvtest_SOURCES = \
561
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
562
	testutils.c testutils.h
563
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LDADDS) $(LIBXML_LIBS)
564

565 566 567
qemuxml2argvmock_la_SOURCES = \
	qemuxml2argvmock.c
qemuxml2argvmock_la_CFLAGS = $(AM_CFLAGS)
568
qemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
569
qemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
570

571
qemuxml2xmltest_SOURCES = \
572
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
573
	testutils.c testutils.h
574
qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
575 576 577 578

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
579
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
580 581

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
582
qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
583

584 585 586 587 588 589
qemumonitortest_SOURCES = \
	qemumonitortest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h
qemumonitortest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
590

591 592 593 594 595
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
596 597
qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
598

599 600 601 602 603
qemucapabilitiestest_SOURCES = \
	qemucapabilitiestest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
604 605
qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)
606

607 608 609 610 611 612 613 614
qemucommandutiltest_SOURCES = \
	qemucommandutiltest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemucommandutiltest_LDADD = libqemumonitortestutils.la \
	$(qemu_LDADDS) $(LDADDS)

615 616 617 618
qemucaps2xmltest_SOURCES = \
	qemucaps2xmltest.c \
	testutils.c testutils.h \
	$(NULL)
619
qemucaps2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
620

P
Pavel Hrdina 已提交
621 622 623
qemucaps2xmlmock_la_SOURCES = \
	qemucaps2xmlmock.c
qemucaps2xmlmock_la_CFLAGS = $(AM_CFLAGS)
624
qemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
625
qemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
P
Pavel Hrdina 已提交
626

P
Peter Krempa 已提交
627 628 629 630 631
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
632
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
P
Peter Krempa 已提交
633

634 635 636 637 638
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
639
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
640

641 642 643
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
644
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
645
else ! WITH_QEMU
646
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
J
Jiri Denemark 已提交
647
	qemuhelptest.c domainsnapshotxml2xmltest.c \
648
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
649
	qemumonitorjsontest.c qemuhotplugtest.c \
650
	qemuagenttest.c qemucapabilitiestest.c \
651
	qemucaps2xmltest.c qemucommandutiltest.c \
652
	$(QEMUMONITORTESTUTILS_SOURCES)
653
endif ! WITH_QEMU
654

655 656
if WITH_LXC

E
Eric Blake 已提交
657
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
658
if WITH_NETWORK
E
Eric Blake 已提交
659
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
660
endif WITH_NETWORK
661
lxc_LDADDS += $(LDADDS)
662 663 664 665

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
666
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
667 668

lxcconf2xmltest_SOURCES = \
669
	lxcconf2xmltest.c testutilslxc.c testutilslxc.h \
670 671
	testutils.c testutils.h
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
672
else ! WITH_LXC
673
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
674
endif ! WITH_LXC
675

676 677 678 679
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
680
openvzutilstest_LDADD = $(LDADDS)
681
else ! WITH_OPENVZ
682
EXTRA_DIST += openvzutilstest.c
683
endif ! WITH_OPENVZ
684 685
EXTRA_DIST += openvzutilstest.conf

686 687 688 689
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
690
esxutilstest_LDADD = $(LDADDS)
691
else ! WITH_ESX
692
EXTRA_DIST += esxutilstest.c
693
endif ! WITH_ESX
694

Y
Yohan BELLEGUIC 已提交
695 696 697 698 699 700 701 702 703 704
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

705
if WITH_VMX
706 707 708
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
709
vmx2xmltest_LDADD = $(LDADDS)
710 711 712 713

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
714
xml2vmxtest_LDADD = $(LDADDS)
715
else ! WITH_VMX
716
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
717
endif ! WITH_VMX
718

719 720 721 722 723 724 725 726 727
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 已提交
728 729 730 731
if WITH_BHYVE
bhyvexml2argvmock_la_SOURCES = \
	bhyvexml2argvmock.c
bhyvexml2argvmock_la_CFLAGS = $(AM_CFLAGS)
732
bhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
733
bhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
R
Roman Bogorodskiy 已提交
734 735

bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
R
Roman Bogorodskiy 已提交
736 737 738
if WITH_STORAGE
bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
endif WITH_STORAGE
R
Roman Bogorodskiy 已提交
739 740 741 742 743
bhyve_LDADDS += $(LDADDS)
bhyvexml2argvtest_SOURCES = \
	bhyvexml2argvtest.c \
	testutils.c testutils.h
bhyvexml2argvtest_LDADD = $(bhyve_LDADDS)
744 745 746 747 748

bhyvexml2xmltest_SOURCES = \
	bhyvexml2xmltest.c \
	testutils.c testutils.h
bhyvexml2xmltest_LDADD = $(bhyve_LDADDS)
R
Roman Bogorodskiy 已提交
749
else ! WITH_BHYVE
750
EXTRA_DIST += bhyvexml2argvtest.c bhyvexml2xmltest.c bhyvexml2argvmock.c
R
Roman Bogorodskiy 已提交
751 752
endif ! WITH_BHYVE

753 754 755 756 757
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
758 759 760 761 762
networkxml2xmlupdatetest_SOURCES = \
	networkxml2xmlupdatetest.c \
	testutils.c testutils.h
networkxml2xmlupdatetest_LDADD = $(LDADDS)

763
if WITH_NETWORK
764 765
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
766
	testutils.c testutils.h
767
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
768 769 770 771 772 773

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

774
else ! WITH_NETWORK
775
EXTRA_DIST += networkxml2conftest.c
776
endif !	WITH_NETWORK
777

778 779 780 781
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
782 783
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
784
else ! WITH_STORAGE_SHEEPDOG
785
EXTRA_DIST += storagebackendsheepdogtest.c
786
endif ! WITH_STORAGE_SHEEPDOG
787

788 789 790 791
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
792

793 794 795 796 797
if WITH_NWFILTER
nwfilterebiptablestest_SOURCES = \
	nwfilterebiptablestest.c \
	testutils.c testutils.h
nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS)
798 799 800 801 802 803

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

J
Ján Tomko 已提交
806 807 808 809 810
secretxml2xmltest_SOURCES = \
	secretxml2xmltest.c \
	testutils.c testutils.h
secretxml2xmltest_LDADD = $(LDADDS)

C
Cole Robinson 已提交
811 812 813 814 815
genericxml2xmltest_SOURCES = \
	genericxml2xmltest.c \
	testutils.c testutils.h
genericxml2xmltest_LDADD = $(LDADDS)

J
Ján Tomko 已提交
816

817
if WITH_STORAGE
818 819 820 821
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
G
Guido Günther 已提交
822
	$(LIBXML_LIBS) \
823
	../src/libvirt_driver_storage_impl.la $(LDADDS)
J
Ján Tomko 已提交
824

825
else ! WITH_STORAGE
826
EXTRA_DIST += storagevolxml2argvtest.c
827
endif ! WITH_STORAGE
828

829 830 831 832 833
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

834 835 836 837 838
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
839 840 841
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
842
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
843

844 845 846 847 848
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

849 850 851
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
852
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
853

P
Peter Krempa 已提交
854 855 856 857 858
metadatatest_SOURCES = \
	metadatatest.c \
	testutils.c testutils.h
metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS)

859 860 861 862 863
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
864 865 866
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
867

868 869 870 871
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

872 873 874 875 876 877
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
878 879 880 881 882 883 884
commandhelper_LDADD = \
	$(WARN_CFLAGS) \
	$(NO_INDIRECT_LDFLAGS) \
	$(PROBES_O) \
	../src/libvirt_util.la \
	$(GNULIB_LIBS)

885
commandhelper_LDFLAGS = -static
886

887

888 889 890 891
virkmodtest_SOURCES = \
	virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

892
vircapstest_SOURCES = \
893 894 895 896 897 898 899 900 901 902
	vircapstest.c testutils.h testutils.c
if WITH_LXC
vircapstest_SOURCES += testutilslxc.c testutilslxc.h
endif WITH_LXC
if WITH_QEMU
vircapstest_SOURCES += testutilsqemu.c testutilsqemu.h
endif WITH_QEMU
if WITH_XEN
vircapstest_SOURCES += testutilsxen.c testutilsxen.h
endif WITH_XEN
903
vircapstest_LDADD = $(qemu_LDADDS) $(LDADDS)
904

905 906 907 908
vircaps2xmltest_SOURCES = \
	vircaps2xmltest.c testutils.h testutils.c
vircaps2xmltest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
909 910 911 912
domaincapstest_SOURCES = \
	domaincapstest.c testutils.h testutils.c
domaincapstest_LDADD = $(LDADDS)

913 914
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
915
domaincapstest_LDADD += $(qemu_LDADDS) $(GNULIB_LIBS)
916 917
endif WITH_QEMU

918 919 920
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
921 922
	$(NULL)
libvirtdconftest_LDADD = ../daemon/libvirtd_conf.la $(LDADDS)
923
else ! WITH_LIBVIRTD
924
EXTRA_DIST += libvirtdconftest.c
925
endif ! WITH_LIBVIRTD
926

927 928
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
929
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
930
virnetmessagetest_LDADD = $(LDADDS)
931

932 933
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
934
virnetsockettest_LDADD = $(LDADDS)
935

936 937
virnetdaemontest_SOURCES = \
	virnetdaemontest.c \
938
	testutils.h testutils.c
939 940
virnetdaemontest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
virnetdaemontest_LDADD = $(LDADDS)
941

942 943 944
virnetserverclienttest_SOURCES = \
	virnetserverclienttest.c \
	testutils.h testutils.c
945
virnetserverclienttest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
946 947 948 949 950
virnetserverclienttest_LDADD = $(LDADDS)

virnetserverclientmock_la_SOURCES = \
	virnetserverclientmock.c
virnetserverclientmock_la_CFLAGS = $(AM_CFLAGS)
951
virnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
952
virnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS)
953

954
if WITH_GNUTLS
955
virnettlscontexttest_SOURCES = \
956 957 958
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
959
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
960 961 962 963
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
964
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
965 966 967
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
968 969
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
970
else ! HAVE_LIBTASN1
E
Eric Blake 已提交
971
EXTRA_DIST += pkix_asn1_tab.c
972 973
endif ! HAVE_LIBTASN1
else ! WITH_GNUTLS
974
EXTRA_DIST += \
975 976 977
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
978
endif ! WITH_GNUTLS
979

980 981
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
982
virtimetest_LDADD = $(LDADDS)
983

984 985 986 987
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

988 989
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
990 991 992 993 994 995 996
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)
997

998 999 1000
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
1001
if WITH_SELINUX
1002
viridentitytest_LDADD += $(SELINUX_LIBS)
1003 1004 1005
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
endif WITH_SELINUX
1006

J
Ján Tomko 已提交
1007 1008 1009 1010
viriscsitest_SOURCES = \
	viriscsitest.c testutils.h testutils.c
viriscsitest_LDADD = $(LDADDS)

1011 1012 1013 1014
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

1015 1016 1017 1018
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

1019 1020 1021 1022
virlogtest_SOURCES = \
	virlogtest.c testutils.h testutils.c
virlogtest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
1023 1024 1025 1026
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

1027
virportallocatormock_la_SOURCES = \
1028
	virportallocatormock.c
1029 1030 1031
virportallocatormock_la_CFLAGS = $(AM_CFLAGS)
virportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS)
D
Daniel P. Berrange 已提交
1032

1033 1034 1035 1036 1037 1038 1039
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
1040
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1041
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
1042

1043 1044 1045 1046
vircryptotest_SOURCES = \
	vircryptotest.c testutils.h testutils.c
vircryptotest_LDADD = $(LDADDS)

1047 1048 1049 1050
virhostdevtest_SOURCES = \
	virhostdevtest.c testutils.h testutils.c
virhostdevtest_LDADD = $(LDADDS)

M
Michal Privoznik 已提交
1051 1052 1053 1054 1055 1056 1057
virpcitest_SOURCES = \
	virpcitest.c testutils.h testutils.c
virpcitest_LDADD = $(LDADDS)

virpcimock_la_SOURCES = \
	virpcimock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
1058
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1059
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1060

1061 1062 1063 1064
nodeinfomock_la_SOURCES = \
	nodeinfomock.c
nodeinfomock_la_CFLAGS = $(AM_CFLAGS)
nodeinfomock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1065
nodeinfomock_la_LIBADD = $(MOCKLIBS_LIBS)
1066

M
Michal Privoznik 已提交
1067 1068 1069 1070 1071 1072 1073 1074
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)
1075
virnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1076
virnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS)
M
Michal Privoznik 已提交
1077

1078 1079 1080 1081 1082
virrotatingfiletest_SOURCES = \
	virrotatingfiletest.c testutils.h testutils.c
virrotatingfiletest_CFLAGS = $(AM_CFLAGS)
virrotatingfiletest_LDADD = $(LDADDS)

1083 1084 1085 1086 1087
if WITH_LINUX
virusbtest_SOURCES = \
	virusbtest.c testutils.h testutils.c
virusbtest_LDADD = $(LDADDS)

1088 1089 1090 1091
virnetdevbandwidthtest_SOURCES = \
	virnetdevbandwidthtest.c testutils.h testutils.c
virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS)

1092 1093
virusbmock_la_SOURCES = virusbmock.c
virusbmock_la_CFLAGS = $(AM_CFLAGS)
1094
virusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1095
virusbmock_la_LIBADD = $(MOCKLIBS_LIBS)
1096 1097 1098 1099

virnetdevbandwidthmock_la_SOURCES = \
	virnetdevbandwidthmock.c
virnetdevbandwidthmock_la_CFLAGS = $(AM_CFLAGS)
1100
virnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1101
virnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS)
1102

1103
else ! WITH_LINUX
1104 1105
	EXTRA_DIST += virusbtest.c virusbmock.c \
		virnetdevbandwidthtest.c virnetdevbandwidthmock.c
1106 1107
endif ! WITH_LINUX

1108 1109 1110 1111
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1112
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
1113

1114 1115 1116 1117 1118
virdbusmock_la_SOURCES = \
	virdbusmock.c
virdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virdbusmock_la_LIBADD = $(MOCKLIBS_LIBS)
1119

1120 1121 1122 1123 1124
virpolkittest_SOURCES = \
	virpolkittest.c testutils.h testutils.c
virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS)

1125 1126
virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
1127
virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
1128
virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS)
1129

1130
else ! WITH_DBUS
1131
EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c
1132
endif ! WITH_DBUS
D
Daniel P. Berrange 已提交
1133

1134 1135
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
1136
viruritest_LDADD = $(LDADDS)
1137

1138 1139
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
1140
virkeyfiletest_LDADD = $(LDADDS)
1141

1142 1143 1144 1145
viralloctest_SOURCES = \
	viralloctest.c testutils.h testutils.c
viralloctest_LDADD = $(LDADDS)

1146 1147
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
1148
virauthconfigtest_LDADD = $(LDADDS)
1149

1150 1151
seclabeltest_SOURCES = \
	seclabeltest.c
1152
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
1153

1154
if WITH_SECDRIVER_SELINUX
1155
if WITH_ATTR
1156 1157
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
1158
else ! WITH_TESTS
1159
check_LTLIBRARIES += libsecurityselinuxhelper.la
1160
endif ! WITH_TESTS
1161 1162 1163

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
1164
libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1165 1166 1167

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
1168
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
1169 1170
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1171 1172 1173 1174 1175

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
1176
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(LDADDS) $(SELINUX_LIBS)
1177 1178
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
1179 1180 1181
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
1182 1183
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
1184

1185 1186 1187 1188
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

1189 1190 1191
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
1192

1193
viratomictest_SOURCES = \
L
Laine Stump 已提交
1194
	viratomictest.c testutils.h testutils.c
1195 1196
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
1197 1198 1199 1200
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
1201 1202 1203 1204
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

1205 1206 1207 1208
virfiletest_SOURCES = \
	virfiletest.c testutils.h testutils.c
virfiletest_LDADD = $(LDADDS)

1209 1210
virfirewalltest_SOURCES = \
	virfirewalltest.c testutils.h testutils.c
1211
virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS)
1212 1213
virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

1214
jsontest_SOURCES = \
1215
	jsontest.c testutils.h testutils.c
1216 1217
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
1218 1219 1220 1221
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

1222 1223 1224 1225
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
1226
endif WITH_DRIVER_MODULES
1227

1228 1229
if WITH_LIBVIRTD
eventtest_SOURCES = \
1230
	eventtest.c testutils.h testutils.c
1231
eventtest_LDADD = -lrt $(LDADDS)
1232
endif WITH_LIBVIRTD
1233

1234 1235
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
1236
libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
1237 1238 1239

shunloadtest_SOURCES = \
	shunloadtest.c
1240
shunloadtest_LDADD = $(LIB_PTHREAD)
1241 1242
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
1243 1244 1245 1246
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

1247 1248 1249 1250
domainconftest_SOURCES = \
	domainconftest.c testutils.h testutils.c
domainconftest_LDADD = $(LDADDS)

1251 1252 1253 1254
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

1255 1256 1257 1258 1259
objecteventtest_SOURCES = \
	objecteventtest.c \
	testutils.c testutils.h
objecteventtest_LDADD = $(LDADDS)

1260 1261 1262 1263 1264
virtypedparamtest_SOURCES = \
	virtypedparamtest.c testutils.h testutils.c
virtypedparamtest_LDADD = $(LDADDS)


1265
if WITH_LINUX
O
Osier Yang 已提交
1266 1267 1268 1269
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

1270 1271 1272 1273
scsihosttest_SOURCES = \
       scsihosttest.c testutils.h testutils.c
scsihosttest_LDADD = $(LDADDS)

1274 1275
else ! WITH_LINUX
EXTRA_DIST += fchosttest.c
1276
EXTRA_DIST += scsihosttest.c
1277 1278
endif  ! WITH_LINUX

O
Osier Yang 已提交
1279 1280 1281 1282 1283 1284 1285 1286 1287
if WITH_LINUX
virscsitest_SOURCES = \
       virscsitest.c testutils.h testutils.c
virscsitest_LDADD = $(LDADDS)

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

1288 1289 1290 1291 1292 1293
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

M
Martin Kletzander 已提交
1294
objectlocking_SOURCES = objectlocking.ml
1295 1296 1297 1298

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

1299
objectlocking: objectlocking.cmx objectlocking-files.txt
1300 1301
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
1302

1303
objectlocking-files.txt:
1304 1305
	find $(top_builddir)/src/ -name '*.i' > $@

1306
else ! WITH_CIL
1307
EXTRA_DIST += objectlocking.ml
1308
endif ! WITH_CIL
1309

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