Makefile.am 9.4 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
if WITH_ESX
95 96 97 98 99
check_PROGRAMS += esxutilstest
endif

if WITH_VMX
check_PROGRAMS += vmx2xmltest xml2vmxtest
100 101
endif

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

106
check_PROGRAMS += networkxml2xmltest
107

108
check_PROGRAMS += nwfilterxml2xmltest
109

110
check_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest
111

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

114
check_PROGRAMS += interfacexml2xmltest
115

116 117
check_PROGRAMS += cputest

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

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

J
Jamie Strandboge 已提交
167 168
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
169 170
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
171
endif
172

173 174
EXTRA_DIST += $(test_scripts)

175 176 177
TESTS = virshtest \
        nodeinfotest \
	qparamtest \
178
	virbuftest \
179
	sockettest \
180
	commandtest \
181
	seclabeltest \
182
	hashtest \
183 184 185 186 187 188 189
	$(test_scripts)

if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
	xencapstest
190
if ENABLE_XEN_TESTS
191
TESTS += reconnect statstest
192
endif
193
endif
194

195
if WITH_QEMU
196
TESTS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
197
TESTS += nwfilterxml2xmltest
198
endif
K
Karel Zak 已提交
199

200
if WITH_ESX
201 202 203 204 205
TESTS += esxutilstest
endif

if WITH_VMX
TESTS += vmx2xmltest xml2vmxtest
206 207
endif

208
if WITH_LIBVIRTD
209
check_PROGRAMS += eventtest
210 211 212
TESTS += eventtest
endif

213 214
TESTS += networkxml2xmltest

215
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
216

M
Mark McLoughlin 已提交
217 218
TESTS += nodedevxml2xmltest

219 220
TESTS += interfacexml2xmltest

221 222
TESTS += cputest

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

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

240
valgrind:
241
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
242

243 244 245 246 247
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
sockettest_LDADD = ../src/libvirt_util.la $(LDADDS)

248
if WITH_XEN
249
xml2sexprtest_SOURCES = \
250
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
251
	testutils.c testutils.h
252
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
253 254

sexpr2xmltest_SOURCES = \
255
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
256
	testutils.c testutils.h
257
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
258

259
xmconfigtest_SOURCES = \
260
	xmconfigtest.c testutilsxen.c testutilsxen.h \
261
	testutils.c testutils.h
262
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
263

264 265 266 267 268 269 270 271
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

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

272 273 274 275
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

276 277 278 279 280 281
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

282
if WITH_QEMU
283
qemuxml2argvtest_SOURCES = \
284
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
285
	testutils.c testutils.h
286
qemuxml2argvtest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
287 288

qemuxml2xmltest_SOURCES = \
289
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
290
	testutils.c testutils.h
291
qemuxml2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
292 293 294 295 296

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemuargv2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
297 298 299

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
qemuhelptest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
300
else
301
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h
302
endif
303

304 305 306 307 308
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
esxutilstest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)
309 310 311
else
EXTRA_DIST += esxutilstest.c
endif
312

313
if WITH_VMX
314 315 316
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
317
vmx2xmltest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
318 319 320 321

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
322
xml2vmxtest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
323
else
324
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
325 326
endif

327 328 329 330 331
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

332 333 334 335 336
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)

337 338 339 340 341
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

342 343 344 345 346
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
347 348 349
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
350
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
351

352 353 354 355 356
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

357 358 359 360 361
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

362 363 364 365 366
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
367 368 369 370
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

371 372 373 374
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

375 376
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
377
commandtest_CFLAGS = -Dabs_builddir="\"`pwd`\""
378 379 380 381
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
382
commandhelper_CFLAGS = -Dabs_builddir="\"`pwd`\""
383 384
commandhelper_LDADD = $(LDADDS)

385 386 387
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
J
Jamie Strandboge 已提交
388

389 390 391 392
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

393 394 395 396
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

397 398 399 400
hashtest_SOURCES = \
	hashtest.c hashdata.h testutils.h testutils.c
hashtest_LDADD = $(LDADDS)

401 402
if WITH_LIBVIRTD
eventtest_SOURCES = \
403
	eventtest.c testutils.h testutils.c
404 405 406
eventtest_LDADD = -lrt $(LDADDS)
endif

407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427
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

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