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

E
Eric Blake 已提交
3
## Copyright (C) 2005-2013 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)

K
Karel Zak 已提交
21
INCLUDES = \
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 28
	-I$(top_srcdir)/src/conf \
	$(GETTEXT_CPPFLAGS)
E
Eric Blake 已提交
29 30

AM_CFLAGS = \
31
	-Dabs_builddir="\"`pwd`\"" \
32 33
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
34
	$(SASL_CFLAGS) \
35
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
36
	$(APPARMOR_CFLAGS) \
37
	$(YAJL_CFLAGS) \
E
Eric Blake 已提交
38 39
	$(COVERAGE_CFLAGS) \
	$(WARN_CFLAGS)
40

41 42 43 44 45
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
endif

46
PROBES_O =
47
if WITH_DTRACE_PROBES
48
PROBES_O += ../src/libvirt_probes.lo
49 50
endif

K
Karel Zak 已提交
51
LDADDS = \
52
        $(WARN_CFLAGS) \
53
	$(PROBES_O) \
54 55
	../src/libvirt.la \
	../gnulib/lib/libgnu.la
K
Karel Zak 已提交
56

57
EXTRA_DIST =		\
58
	capabilityschemadata \
E
Eric Blake 已提交
59 60 61 62
	capabilityschematest \
	commanddata \
	confdata \
	cputestdata \
63
	domainschemadata \
E
Eric Blake 已提交
64 65 66 67
	domainschematest \
	domainsnapshotschematest \
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
O
Osier Yang 已提交
68
	fchostdata \
69
	interfaceschemadata \
70
	lxcxml2xmldata \
E
Eric Blake 已提交
71 72 73
	networkschematest \
	networkxml2xmlin \
	networkxml2xmlout \
74
	networkxml2confdata \
E
Eric Blake 已提交
75 76 77 78 79 80 81 82
	nodedevschemadata \
	nodedevschematest \
	nodeinfodata     \
	nwfilterschematest \
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
	qemuhelpdata \
83
	qemuhotplugtestdata \
E
Eric Blake 已提交
84 85
	qemuxml2argvdata \
	qemuxml2xmloutdata \
P
Philipp Hahn 已提交
86
	qemuxmlnsdata \
87
	securityselinuxlabeldata \
E
Eric Blake 已提交
88 89
	schematestutils.sh \
	sexpr2xmldata \
90
	storagepoolschemadata \
91
	storagepoolschematest \
92
	storagepoolxml2xmlin \
E
Eric Blake 已提交
93
	storagepoolxml2xmlout \
94
	storagevolxml2argvdata \
95
	storagevolschemadata \
96
	storagevolschematest \
97
	storagevolxml2xmlin \
E
Eric Blake 已提交
98
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
99
	sysinfodata \
E
Eric Blake 已提交
100
	test-lib.sh	\
101
	virsh-uriprecedence \
102
	vmx2xmldata \
E
Eric Blake 已提交
103 104 105
	xencapsdata \
	xmconfigdata \
	xml2sexprdata \
106
	xml2vmxdata \
O
Osier Yang 已提交
107
	.valgrind.supp
K
Karel Zak 已提交
108

G
Gene Czarcinski 已提交
109
test_helpers = commandhelper ssh test_conf
110
test_programs = virshtest sockettest \
E
Eric Blake 已提交
111
	nodeinfotest virbuftest \
112 113
	commandtest seclabeltest \
	virhashtest virnetmessagetest virnetsockettest \
114
	viratomictest \
115
	utiltest shunloadtest \
116
	virtimetest viruritest virkeyfiletest \
H
Hu Tao 已提交
117
	virauthconfigtest \
118 119 120
	virbitmaptest \
	vircgrouptest \
	virendiantest \
121
	viridentitytest \
122
	virkeycodetest \
123
	virlockspacetest \
124
	virstringtest \
D
Daniel P. Berrange 已提交
125
        virportallocatortest \
V
Viktor Mihajlovski 已提交
126
	sysinfotest \
127
	virstoragetest \
128
        fdstreamtest \
O
Osier Yang 已提交
129
        fchosttest \
130
	$(NULL)
131

132
if WITH_DBUS
133 134
test_programs += virdbustest \
                 virsystemdtest
135 136
endif

137
if WITH_GNUTLS
138
test_programs += virnettlscontexttest virnettlssessiontest
139 140
endif

141
if WITH_SECDRIVER_SELINUX
142
if WITH_ATTR
143
test_programs += securityselinuxtest
144
if WITH_QEMU
145 146
test_programs += securityselinuxlabeltest
endif
147
endif
148
endif
149

150 151 152 153
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
endif

154 155 156
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
157

158
if WITH_XEN
159
test_programs += xml2sexprtest sexpr2xmltest \
160
	xmconfigtest xencapstest statstest reconnect
161
endif
162
if WITH_QEMU
163
test_programs += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
164
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
P
Peter Krempa 已提交
165 166
	qemumonitortest qemumonitorjsontest qemuhotplugtest \
	qemuagenttest
167 168
endif

169
if WITH_LXC
170
test_programs += lxcxml2xmltest
171 172
endif

173
if WITH_OPENVZ
174
test_programs += openvzutilstest
175 176
endif

177
if WITH_ESX
178
test_programs += esxutilstest
179 180 181
endif

if WITH_VMX
182
test_programs += vmx2xmltest xml2vmxtest
183 184
endif

185
if WITH_CIL
186
test_programs += object-locking
187 188
endif

189
if WITH_YAJL
190
test_programs += jsontest
191 192
endif

193
test_programs += networkxml2xmltest
194

195
if WITH_NETWORK
196
test_programs += networkxml2conftest
197
endif
198

199 200 201 202
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
endif

203
test_programs += nwfilterxml2xmltest
204

205
if WITH_STORAGE
206
test_programs += storagevolxml2argvtest
207
endif
208

209
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
210

211
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
212

213
test_programs += interfacexml2xmltest
214

215
test_programs += cputest
216

217 218
test_scripts = \
	capabilityschematest \
219
	interfaceschematest \
220 221 222 223
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
224
	nodedevschematest \
225 226
	nwfilterschematest \
	domainsnapshotschematest
227

A
Atsushi SAKAI 已提交
228
if WITH_LIBVIRTD
229 230 231 232 233
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
234 235
	libvirtd-fail			\
	libvirtd-pool			\
236 237 238
	read-bufsiz			\
	read-non-seekable		\
	start				\
239
	virsh-uriprecedence		\
240 241
	vcpupin				\
	virsh-all			\
242
	virsh-optparse			\
243
	virsh-schedinfo			\
244 245 246
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
247

248 249 250
test_programs += 			\
	eventtest			\
	libvirtdconftest
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265
else
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			\
266 267 268
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
A
Atsushi SAKAI 已提交
269
endif
270

J
Jamie Strandboge 已提交
271 272
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
273 274
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
275
endif
276

277 278
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
279 280
test_libraries = libshunload.la \
		libvirportallocatormock.la \
281
		vircgroupmock.la \
D
Daniel P. Berrange 已提交
282
		$(NULL)
283 284 285 286
if WITH_QEMU
test_libraries += libqemumonitortestutils.la
endif

287 288 289 290
if WITH_DBUS
test_libraries += virsystemdmock.la
endif

291 292
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
293
noinst_LTLIBRARIES = $(test_libraries)
294 295
else
check_PROGRAMS = $(test_programs) $(test_helpers)
296
check_LTLIBRARIES = $(test_libraries)
297
endif
298

299 300
TESTS = $(test_programs) \
	$(test_scripts)
301

302
# NB, automake < 1.10 does not provide the real
303
# abs_top_{src/build}dir or builddir variables, so don't rely
304
# on them here. Fake them with 'pwd'
305 306 307 308
# 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

lv_abs_top_builddir=`cd '$(top_builddir)'; pwd`
309 310
path_add = $(subst :,$(PATH_SEPARATOR),\
	$(subst !,$(lv_abs_top_builddir)/,!daemon:!tools:!tests))
311

312
VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT)
313
TESTS_ENVIRONMENT =				\
314
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
315
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
316
  abs_builddir=`pwd`				\
317
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
318
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
319
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
320
  SHELL="$(SHELL)"				\
321
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
322
  LIBVIRT_AUTOSTART=0				\
323
  LC_ALL=C					\
324
  VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE)	\
325 326
  $(VG)

327

328 329
VALGRIND = valgrind --quiet --leak-check=full \
	--suppressions=$(srcdir)/.valgrind.supp
330
valgrind:
331
	$(MAKE) check VG="libtool --mode=execute $(VALGRIND)"
332

333 334 335
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
336
sockettest_LDADD = $(LDADDS)
337

338
if WITH_XEN
E
Eric Blake 已提交
339
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
340 341
xen_LDADDS += $(LDADDS)

342
xml2sexprtest_SOURCES = \
343
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
344
	testutils.c testutils.h
345
xml2sexprtest_LDADD = $(xen_LDADDS)
346 347

sexpr2xmltest_SOURCES = \
348
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
349
	testutils.c testutils.h
350
sexpr2xmltest_LDADD = $(xen_LDADDS)
351

352
xmconfigtest_SOURCES = \
353
	xmconfigtest.c testutilsxen.c testutilsxen.h \
354
	testutils.c testutils.h
355
xmconfigtest_LDADD = $(xen_LDADDS)
356

357 358
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
359
xencapstest_LDADD = $(xen_LDADDS)
360 361

reconnect_SOURCES = \
362
	reconnect.c testutils.h testutils.c
363 364
reconnect_LDADD = $(LDADDS)

365 366
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
367
statstest_LDADD = $(xen_LDADDS)
368

369 370 371 372 373 374
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

375 376 377 378 379
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

380
if WITH_QEMU
381

382 383
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

384
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
385
if WITH_NETWORK
E
Eric Blake 已提交
386
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
387
endif
388
if WITH_DTRACE_PROBES
389
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
390
endif
391
qemu_LDADDS += $(LDADDS)
392

393
qemuxml2argvtest_SOURCES = \
394
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
395
	testutils.c testutils.h
396
qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LIBXML_LIBS)
397 398

qemuxml2xmltest_SOURCES = \
399
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
400
	testutils.c testutils.h
401
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
402

P
Philipp Hahn 已提交
403 404 405
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
406
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
407

408 409 410
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
411
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
412 413

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
414
qemuhelptest_LDADD = $(qemu_LDADDS)
415

416
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
417
qemumonitortest_LDADD = $(qemu_LDADDS)
418

419 420 421 422 423
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
424
qemumonitorjsontest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
425

P
Peter Krempa 已提交
426 427 428 429 430
qemuagenttest_SOURCES = \
	qemuagenttest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
431
qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
P
Peter Krempa 已提交
432

433 434 435 436 437
qemuhotplugtest_SOURCES = \
	qemuhotplugtest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
438
qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
439

440 441 442
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
443
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
444
else
445 446
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
447
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
448
	qemumonitorjsontest.c qemuhotplugtest.c \
P
Peter Krempa 已提交
449
	qemuagenttest.c \
450
	$(QEMUMONITORTESTUTILS_SOURCES)
451
endif
452

453 454
if WITH_LXC

E
Eric Blake 已提交
455
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
456
if WITH_NETWORK
E
Eric Blake 已提交
457
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
458 459
endif
lxc_LDADDS += $(LDADDS)
460 461 462 463

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
464
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
465 466 467 468
else
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
endif

469 470 471 472
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
473
openvzutilstest_LDADD = $(LDADDS)
474 475 476 477 478
else
EXTRA_DIST += openvzutilstest.c
endif
EXTRA_DIST += openvzutilstest.conf

479 480 481 482
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
483
esxutilstest_LDADD = $(LDADDS)
484 485 486
else
EXTRA_DIST += esxutilstest.c
endif
487

488
if WITH_VMX
489 490 491
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
492
vmx2xmltest_LDADD = $(LDADDS)
493 494 495 496

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
497
xml2vmxtest_LDADD = $(LDADDS)
498
else
499
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
500 501
endif

502 503 504 505 506
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

507
if WITH_NETWORK
508 509
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
510
	testutils.c testutils.h
511
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
512
else
513
EXTRA_DIST += networkxml2conftest.c
514
endif
515

516 517 518 519
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
520 521
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
522 523 524 525
else
EXTRA_DIST += storagebackendsheepdogtest.c
endif

526 527 528 529
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
530

531
if WITH_STORAGE
532 533 534 535 536
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
537 538 539
else
EXTRA_DIST += storagevolxml2argvtest.c
endif
540

541 542 543 544 545
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

546 547 548 549 550
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
551 552 553
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
554
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
555

556 557 558 559 560
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

561 562 563
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
564
cputest_LDADD = $(LDADDS) $(LIBXML_LIBS)
565

566 567 568 569 570
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
571 572 573
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
574

575 576 577 578
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

579 580 581 582 583 584 585
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
586
commandhelper_LDFLAGS = -static
587

588 589 590 591 592 593 594 595 596
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
	../daemon/libvirtd-config.c
libvirtdconftest_LDADD = $(LDADDS)
else
EXTRA_DIST += libvirtdconftest.c
endif

597 598
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
599
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
600
virnetmessagetest_LDADD = $(LDADDS)
601

602 603
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
604
virnetsockettest_LDADD = $(LDADDS)
605

606
if WITH_GNUTLS
607
virnettlscontexttest_SOURCES = \
608 609 610
	virnettlscontexttest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
611
virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
612 613 614 615
virnettlssessiontest_SOURCES = \
	virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c
616
virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS)
E
Eric Blake 已提交
617 618 619
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
620 621
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
E
Eric Blake 已提交
622 623 624
else
EXTRA_DIST += pkix_asn1_tab.c
endif
625 626
else
EXTRA_DIST += \
627 628 629
	virnettlscontexttest.c virnettlssessiontest.c \
	virnettlshelpers.h virnettlshelpers.c \
	testutils.h testutils.c pkix_asn1_tab.c
630
endif
631

632 633
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
634
virtimetest_LDADD = $(LDADDS)
635

636 637 638 639
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

640 641 642 643
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

644 645 646 647
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

648 649 650 651
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

652 653 654 655
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
656 657 658 659 660 661 662 663 664 665
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

libvirportallocatormock_la_SOURCES = \
	virportallocatortest.c
libvirportallocatormock_la_CFLAGS = $(AM_CFLAGS) -DMOCK_HELPER=1
libvirportallocatormock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

666 667 668 669 670 671 672 673 674 675
vircgrouptest_SOURCES = \
	vircgrouptest.c testutils.h testutils.c
vircgrouptest_LDADD = $(LDADDS)

vircgroupmock_la_SOURCES = \
	vircgroupmock.c
vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
vircgroupmock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

676 677 678 679
if WITH_DBUS
virdbustest_SOURCES = \
	virdbustest.c testutils.h testutils.c
virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
680
virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS)
681 682 683 684 685 686 687 688 689 690 691 692

virsystemdtest_SOURCES = \
	virsystemdtest.c testutils.h testutils.c
virsystemdtest_CFLAGS = $(AM_CFLAGS)
virsystemdtest_LDADD = $(LDADDS)

virsystemdmock_la_SOURCES = \
	virsystemdmock.c
virsystemdmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virsystemdmock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

693
else
694
EXTRA_DIST += virdbustest.c virsystemdtest.c virsystemdmock.c
695
endif
D
Daniel P. Berrange 已提交
696

697 698
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
699
viruritest_LDADD = $(LDADDS)
700

701 702
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
703
virkeyfiletest_LDADD = $(LDADDS)
704

705 706
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
707
virauthconfigtest_LDADD = $(LDADDS)
708

709 710
seclabeltest_SOURCES = \
	seclabeltest.c
711
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
712

713
if WITH_SECDRIVER_SELINUX
714
if WITH_ATTR
715 716 717 718 719 720 721 722 723 724 725 726 727
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
else
check_LTLIBRARIES += libsecurityselinuxhelper.la
endif

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
libsecurityselinuxhelper_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
728
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
729 730
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
731 732 733 734 735

if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
736
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
737 738
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
	../src/libvirt.la
739 740
endif
endif
741
endif
742 743
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
	securityselinuxhelper.c
744

745 746 747 748
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

749 750 751
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
752

753
viratomictest_SOURCES = \
L
Laine Stump 已提交
754
	viratomictest.c testutils.h testutils.c
755 756
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
757 758 759 760
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
761 762 763 764
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

765
jsontest_SOURCES = \
766
	jsontest.c testutils.h testutils.c
767 768
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
769 770 771 772
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

773 774 775 776 777 778
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
endif

779 780
if WITH_LIBVIRTD
eventtest_SOURCES = \
781
	eventtest.c testutils.h testutils.c
782 783 784
eventtest_LDADD = -lrt $(LDADDS)
endif

785 786
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
787 788
libshunload_la_LDFLAGS = -module -avoid-version \
	-rpath /evil/libtool/hack/to/force/shared/lib/creation
789 790 791

shunloadtest_SOURCES = \
	shunloadtest.c
792
shunloadtest_LDADD = $(LIB_PTHREAD)
793 794
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
795 796 797 798
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

799 800 801 802
fdstreamtest_SOURCES = \
	fdstreamtest.c testutils.h testutils.c
fdstreamtest_LDADD = $(LDADDS)

O
Osier Yang 已提交
803 804 805 806
fchosttest_SOURCES = \
       fchosttest.c testutils.h testutils.c
fchosttest_LDADD = $(LDADDS)

807 808 809 810 811 812 813 814 815 816 817 818
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

object_locking_SOURCES = object-locking.ml

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

object-locking: object-locking.cmx object-locking-files.txt
819 820
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
	  $(CILOPTLIBS) $< -o $@
821 822 823 824 825 826 827 828

object-locking-files.txt:
	find $(top_builddir)/src/ -name '*.i' > $@

else
EXTRA_DIST += object-locking.ml
endif

829 830
CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx \
	object-locking-files.txt