Makefile.am 13.3 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 \
95
	nodeinfotest qparamtest virbuftest \
96
	commandtest commandhelper seclabeltest \
97
	virhashtest virnetmessagetest virnetsockettest ssh \
98
	utiltest virnettlscontexttest shunloadtest \
99
	virtimetest viruritest
100 101

check_LTLIBRARIES = libshunload.la
102 103 104 105

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

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

117 118 119 120
if WITH_OPENVZ
check_PROGRAMS += openvzutilstest
endif

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

if WITH_VMX
check_PROGRAMS += vmx2xmltest xml2vmxtest
127 128
endif

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

133 134 135 136
if HAVE_YAJL
check_PROGRAMS += jsontest
endif

137
check_PROGRAMS += networkxml2xmltest
138

139
if WITH_NETWORK
140
check_PROGRAMS += networkxml2argvtest
141
endif
142

143
check_PROGRAMS += nwfilterxml2xmltest
144

145
check_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest
146

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

149
check_PROGRAMS += interfacexml2xmltest
150

151 152
check_PROGRAMS += cputest

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

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

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

208 209
EXTRA_DIST += $(test_scripts)

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

227 228 229 230
if HAVE_YAJL
TESTS += jsontest
endif

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

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

246 247 248 249
if WITH_OPENVZ
TESTS += openvzutilstest
endif

250
if WITH_ESX
251 252 253 254 255
TESTS += esxutilstest
endif

if WITH_VMX
TESTS += vmx2xmltest xml2vmxtest
256 257
endif

258
if WITH_LIBVIRTD
259
check_PROGRAMS += eventtest
260 261 262
TESTS += eventtest
endif

263 264
TESTS += networkxml2xmltest

265
if WITH_NETWORK
266
TESTS += networkxml2argvtest
267
endif
268

269
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
270

M
Mark McLoughlin 已提交
271 272
TESTS += nodedevxml2xmltest

273 274
TESTS += interfacexml2xmltest

275 276
TESTS += cputest

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

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

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

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

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

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

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

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

reconnect_SOURCES = \
327
	reconnect.c testutils.h testutils.c
328 329
reconnect_LDADD = $(LDADDS)

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

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

340
if WITH_QEMU
341 342 343 344 345 346 347

qemu_LDADDS = ../src/libvirt_driver_qemu.la

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

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

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

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

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

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

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

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

384 385 386 387 388 389 390 391 392 393
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

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

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

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

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

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

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

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

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

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

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

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

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

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

470 471 472 473
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

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

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

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

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

494
virnettlscontexttest_SOURCES = \
E
Eric Blake 已提交
495
	virnettlscontexttest.c testutils.h testutils.c
496
virnettlscontexttest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
E
Eric Blake 已提交
497 498 499 500 501 502 503
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
504

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

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

515 516 517
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
J
Jamie Strandboge 已提交
518

519 520 521 522
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

523 524 525 526
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

527 528 529
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
530

531
jsontest_SOURCES = \
532
	jsontest.c testutils.h testutils.c
533 534
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
535 536 537 538
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

539 540
if WITH_LIBVIRTD
eventtest_SOURCES = \
541
	eventtest.c testutils.h testutils.c
542 543 544
eventtest_LDADD = -lrt $(LDADDS)
endif

545 546 547 548 549 550 551 552 553
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

554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574
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

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