Makefile.am 9.7 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 81
	commandtest commandhelper seclabeltest \
	hashtest
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 188 189 190 191 192 193
	$(test_scripts)

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

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

204 205 206 207
if WITH_OPENVZ
TESTS += openvzutilstest
endif

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

if WITH_VMX
TESTS += vmx2xmltest xml2vmxtest
214 215
endif

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

221 222
TESTS += networkxml2xmltest

223
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
224

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

227 228
TESTS += interfacexml2xmltest

229 230
TESTS += cputest

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

403 404 405
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
J
Jamie Strandboge 已提交
406

407 408 409 410
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

411 412 413 414
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

415 416 417 418
hashtest_SOURCES = \
	hashtest.c hashdata.h testutils.h testutils.c
hashtest_LDADD = $(LDADDS)

419 420
if WITH_LIBVIRTD
eventtest_SOURCES = \
421
	eventtest.c testutils.h testutils.c
422 423 424
eventtest_LDADD = -lrt $(LDADDS)
endif

425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445
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

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