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 80
	nodeinfotest qparamtest virbuftest \
	commandtest commandhelper
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
check_PROGRAMS += esxutilstest vmx2xmltest xml2vmxtest
95 96
endif

97
if WITH_SECDRIVER_SELINUX
98
check_PROGRAMS += seclabeltest
99 100
endif

J
Jamie Strandboge 已提交
101
if WITH_SECDRIVER_APPARMOR
102
check_PROGRAMS += secaatest
J
Jamie Strandboge 已提交
103 104
endif

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

109
check_PROGRAMS += networkxml2xmltest
110

111
check_PROGRAMS += nwfilterxml2xmltest
112

113
check_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest
114

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

117
check_PROGRAMS += interfacexml2xmltest
118

119 120
check_PROGRAMS += cputest

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

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

J
Jamie Strandboge 已提交
151 152
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
153 154
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
155
endif
156

157 158
EXTRA_DIST += $(test_scripts)

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

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

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

182 183 184 185
if WITH_ESX
TESTS += esxutilstest vmx2xmltest xml2vmxtest
endif

186 187 188 189
if WITH_SECDRIVER_SELINUX
TESTS += seclabeltest
endif

J
Jamie Strandboge 已提交
190 191 192 193
if WITH_SECDRIVER_APPARMOR
TESTS += secaatest
endif

194
if WITH_LIBVIRTD
195
check_PROGRAMS += eventtest
196 197 198
TESTS += eventtest
endif

199 200
TESTS += networkxml2xmltest

201
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
202

M
Mark McLoughlin 已提交
203 204
TESTS += nodedevxml2xmltest

205 206
TESTS += interfacexml2xmltest

207 208
TESTS += cputest

C
Chris Lalancette 已提交
209
path_add = $$abs_top_builddir/src$(PATH_SEPARATOR)$$abs_top_builddir/daemon$(PATH_SEPARATOR)$$abs_top_builddir/tools
J
Jim Meyering 已提交
210

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

226
valgrind:
227
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
228

229 230 231 232 233
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
sockettest_LDADD = ../src/libvirt_util.la $(LDADDS)

234
if WITH_XEN
235
xml2sexprtest_SOURCES = \
236
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
237
	testutils.c testutils.h
238
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
239 240

sexpr2xmltest_SOURCES = \
241
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
242
	testutils.c testutils.h
243
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
244

245
xmconfigtest_SOURCES = \
246
	xmconfigtest.c testutilsxen.c testutilsxen.h \
247
	testutils.c testutils.h
248
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
249

250 251 252 253 254 255 256 257
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

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

258 259 260 261
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

262 263 264 265 266 267
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

268
if WITH_QEMU
269
qemuxml2argvtest_SOURCES = \
270
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
271
	testutils.c testutils.h
272
qemuxml2argvtest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
273 274

qemuxml2xmltest_SOURCES = \
275
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
276
	testutils.c testutils.h
277
qemuxml2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
278 279 280 281 282

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemuargv2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
283 284 285

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
qemuhelptest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
286
else
287
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h
288
endif
289

290 291 292 293 294 295 296 297 298 299 300 301 302 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)

vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
vmx2xmltest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
xml2vmxtest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)
else
EXTRA_DIST += esxutilstest.c vmx2xmltest.c xml2vmxtest.c
endif

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

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

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

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

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

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

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

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

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

353 354 355 356
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

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

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

367 368 369 370 371 372 373 374
if WITH_SECDRIVER_SELINUX
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
else
EXTRA_DIST += seclabeltest.c
endif

J
Jamie Strandboge 已提交
375 376 377 378 379 380 381 382
if WITH_SECDRIVER_APPARMOR
secaatest_SOURCES = \
	secaatest.c
secaatest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
else
EXTRA_DIST += secaatest.c
endif

383 384 385 386
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

387 388 389 390
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

391 392
if WITH_LIBVIRTD
eventtest_SOURCES = \
393
	eventtest.c testutils.h testutils.c ../daemon/event.c
394 395 396
eventtest_LDADD = -lrt $(LDADDS)
endif

397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417
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

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