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

3
## Copyright (C) 2005-2012 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 10 11
	-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 \
12
	-I$(top_srcdir)/src/util \
13 14
	-I$(top_srcdir)/src/conf \
	$(GETTEXT_CPPFLAGS)
E
Eric Blake 已提交
15 16

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

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

31
PROBES_O =
32
if WITH_DTRACE_PROBES
33 34 35
PROBES_O += ../src/probes.o
endif

K
Karel Zak 已提交
36
LDADDS = \
37
	$(STATIC_BINARIES) \
38 39
	$(LIBXML_LIBS) \
        $(GNUTLS_LIBS) \
40
        $(SASL_LIBS) \
41
        $(SELINUX_LIBS) \
J
Jamie Strandboge 已提交
42
        $(APPARMOR_LIBS) \
43
        $(YAJL_LIBS) \
44
        $(WARN_CFLAGS) \
45
	../src/libvirt_test.la \
46
	$(PROBES_O) \
47
	../gnulib/lib/libgnu.la \
J
John Levon 已提交
48
	$(LIBSOCKET) \
49
        $(COVERAGE_LDFLAGS)
K
Karel Zak 已提交
50

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

94
check_PROGRAMS = virshtest conftest sockettest \
E
Eric Blake 已提交
95
	nodeinfotest virbuftest \
96
	commandtest commandhelper seclabeltest \
97
	virhashtest virnetmessagetest virnetsockettest ssh \
98
	utiltest virnettlscontexttest shunloadtest \
99 100
	virtimetest viruritest virkeyfiletest \
	virauthconfigtest
101 102

check_LTLIBRARIES = libshunload.la
103 104 105 106

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

108
if WITH_XEN
109
check_PROGRAMS += xml2sexprtest sexpr2xmltest \
110
	xmconfigtest xencapstest statstest reconnect
111
endif
112
if WITH_QEMU
113
check_PROGRAMS += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
114 115
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
	qemumonitortest
116 117
endif

118 119 120 121
if WITH_OPENVZ
check_PROGRAMS += openvzutilstest
endif

122
if WITH_ESX
123 124 125 126 127
check_PROGRAMS += esxutilstest
endif

if WITH_VMX
check_PROGRAMS += vmx2xmltest xml2vmxtest
128 129
endif

130
if WITH_CIL
131
check_PROGRAMS += object-locking
132 133
endif

134 135 136 137
if HAVE_YAJL
check_PROGRAMS += jsontest
endif

138
check_PROGRAMS += networkxml2xmltest
139

140
if WITH_NETWORK
141
check_PROGRAMS += networkxml2argvtest
142
endif
143

144
check_PROGRAMS += nwfilterxml2xmltest
145

146
check_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest
147

148
check_PROGRAMS += nodedevxml2xmltest
M
Mark McLoughlin 已提交
149

150
check_PROGRAMS += interfacexml2xmltest
151

152 153
check_PROGRAMS += cputest

154 155
test_scripts = \
	capabilityschematest \
156
	interfaceschematest \
157 158 159 160
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
161
	nodedevschematest \
162 163
	nwfilterschematest \
	domainsnapshotschematest
164

A
Atsushi SAKAI 已提交
165
if WITH_LIBVIRTD
166 167 168 169 170 171
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	daemon-conf			\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
172 173
	libvirtd-fail			\
	libvirtd-pool			\
174 175 176 177 178 179
	read-bufsiz			\
	read-non-seekable		\
	start				\
	undefine			\
	vcpupin				\
	virsh-all			\
180
	virsh-optparse			\
181
	virsh-schedinfo			\
J
Jim Meyering 已提交
182
	virsh-synopsis
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
else
EXTRA_DIST += 				\
	test_conf.sh			\
	cpuset				\
	daemon-conf			\
	define-dev-segfault		\
	int-overflow			\
	libvirtd-fail			\
	libvirtd-pool			\
	read-bufsiz			\
	read-non-seekable		\
	start				\
	undefine			\
	vcpupin				\
	virsh-all			\
	virsh-optparse			\
	virsh-schedinfo			\
	virsh-synopsis
A
Atsushi SAKAI 已提交
201
endif
202

J
Jamie Strandboge 已提交
203 204
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
205 206
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
207
endif
208

209 210
EXTRA_DIST += $(test_scripts)

211 212
TESTS = virshtest \
        nodeinfotest \
213
	virbuftest \
214
	sockettest \
215
	commandtest \
216
	seclabeltest \
217
	virhashtest \
218
	virnetmessagetest \
219
	virnetsockettest \
220
	virnettlscontexttest \
221
	virtimetest \
222
	viruritest \
223
	virkeyfiletest \
224
	virauthconfigtest \
225
	shunloadtest \
M
Matthias Bolte 已提交
226
	utiltest \
227 228
	$(test_scripts)

229 230 231 232
if HAVE_YAJL
TESTS += jsontest
endif

233 234 235 236
if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
237 238 239
	xencapstest \
	reconnect \
	statstest
240
endif
241

242
if WITH_QEMU
243
TESTS += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest qemuargv2xmltest \
244 245
	 qemuhelptest domainsnapshotxml2xmltest nwfilterxml2xmltest \
	 qemumonitortest
246
endif
K
Karel Zak 已提交
247

248 249 250 251
if WITH_OPENVZ
TESTS += openvzutilstest
endif

252
if WITH_ESX
253 254 255 256 257
TESTS += esxutilstest
endif

if WITH_VMX
TESTS += vmx2xmltest xml2vmxtest
258 259
endif

260
if WITH_LIBVIRTD
261
check_PROGRAMS += eventtest
262 263 264
TESTS += eventtest
endif

265 266
TESTS += networkxml2xmltest

267
if WITH_NETWORK
268
TESTS += networkxml2argvtest
269
endif
270

271
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
272

M
Mark McLoughlin 已提交
273 274
TESTS += nodedevxml2xmltest

275 276
TESTS += interfacexml2xmltest

277 278
TESTS += cputest

279
# NB, automake < 1.10 does not provide the real
280
# abs_top_{src/build}dir or builddir variables, so don't rely
281
# on them here. Fake them with 'pwd'
282 283 284 285 286 287
# 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

288
TESTS_ENVIRONMENT =				\
289
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
290
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
291
  abs_builddir=`pwd`				\
292
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
293
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
294
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
295
  SHELL="$(SHELL)"				\
296
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
297
  LC_ALL=C					\
298 299
  $(VG)

300
valgrind:
301
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
302

303 304 305 306 307
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
sockettest_LDADD = ../src/libvirt_util.la $(LDADDS)

308
if WITH_XEN
309
xml2sexprtest_SOURCES = \
310
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
311
	testutils.c testutils.h
312
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
313 314

sexpr2xmltest_SOURCES = \
315
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
316
	testutils.c testutils.h
317
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
318

319
xmconfigtest_SOURCES = \
320
	xmconfigtest.c testutilsxen.c testutilsxen.h \
321
	testutils.c testutils.h
322
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
323

324 325 326 327 328
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

reconnect_SOURCES = \
329
	reconnect.c testutils.h testutils.c
330 331
reconnect_LDADD = $(LDADDS)

332 333 334 335
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

336 337 338 339 340 341
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

342
if WITH_QEMU
343 344 345 346 347 348 349

qemu_LDADDS = ../src/libvirt_driver_qemu.la

if WITH_NETWORK
qemu_LDADDS += ../src/libvirt_driver_network.la
endif

350
qemuxml2argvtest_SOURCES = \
351
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
352
	testutils.c testutils.h
353
qemuxml2argvtest_LDADD = $(qemu_LDADDS)  $(LDADDS)
354 355

qemuxml2xmltest_SOURCES = \
356
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
357
	testutils.c testutils.h
358
qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
359

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

365 366 367
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
368
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
369 370

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
371
qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
372

373 374 375
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
qemumonitortest_LDADD = $(qemu_LDADDS) $(LDADDS)

376 377 378 379
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
380
else
381 382
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
383
	qemumonitortest.c testutilsqemu.c testutilsqemu.h
384
endif
385

386 387 388 389 390 391 392 393 394 395
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
openvzutilstest_LDADD = ../src/libvirt_driver_openvz.la $(LDADDS)
else
EXTRA_DIST += openvzutilstest.c
endif
EXTRA_DIST += openvzutilstest.conf

396 397 398 399 400
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
esxutilstest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)
401 402 403
else
EXTRA_DIST += esxutilstest.c
endif
404

405
if WITH_VMX
406 407 408
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
409
vmx2xmltest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
410 411 412 413

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
414
xml2vmxtest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
415
else
416
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
417 418
endif

419 420 421 422 423
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

424
if WITH_NETWORK
425 426 427 428
networkxml2argvtest_SOURCES = \
	networkxml2argvtest.c \
	testutils.c testutils.h
networkxml2argvtest_LDADD = ../src/libvirt_driver_network.la $(LDADDS)
429 430 431
else
EXTRA_DIST += networkxml2argvtest.c
endif
432

433 434 435 436 437
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)

438 439 440 441 442
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

443 444 445 446 447
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
448 449 450
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
451
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
452

453 454 455 456 457
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

458 459 460 461 462
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

463 464 465 466 467
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
468 469 470 471
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

472 473 474 475
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

476 477
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
E
Eric Blake 已提交
478
commandtest_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
479 480 481 482
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
E
Eric Blake 已提交
483
commandhelper_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
484 485
commandhelper_LDADD = $(LDADDS)

486 487
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
E
Eric Blake 已提交
488
virnetmessagetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
489 490
virnetmessagetest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

491 492
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
E
Eric Blake 已提交
493
virnetsockettest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
494 495
virnetsockettest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

496
virnettlscontexttest_SOURCES = \
E
Eric Blake 已提交
497
	virnettlscontexttest.c testutils.h testutils.c
498
virnettlscontexttest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
E
Eric Blake 已提交
499 500 501 502 503 504 505
virnettlscontexttest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
else
EXTRA_DIST += pkix_asn1_tab.c
endif
506

507 508 509 510 511
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
virtimetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
virtimetest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

512 513 514 515
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
viruritest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
viruritest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)
516

517 518 519 520 521
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
virkeyfiletest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
virkeyfiletest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

522 523 524 525 526
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
virauthconfigtest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
virauthconfigtest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

527 528 529
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
J
Jamie Strandboge 已提交
530

531 532 533 534
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

535 536 537
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
538

539
jsontest_SOURCES = \
540
	jsontest.c testutils.h testutils.c
541 542
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
543 544 545 546
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

547 548
if WITH_LIBVIRTD
eventtest_SOURCES = \
549
	eventtest.c testutils.h testutils.c
550 551 552
eventtest_LDADD = -lrt $(LDADDS)
endif

553 554 555 556 557 558 559 560 561
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
shunloadtest_LDADD = -lpthread
shunloadtest_DEPENDENCIES = libshunload.la

562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582
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

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