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-schedinfo			\
J
Jim Meyering 已提交
144
	virsh-synopsis
A
Atsushi SAKAI 已提交
145
endif
146

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

153 154
EXTRA_DIST += $(test_scripts)

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

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

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

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

if WITH_VMX
TESTS += vmx2xmltest xml2vmxtest
185 186
endif

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

192 193
TESTS += networkxml2xmltest

194
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
195

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

198 199
TESTS += interfacexml2xmltest

200 201
TESTS += cputest

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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