Makefile.am 9.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

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

93
if WITH_ESX
94 95 96 97 98
check_PROGRAMS += esxutilstest
endif

if WITH_VMX
check_PROGRAMS += vmx2xmltest xml2vmxtest
99 100
endif

101
if WITH_CIL
102
check_PROGRAMS += object-locking
103 104
endif

105
check_PROGRAMS += networkxml2xmltest
106

107
check_PROGRAMS += nwfilterxml2xmltest
108

109
check_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest
110

111
check_PROGRAMS += nodedevxml2xmltest
M
Mark McLoughlin 已提交
112

113
check_PROGRAMS += interfacexml2xmltest
114

115 116
check_PROGRAMS += cputest

117 118
test_scripts = \
	capabilityschematest \
119
	interfaceschematest \
120 121 122 123
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
124
	nodedevschematest \
125 126
	nwfilterschematest \
	domainsnapshotschematest
127

A
Atsushi SAKAI 已提交
128
if WITH_LIBVIRTD
129 130 131 132 133 134
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	daemon-conf			\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
135 136
	libvirtd-fail			\
	libvirtd-pool			\
137 138 139 140 141 142
	read-bufsiz			\
	read-non-seekable		\
	start				\
	undefine			\
	vcpupin				\
	virsh-all			\
143
	virsh-optparse			\
144
	virsh-schedinfo			\
J
Jim Meyering 已提交
145
	virsh-synopsis
A
Atsushi SAKAI 已提交
146
endif
147

J
Jamie Strandboge 已提交
148 149
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
150 151
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
152
endif
153

154 155
EXTRA_DIST += $(test_scripts)

156 157 158
TESTS = virshtest \
        nodeinfotest \
	qparamtest \
159
	virbuftest \
160
	sockettest \
161
	commandtest \
162
	seclabeltest \
163 164 165 166 167 168 169
	$(test_scripts)

if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
	xencapstest
170
if ENABLE_XEN_TESTS
171
TESTS += reconnect statstest
172
endif
173
endif
174

175
if WITH_QEMU
176
TESTS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
177
TESTS += nwfilterxml2xmltest
178
endif
K
Karel Zak 已提交
179

180
if WITH_ESX
181 182 183 184 185
TESTS += esxutilstest
endif

if WITH_VMX
TESTS += vmx2xmltest xml2vmxtest
186 187
endif

188
if WITH_LIBVIRTD
189
check_PROGRAMS += eventtest
190 191 192
TESTS += eventtest
endif

193 194
TESTS += networkxml2xmltest

195
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
196

M
Mark McLoughlin 已提交
197 198
TESTS += nodedevxml2xmltest

199 200
TESTS += interfacexml2xmltest

201 202
TESTS += cputest

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

205
# NB, automake < 1.10 does not provide the real
206
# abs_top_{src/build}dir or builddir variables, so don't rely
207
# on them here. Fake them with 'pwd'
208
TESTS_ENVIRONMENT =				\
J
Jim Meyering 已提交
209 210
  abs_top_builddir=`cd '$(top_builddir)'; pwd`	\
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
211
  abs_builddir=`pwd`				\
212
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
213
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
214
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
215
  SHELL="$(SHELL)"				\
216
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
217
  LC_ALL=C					\
218 219
  $(VG)

220
valgrind:
221
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
222

223 224 225 226 227
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
sockettest_LDADD = ../src/libvirt_util.la $(LDADDS)

228
if WITH_XEN
229
xml2sexprtest_SOURCES = \
230
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
231
	testutils.c testutils.h
232
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
233 234

sexpr2xmltest_SOURCES = \
235
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
236
	testutils.c testutils.h
237
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
238

239
xmconfigtest_SOURCES = \
240
	xmconfigtest.c testutilsxen.c testutilsxen.h \
241
	testutils.c testutils.h
242
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
243

244 245 246 247 248 249 250 251
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

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

252 253 254 255
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

256 257 258 259 260 261
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

262
if WITH_QEMU
263
qemuxml2argvtest_SOURCES = \
264
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
265
	testutils.c testutils.h
266
qemuxml2argvtest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
267 268

qemuxml2xmltest_SOURCES = \
269
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
270
	testutils.c testutils.h
271
qemuxml2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
272 273 274 275 276

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemuargv2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
277 278 279

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
qemuhelptest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
280
else
281
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h
282
endif
283

284 285 286 287 288
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
esxutilstest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)
289 290 291
else
EXTRA_DIST += esxutilstest.c
endif
292

293
if WITH_VMX
294 295 296
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
297
vmx2xmltest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
298 299 300 301

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
302
xml2vmxtest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
303
else
304
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
305 306
endif

307 308 309 310 311
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

312 313 314 315 316
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)

317 318 319 320 321
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

322 323 324 325 326
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
327 328 329
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
330
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
331

332 333 334 335 336
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

337 338 339 340 341
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

342 343 344 345 346
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
347 348 349 350
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

351 352 353 354
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

355 356
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
357
commandtest_CFLAGS = -Dabs_builddir="\"`pwd`\""
358 359 360 361
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
362
commandhelper_CFLAGS = -Dabs_builddir="\"`pwd`\""
363 364
commandhelper_LDADD = $(LDADDS)

365 366 367
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
J
Jamie Strandboge 已提交
368

369 370 371 372
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

373 374 375 376
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

377 378
if WITH_LIBVIRTD
eventtest_SOURCES = \
379
	eventtest.c testutils.h testutils.c
380 381 382
eventtest_LDADD = -lrt $(LDADDS)
endif

383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403
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

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