Makefile.am 17.3 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.
4 5
## See COPYING.LIB for the License of this software

6 7
SHELL = $(PREFERABLY_POSIX_SHELL)

K
Karel Zak 已提交
8
INCLUDES = \
9
	-I$(top_builddir) -I$(top_srcdir) \
10 11 12
	-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 \
13
	-I$(top_srcdir)/src/util \
14 15
	-I$(top_srcdir)/src/conf \
	$(GETTEXT_CPPFLAGS)
E
Eric Blake 已提交
16 17

AM_CFLAGS = \
18 19
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
20
	$(SASL_CFLAGS) \
21
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
22
	$(APPARMOR_CFLAGS) \
23
	$(YAJL_CFLAGS) \
E
Eric Blake 已提交
24 25
	$(COVERAGE_CFLAGS) \
	$(WARN_CFLAGS)
26

27 28 29 30 31
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
endif

32
PROBES_O =
33
if WITH_DTRACE_PROBES
34
PROBES_O += ../src/libvirt_probes.lo
35 36
endif

K
Karel Zak 已提交
37
LDADDS = \
38
        $(WARN_CFLAGS) \
39
	$(PROBES_O) \
40 41
	../src/libvirt.la \
	../gnulib/lib/libgnu.la
K
Karel Zak 已提交
42

43
EXTRA_DIST =		\
44
	capabilityschemadata \
E
Eric Blake 已提交
45 46 47 48
	capabilityschematest \
	commanddata \
	confdata \
	cputestdata \
49
	domainschemadata \
E
Eric Blake 已提交
50 51 52 53
	domainschematest \
	domainsnapshotschematest \
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
54
	interfaceschemadata \
55
	lxcxml2xmldata \
E
Eric Blake 已提交
56 57 58
	networkschematest \
	networkxml2xmlin \
	networkxml2xmlout \
59
	networkxml2confdata \
E
Eric Blake 已提交
60 61 62 63 64 65 66 67 68 69
	nodedevschemadata \
	nodedevschematest \
	nodeinfodata     \
	nwfilterschematest \
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
	qemuhelpdata \
	qemuxml2argvdata \
	qemuxml2xmloutdata \
P
Philipp Hahn 已提交
70
	qemuxmlnsdata \
71
	securityselinuxlabeldata \
E
Eric Blake 已提交
72 73
	schematestutils.sh \
	sexpr2xmldata \
74
	storagepoolschematest \
75
	storagepoolxml2xmlin \
E
Eric Blake 已提交
76
	storagepoolxml2xmlout \
77
	storagevolschematest \
78
	storagevolxml2xmlin \
E
Eric Blake 已提交
79
	storagevolxml2xmlout \
V
Viktor Mihajlovski 已提交
80
	sysinfodata \
E
Eric Blake 已提交
81
	test-lib.sh	\
82
	vmx2xmldata \
E
Eric Blake 已提交
83 84 85
	xencapsdata \
	xmconfigdata \
	xml2sexprdata \
86 87
	xml2vmxdata \
	.valgrind.supp
K
Karel Zak 已提交
88

89 90
test_helpers = commandhelper ssh conftest
test_programs = virshtest sockettest \
E
Eric Blake 已提交
91
	nodeinfotest virbuftest \
92 93
	commandtest seclabeltest \
	virhashtest virnetmessagetest virnetsockettest \
94
	viratomictest \
95
	utiltest shunloadtest \
96
	virtimetest viruritest virkeyfiletest \
H
Hu Tao 已提交
97
	virauthconfigtest \
E
Eric Blake 已提交
98
	virbitmaptest virendiantest \
99
	virlockspacetest \
100
	virstringtest \
D
Daniel P. Berrange 已提交
101
        virportallocatortest \
V
Viktor Mihajlovski 已提交
102
	sysinfotest \
103
	$(NULL)
104

105
if WITH_GNUTLS
106 107 108
test_programs += virnettlscontexttest
endif

109 110
if WITH_SECDRIVER_SELINUX
test_programs += securityselinuxtest
111
if WITH_QEMU
112 113 114
if WITH_ATTR
test_programs += securityselinuxlabeltest
endif
115
endif
116
endif
117

118 119 120 121
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
endif

122 123 124
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
125

126
if WITH_XEN
127
test_programs += xml2sexprtest sexpr2xmltest \
128
	xmconfigtest xencapstest statstest reconnect
129
endif
130
if WITH_QEMU
131
test_programs += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
132
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
133
	qemumonitortest qemumonitorjsontest
134 135
endif

136
if WITH_LXC
137
test_programs += lxcxml2xmltest
138 139
endif

140
if WITH_OPENVZ
141
test_programs += openvzutilstest
142 143
endif

144
if WITH_ESX
145
test_programs += esxutilstest
146 147 148
endif

if WITH_VMX
149
test_programs += vmx2xmltest xml2vmxtest
150 151
endif

152
if WITH_CIL
153
test_programs += object-locking
154 155
endif

156
if WITH_YAJL
157
test_programs += jsontest
158 159
endif

160
test_programs += networkxml2xmltest
161

162
if WITH_NETWORK
163
test_programs += networkxml2conftest
164
endif
165

166 167 168 169
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
endif

170
test_programs += nwfilterxml2xmltest
171

172
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
173

174
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
175

176
test_programs += interfacexml2xmltest
177

178
test_programs += cputest
179

180 181
test_scripts = \
	capabilityschematest \
182
	interfaceschematest \
183 184 185 186
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
187
	nodedevschematest \
188 189
	nwfilterschematest \
	domainsnapshotschematest
190

A
Atsushi SAKAI 已提交
191
if WITH_LIBVIRTD
192 193 194 195 196
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
197 198
	libvirtd-fail			\
	libvirtd-pool			\
199 200 201 202 203
	read-bufsiz			\
	read-non-seekable		\
	start				\
	vcpupin				\
	virsh-all			\
204
	virsh-optparse			\
205
	virsh-schedinfo			\
206 207 208
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
209

210 211 212
test_programs += 			\
	eventtest			\
	libvirtdconftest
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
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			\
228 229 230
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
A
Atsushi SAKAI 已提交
231
endif
232

J
Jamie Strandboge 已提交
233 234
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
235 236
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
237
endif
238

239 240
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
241 242 243
test_libraries = libshunload.la \
		libvirportallocatormock.la \
		$(NULL)
244 245 246 247
if WITH_QEMU
test_libraries += libqemumonitortestutils.la
endif

248 249
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
250
noinst_LTLIBRARIES = $(test_libraries)
251 252
else
check_PROGRAMS = $(test_programs) $(test_helpers)
253
check_LTLIBRARIES = $(test_libraries)
254
endif
255

256 257
TESTS = $(test_programs) \
	$(test_scripts)
258

259
# NB, automake < 1.10 does not provide the real
260
# abs_top_{src/build}dir or builddir variables, so don't rely
261
# on them here. Fake them with 'pwd'
262 263 264 265 266 267
# 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`
path_add = $(lv_abs_top_builddir)/daemon$(PATH_SEPARATOR)$(lv_abs_top_builddir)/tools$(PATH_SEPARATOR)$(lv_abs_top_builddir)/tests

268
TESTS_ENVIRONMENT =				\
269
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
270
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
271
  abs_builddir=`pwd`				\
272
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
273
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
274
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
275
  SHELL="$(SHELL)"				\
276
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
277
  LIBVIRT_AUTOSTART=0				\
278
  LC_ALL=C					\
279 280
  $(VG)

281

282
valgrind:
283
	$(MAKE) check VG="libtool --mode=execute valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
284

285 286 287
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
288
sockettest_LDADD = $(LDADDS)
289

290
if WITH_XEN
E
Eric Blake 已提交
291
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
292 293
xen_LDADDS += $(LDADDS)

294
xml2sexprtest_SOURCES = \
295
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
296
	testutils.c testutils.h
297
xml2sexprtest_LDADD = $(xen_LDADDS)
298 299

sexpr2xmltest_SOURCES = \
300
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
301
	testutils.c testutils.h
302
sexpr2xmltest_LDADD = $(xen_LDADDS)
303

304
xmconfigtest_SOURCES = \
305
	xmconfigtest.c testutilsxen.c testutilsxen.h \
306
	testutils.c testutils.h
307
xmconfigtest_LDADD = $(xen_LDADDS)
308

309 310
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
311
xencapstest_LDADD = $(xen_LDADDS)
312 313

reconnect_SOURCES = \
314
	reconnect.c testutils.h testutils.c
315 316
reconnect_LDADD = $(LDADDS)

317 318
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
319
statstest_LDADD = $(xen_LDADDS)
320

321 322 323 324 325 326
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

327 328 329 330 331
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

332
if WITH_QEMU
333

334 335 336 337 338
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)
libqemumonitortestutils_la_CFLAGS = \
	-Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)


339
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
340
if WITH_NETWORK
E
Eric Blake 已提交
341
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
342
endif
343
if WITH_DTRACE_PROBES
344
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
345
endif
346
qemu_LDADDS += $(LDADDS)
347

348
qemuxml2argvtest_SOURCES = \
349
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
350
	testutils.c testutils.h
351
qemuxml2argvtest_LDADD = $(qemu_LDADDS)
352 353

qemuxml2xmltest_SOURCES = \
354
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
355
	testutils.c testutils.h
356
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
357

P
Philipp Hahn 已提交
358 359 360
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
361
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
362

363 364 365
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
366
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
367 368

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
369
qemuhelptest_LDADD = $(qemu_LDADDS)
370

371
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
372
qemumonitortest_LDADD = $(qemu_LDADDS)
373

374 375 376 377 378 379 380 381
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemumonitorjsontest_LDADD = $(qemu_LDADDS) libqemumonitortestutils.la
qemumonitorjsontest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\""  $(AM_CFLAGS)

382 383 384
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
385
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
386
else
387 388
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
389
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
390
	qemumonitorjsontest.c \
391
	$(QEMUMONITORTESTUTILS_SOURCES)
392
endif
393

394 395
if WITH_LXC

E
Eric Blake 已提交
396
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
397
if WITH_NETWORK
E
Eric Blake 已提交
398
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
399 400
endif
lxc_LDADDS += $(LDADDS)
401 402 403 404

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
405
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
406 407 408 409
else
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
endif

410 411 412 413
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
414
openvzutilstest_LDADD = $(LDADDS)
415 416 417 418 419
else
EXTRA_DIST += openvzutilstest.c
endif
EXTRA_DIST += openvzutilstest.conf

420 421 422 423
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
424
esxutilstest_LDADD = $(LDADDS)
425 426 427
else
EXTRA_DIST += esxutilstest.c
endif
428

429
if WITH_VMX
430 431 432
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
433
vmx2xmltest_LDADD = $(LDADDS)
434 435 436 437

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
438
xml2vmxtest_LDADD = $(LDADDS)
439
else
440
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
441 442
endif

443 444 445 446 447
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

448
if WITH_NETWORK
449 450
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
451
	testutils.c testutils.h
452
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
453
else
454
EXTRA_DIST += networkxml2conftest.c
455
endif
456

457 458 459 460
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
461 462
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
463 464 465 466
else
EXTRA_DIST += storagebackendsheepdogtest.c
endif

467 468 469 470 471
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)

472 473 474 475 476
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

477 478 479 480 481
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
482 483 484
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
485
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
486

487 488 489 490 491
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

492 493 494 495 496
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

497 498 499 500 501
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
502 503 504 505
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

506 507 508 509
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

510 511
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
E
Eric Blake 已提交
512
commandtest_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
513 514 515 516
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
E
Eric Blake 已提交
517
commandhelper_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
518
commandhelper_LDADD = $(LDADDS)
519
commandhelper_LDFLAGS = -static
520

521 522 523 524 525 526 527 528 529 530
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
	../daemon/libvirtd-config.c
libvirtdconftest_CFLAGS = $(AM_CFLAGS)
libvirtdconftest_LDADD = $(LDADDS)
else
EXTRA_DIST += libvirtdconftest.c
endif

531 532
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
E
Eric Blake 已提交
533 534
virnetmessagetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" \
		$(XDR_CFLAGS) $(AM_CFLAGS)
535
virnetmessagetest_LDADD = $(LDADDS)
536

537 538
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
E
Eric Blake 已提交
539
virnetsockettest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
540
virnetsockettest_LDADD = $(LDADDS)
541

542
if WITH_GNUTLS
543
virnettlscontexttest_SOURCES = \
E
Eric Blake 已提交
544
	virnettlscontexttest.c testutils.h testutils.c
545
virnettlscontexttest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
546
virnettlscontexttest_LDADD = $(LDADDS)
E
Eric Blake 已提交
547 548 549 550 551 552
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
else
EXTRA_DIST += pkix_asn1_tab.c
endif
553 554 555 556
else
EXTRA_DIST += \
	virnettlscontexttest.c testutils.h testutils.c pkix_asn1_tab.c
endif
557

558 559 560
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
virtimetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
561
virtimetest_LDADD = $(LDADDS)
562

563 564 565 566 567
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
virstringtest_LDADD = $(LDADDS)

568 569 570 571 572
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
virlockspacetest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
573 574 575 576 577 578 579 580 581 582 583 584
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
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


585 586 587
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
viruritest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
588
viruritest_LDADD = $(LDADDS)
589

590 591 592
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
virkeyfiletest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
593
virkeyfiletest_LDADD = $(LDADDS)
594

595 596 597
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
virauthconfigtest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
598
virauthconfigtest_LDADD = $(LDADDS)
599

600 601
seclabeltest_SOURCES = \
	seclabeltest.c
602
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
603

604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620
if WITH_SECDRIVER_SELINUX
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
else
check_LTLIBRARIES += libsecurityselinuxhelper.la
endif

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

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
securityselinuxtest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
securityselinuxtest_LDADD = $(LDADDS)
621 622 623 624 625 626 627 628 629 630 631 632
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la ../src/libvirt.la

if WITH_QEMU
if WITH_ATTR
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
securityselinuxlabeltest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
securityselinuxlabeltest_LDADD = $(qemu_LDADDS)
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la ../src/libvirt.la
endif
endif
633
endif
634
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c securityselinuxhelper.c
635

636 637 638 639
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

640 641 642
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
643

644
viratomictest_SOURCES = \
L
Laine Stump 已提交
645
	viratomictest.c testutils.h testutils.c
646 647
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
648 649 650 651
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
652 653 654 655
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

656
jsontest_SOURCES = \
657
	jsontest.c testutils.h testutils.c
658 659
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
660 661 662 663
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

664 665 666 667 668 669 670
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
virdrivermoduletest_LDADD = $(LDADDS)
endif

671 672
if WITH_LIBVIRTD
eventtest_SOURCES = \
673
	eventtest.c testutils.h testutils.c
674 675 676
eventtest_LDADD = -lrt $(LDADDS)
endif

677 678 679 680 681 682
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
libshunload_la_LDFLAGS = -module -avoid-version -rpath /evil/libtool/hack/to/force/shared/lib/creation

shunloadtest_SOURCES = \
	shunloadtest.c
683
shunloadtest_LDADD = $(LIB_PTHREAD)
684 685
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
686 687 688 689
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710
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
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) $(CILOPTLIBS) $< -o $@

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

else
EXTRA_DIST += object-locking.ml
endif

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