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

3 4
SHELL = $(PREFERABLY_POSIX_SHELL)

K
Karel Zak 已提交
5
INCLUDES = \
6
	-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
K
Karel Zak 已提交
7
	-I$(top_builddir)/include \
8 9
	-I$(top_srcdir)/include \
	-I$(top_srcdir)/src \
10
	-I$(top_srcdir)/src/util \
E
Eric Blake 已提交
11 12 13
	-I$(top_srcdir)/src/conf

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

23 24 25 26 27
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
endif

K
Karel Zak 已提交
28
LDADDS = \
29
	$(STATIC_BINARIES) \
30 31
	$(LIBXML_LIBS) \
        $(GNUTLS_LIBS) \
32
        $(SASL_LIBS) \
33
        $(SELINUX_LIBS) \
J
Jamie Strandboge 已提交
34
        $(APPARMOR_LIBS) \
35
        $(YAJL_LIBS) \
36
        $(WARN_CFLAGS) \
37
	../src/libvirt_test.la \
38
	../gnulib/lib/libgnu.la \
J
John Levon 已提交
39
	$(LIBSOCKET) \
40
        $(COVERAGE_LDFLAGS)
K
Karel Zak 已提交
41

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

84
check_PROGRAMS = virshtest conftest sockettest \
85
	nodeinfotest qparamtest virbuftest \
86
	commandtest commandhelper seclabeltest \
M
Matthias Bolte 已提交
87 88
	hashtest virnetmessagetest virnetsockettest ssh \
	utiltest
89 90 91 92

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

94
if WITH_XEN
95
check_PROGRAMS += xml2sexprtest sexpr2xmltest \
96
	xmconfigtest xencapstest statstest reconnect
97
endif
98
if WITH_QEMU
99
check_PROGRAMS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
100 101
endif

102 103 104 105
if WITH_OPENVZ
check_PROGRAMS += openvzutilstest
endif

106
if WITH_ESX
107 108 109 110 111
check_PROGRAMS += esxutilstest
endif

if WITH_VMX
check_PROGRAMS += vmx2xmltest xml2vmxtest
112 113
endif

114
if WITH_CIL
115
check_PROGRAMS += object-locking
116 117
endif

118 119 120 121
if HAVE_YAJL
check_PROGRAMS += jsontest
endif

122
check_PROGRAMS += networkxml2xmltest
123

124
if WITH_NETWORK
125
check_PROGRAMS += networkxml2argvtest
126
endif
127

128
check_PROGRAMS += nwfilterxml2xmltest
129

130
check_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest
131

132
check_PROGRAMS += nodedevxml2xmltest
M
Mark McLoughlin 已提交
133

134
check_PROGRAMS += interfacexml2xmltest
135

136 137
check_PROGRAMS += cputest

138 139
test_scripts = \
	capabilityschematest \
140
	interfaceschematest \
141 142 143 144
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
145
	nodedevschematest \
146 147
	nwfilterschematest \
	domainsnapshotschematest
148

A
Atsushi SAKAI 已提交
149
if WITH_LIBVIRTD
150 151 152 153 154 155
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	daemon-conf			\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
156 157
	libvirtd-fail			\
	libvirtd-pool			\
158 159 160 161 162 163
	read-bufsiz			\
	read-non-seekable		\
	start				\
	undefine			\
	vcpupin				\
	virsh-all			\
164
	virsh-optparse			\
165
	virsh-schedinfo			\
J
Jim Meyering 已提交
166
	virsh-synopsis
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
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 已提交
185
endif
186

J
Jamie Strandboge 已提交
187 188
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
189 190
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
191
endif
192

193 194
EXTRA_DIST += $(test_scripts)

195 196 197
TESTS = virshtest \
        nodeinfotest \
	qparamtest \
198
	virbuftest \
199
	sockettest \
200
	commandtest \
201
	seclabeltest \
202
	hashtest \
203
	virnetmessagetest \
204
	virnetsockettest \
M
Matthias Bolte 已提交
205
	utiltest \
206 207
	$(test_scripts)

208 209 210 211
if HAVE_YAJL
TESTS += jsontest
endif

212 213 214 215
if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
216 217 218
	xencapstest \
	reconnect \
	statstest
219
endif
220

221
if WITH_QEMU
222
TESTS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
223
TESTS += nwfilterxml2xmltest
224
endif
K
Karel Zak 已提交
225

226 227 228 229
if WITH_OPENVZ
TESTS += openvzutilstest
endif

230
if WITH_ESX
231 232 233 234 235
TESTS += esxutilstest
endif

if WITH_VMX
TESTS += vmx2xmltest xml2vmxtest
236 237
endif

238
if WITH_LIBVIRTD
239
check_PROGRAMS += eventtest
240 241 242
TESTS += eventtest
endif

243 244
TESTS += networkxml2xmltest

245
if WITH_NETWORK
246
TESTS += networkxml2argvtest
247
endif
248

249
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
250

M
Mark McLoughlin 已提交
251 252
TESTS += nodedevxml2xmltest

253 254
TESTS += interfacexml2xmltest

255 256
TESTS += cputest

257
path_add = $$abs_top_builddir/daemon$(PATH_SEPARATOR)$$abs_top_builddir/tools$(PATH_SEPARATOR)$$abs_top_builddir/tests
J
Jim Meyering 已提交
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
TESTS_ENVIRONMENT =				\
J
Jim Meyering 已提交
263 264
  abs_top_builddir=`cd '$(top_builddir)'; pwd`	\
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
265
  abs_builddir=`pwd`				\
266
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
267
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
268
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
269
  SHELL="$(SHELL)"				\
270
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
271
  LC_ALL=C					\
272 273
  $(VG)

274
valgrind:
275
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
276

277 278 279 280 281
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
sockettest_LDADD = ../src/libvirt_util.la $(LDADDS)

282
if WITH_XEN
283
xml2sexprtest_SOURCES = \
284
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
285
	testutils.c testutils.h
286
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
287 288

sexpr2xmltest_SOURCES = \
289
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
290
	testutils.c testutils.h
291
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
292

293
xmconfigtest_SOURCES = \
294
	xmconfigtest.c testutilsxen.c testutilsxen.h \
295
	testutils.c testutils.h
296
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
297

298 299 300 301 302
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

reconnect_SOURCES = \
303
	reconnect.c testutils.h testutils.c
304 305
reconnect_LDADD = $(LDADDS)

306 307 308 309
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

310 311 312 313 314 315
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

316
if WITH_QEMU
317 318 319 320 321 322 323

qemu_LDADDS = ../src/libvirt_driver_qemu.la

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

324
qemuxml2argvtest_SOURCES = \
325
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
326
	testutils.c testutils.h
327
qemuxml2argvtest_LDADD = $(qemu_LDADDS)  $(LDADDS)
328 329

qemuxml2xmltest_SOURCES = \
330
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
331
	testutils.c testutils.h
332
qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
333 334 335 336

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
337
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
338 339

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
340
qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
341
else
342
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h
343
endif
344

345 346 347 348 349 350 351 352 353 354
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

355 356 357 358 359
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
esxutilstest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)
360 361 362
else
EXTRA_DIST += esxutilstest.c
endif
363

364
if WITH_VMX
365 366 367
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
368
vmx2xmltest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
369 370 371 372

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
373
xml2vmxtest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
374
else
375
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
376 377
endif

378 379 380 381 382
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

383
if WITH_NETWORK
384 385 386 387
networkxml2argvtest_SOURCES = \
	networkxml2argvtest.c \
	testutils.c testutils.h
networkxml2argvtest_LDADD = ../src/libvirt_driver_network.la $(LDADDS)
388 389 390
else
EXTRA_DIST += networkxml2argvtest.c
endif
391

392 393 394 395 396
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)

397 398 399 400 401
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

402 403 404 405 406
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
407 408 409
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
410
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
411

412 413 414 415 416
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

417 418 419 420 421
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

422 423 424 425 426
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
427 428 429 430
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

431 432 433 434
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

435 436
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
E
Eric Blake 已提交
437
commandtest_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
438 439 440 441
commandtest_LDADD = $(LDADDS)

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

445 446
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
E
Eric Blake 已提交
447
virnetmessagetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
448 449
virnetmessagetest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

450 451
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
E
Eric Blake 已提交
452
virnetsockettest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
453 454
virnetsockettest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

455

456 457 458
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
J
Jamie Strandboge 已提交
459

460 461 462 463
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

464 465 466 467
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

468 469 470 471
hashtest_SOURCES = \
	hashtest.c hashdata.h testutils.h testutils.c
hashtest_LDADD = $(LDADDS)

472
jsontest_SOURCES = \
473
	jsontest.c testutils.h testutils.c
474 475
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
476 477 478 479
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

480 481
if WITH_LIBVIRTD
eventtest_SOURCES = \
482
	eventtest.c testutils.h testutils.c
483 484 485
eventtest_LDADD = -lrt $(LDADDS)
endif

486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506
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

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