Makefile.am 10.0 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 \
11
	-I$(top_srcdir)/src/conf \
12 13
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
14
	$(SASL_CFLAGS) \
15
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
16
	$(APPARMOR_CFLAGS) \
17
         $(COVERAGE_CFLAGS) \
18
         $(WARN_CFLAGS)
19

20 21 22 23 24
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
endif

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

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

78
check_PROGRAMS = virshtest conftest sockettest \
79
	nodeinfotest qparamtest virbuftest \
80
	commandtest commandhelper seclabeltest \
81
	hashtest virnetmessagetest
82

83
if WITH_XEN
84
check_PROGRAMS += xml2sexprtest sexpr2xmltest \
85 86 87 88
	xmconfigtest xencapstest
if ENABLE_XEN_TESTS
check_PROGRAMS += statstest reconnect
endif
89
endif
90
if WITH_QEMU
91
check_PROGRAMS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
92 93
endif

94 95 96 97
if WITH_OPENVZ
check_PROGRAMS += openvzutilstest
endif

98
if WITH_ESX
99 100 101 102 103
check_PROGRAMS += esxutilstest
endif

if WITH_VMX
check_PROGRAMS += vmx2xmltest xml2vmxtest
104 105
endif

106
if WITH_CIL
107
check_PROGRAMS += object-locking
108 109
endif

110
check_PROGRAMS += networkxml2xmltest
111

112
check_PROGRAMS += nwfilterxml2xmltest
113

114
check_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest
115

116
check_PROGRAMS += nodedevxml2xmltest
M
Mark McLoughlin 已提交
117

118
check_PROGRAMS += interfacexml2xmltest
119

120 121
check_PROGRAMS += cputest

122 123
test_scripts = \
	capabilityschematest \
124
	interfaceschematest \
125 126 127 128
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
129
	nodedevschematest \
130 131
	nwfilterschematest \
	domainsnapshotschematest
132

A
Atsushi SAKAI 已提交
133
if WITH_LIBVIRTD
134 135 136 137 138 139
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	daemon-conf			\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
140 141
	libvirtd-fail			\
	libvirtd-pool			\
142 143 144 145 146 147
	read-bufsiz			\
	read-non-seekable		\
	start				\
	undefine			\
	vcpupin				\
	virsh-all			\
148
	virsh-optparse			\
149
	virsh-schedinfo			\
J
Jim Meyering 已提交
150
	virsh-synopsis
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
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 已提交
169
endif
170

J
Jamie Strandboge 已提交
171 172
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
173 174
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
175
endif
176

177 178
EXTRA_DIST += $(test_scripts)

179 180 181
TESTS = virshtest \
        nodeinfotest \
	qparamtest \
182
	virbuftest \
183
	sockettest \
184
	commandtest \
185
	seclabeltest \
186
	hashtest \
187
	virnetmessagetest \
188 189 190 191 192 193 194
	$(test_scripts)

if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
	xencapstest
195
if ENABLE_XEN_TESTS
196
TESTS += reconnect statstest
197
endif
198
endif
199

200
if WITH_QEMU
201
TESTS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
202
TESTS += nwfilterxml2xmltest
203
endif
K
Karel Zak 已提交
204

205 206 207 208
if WITH_OPENVZ
TESTS += openvzutilstest
endif

209
if WITH_ESX
210 211 212 213 214
TESTS += esxutilstest
endif

if WITH_VMX
TESTS += vmx2xmltest xml2vmxtest
215 216
endif

217
if WITH_LIBVIRTD
218
check_PROGRAMS += eventtest
219 220 221
TESTS += eventtest
endif

222 223
TESTS += networkxml2xmltest

224
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
225

M
Mark McLoughlin 已提交
226 227
TESTS += nodedevxml2xmltest

228 229
TESTS += interfacexml2xmltest

230 231
TESTS += cputest

232
path_add = $$abs_top_builddir/daemon$(PATH_SEPARATOR)$$abs_top_builddir/tools
J
Jim Meyering 已提交
233

234
# NB, automake < 1.10 does not provide the real
235
# abs_top_{src/build}dir or builddir variables, so don't rely
236
# on them here. Fake them with 'pwd'
237
TESTS_ENVIRONMENT =				\
J
Jim Meyering 已提交
238 239
  abs_top_builddir=`cd '$(top_builddir)'; pwd`	\
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
240
  abs_builddir=`pwd`				\
241
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
242
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
243
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
244
  SHELL="$(SHELL)"				\
245
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
246
  LC_ALL=C					\
247 248
  $(VG)

249
valgrind:
250
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
251

252 253 254 255 256
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
sockettest_LDADD = ../src/libvirt_util.la $(LDADDS)

257
if WITH_XEN
258
xml2sexprtest_SOURCES = \
259
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
260
	testutils.c testutils.h
261
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
262 263

sexpr2xmltest_SOURCES = \
264
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
265
	testutils.c testutils.h
266
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
267

268
xmconfigtest_SOURCES = \
269
	xmconfigtest.c testutilsxen.c testutilsxen.h \
270
	testutils.c testutils.h
271
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
272

273 274 275 276 277 278 279 280
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

reconnect_SOURCES = \
	reconnect.c
reconnect_LDADD = $(LDADDS)

281 282 283 284
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

285 286 287 288 289 290
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

291
if WITH_QEMU
292
qemuxml2argvtest_SOURCES = \
293
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
294
	testutils.c testutils.h
295
qemuxml2argvtest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
296 297

qemuxml2xmltest_SOURCES = \
298
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
299
	testutils.c testutils.h
300
qemuxml2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
301 302 303 304 305

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemuargv2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
306 307 308

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
qemuhelptest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
309
else
310
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h
311
endif
312

313 314 315 316 317 318 319 320 321 322
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

323 324 325 326 327
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
esxutilstest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)
328 329 330
else
EXTRA_DIST += esxutilstest.c
endif
331

332
if WITH_VMX
333 334 335
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
336
vmx2xmltest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
337 338 339 340

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
341
xml2vmxtest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
342
else
343
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
344 345
endif

346 347 348 349 350
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

351 352 353 354 355
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)

356 357 358 359 360
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

361 362 363 364 365
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
366 367 368
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
369
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
370

371 372 373 374 375
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

376 377 378 379 380
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

381 382 383 384 385
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
386 387 388 389
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

390 391 392 393
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

394 395
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
396
commandtest_CFLAGS = -Dabs_builddir="\"`pwd`\""
397 398 399 400
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
401
commandhelper_CFLAGS = -Dabs_builddir="\"`pwd`\""
402 403
commandhelper_LDADD = $(LDADDS)

404 405 406 407 408 409
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
virnetmessagetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\""
virnetmessagetest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)


410 411 412
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
J
Jamie Strandboge 已提交
413

414 415 416 417
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

418 419 420 421
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

422 423 424 425
hashtest_SOURCES = \
	hashtest.c hashdata.h testutils.h testutils.c
hashtest_LDADD = $(LDADDS)

426 427
if WITH_LIBVIRTD
eventtest_SOURCES = \
428
	eventtest.c testutils.h testutils.c
429 430 431
eventtest_LDADD = -lrt $(LDADDS)
endif

432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452
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

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