Makefile.am 8.8 KB
Newer Older
K
Karel Zak 已提交
1 2
## Process this file with automake to produce Makefile.in

3 4
SHELL = $(PREFERABLY_POSIX_SHELL)

5
SUBDIRS = confdata sexpr2xmldata \
6
  xml2sexprdata xmconfigdata xencapsdata
7

K
Karel Zak 已提交
8
INCLUDES = \
9
	-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
K
Karel Zak 已提交
10
	-I$(top_builddir)/include \
11 12
	-I$(top_srcdir)/include \
	-I$(top_srcdir)/src \
13
	-I$(top_srcdir)/src/util \
14
	-I$(top_srcdir)/src/conf \
15 16
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
17
	$(SASL_CFLAGS) \
18
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
19
	$(APPARMOR_CFLAGS) \
20
        -DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
21
         $(COVERAGE_CFLAGS) \
22
         $(WARN_CFLAGS)
23

24 25 26 27 28
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
endif

K
Karel Zak 已提交
29
LDADDS = \
30
	$(STATIC_BINARIES) \
31 32
	$(LIBXML_LIBS) \
        $(GNUTLS_LIBS) \
33
        $(SASL_LIBS) \
34
        $(SELINUX_LIBS) \
J
Jamie Strandboge 已提交
35
        $(APPARMOR_LIBS) \
36
        $(WARN_CFLAGS) \
37
	../src/libvirt_test.la \
38
	../gnulib/lib/libgnu.la \
J
John Levon 已提交
39
	$(LIBSOCKET) \
40
        $(COVERAGE_LDFLAGS)
K
Karel Zak 已提交
41

42
EXTRA_DIST =		\
43
        oomtrace.pl     \
44
	test-lib.sh	\
45
	qemuxml2argvdata \
46
	qemuxml2xmloutdata \
47
	nodeinfodata     \
48
	schematestutils.sh \
49 50 51
	capabilityschematest \
	capabilityschemadata \
	networkschematest \
52 53
	networkxml2xmlout \
	networkxml2xmlin \
J
Jim Meyering 已提交
54
	domainschematest \
55
	domainschemadata \
56
	interfaceschemadata \
57
	storagepoolschematest \
58 59
	storagepoolxml2xmlout \
	storagepoolxml2xmlin \
60
	storagevolschematest \
61 62
	storagevolxml2xmlout \
	storagevolxml2xmlin \
63
	nodedevschematest \
64
	nodedevschemadata \
65 66
	vmx2xmldata \
	xml2vmxdata \
67 68
	nwfilterxml2xmlout \
	nwfilterxml2xmlin \
69
	nwfilterschematest \
70 71 72
	domainsnapshotschematest \
	domainsnapshotxml2xmlout \
	domainsnapshotxml2xmlin \
73
	qemuhelpdata
K
Karel Zak 已提交
74

75
check_PROGRAMS = virshtest conftest \
76
        nodeinfotest statstest qparamtest virbuftest
77

78
if WITH_XEN
79
check_PROGRAMS += xml2sexprtest sexpr2xmltest \
80 81
	reconnect xmconfigtest xencapstest
endif
82
if WITH_QEMU
83
check_PROGRAMS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
84 85
endif

86
if WITH_ESX
87
check_PROGRAMS += esxutilstest vmx2xmltest xml2vmxtest
88 89
endif

90
if WITH_SECDRIVER_SELINUX
91
check_PROGRAMS += seclabeltest
92 93
endif

J
Jamie Strandboge 已提交
94
if WITH_SECDRIVER_APPARMOR
95
check_PROGRAMS += secaatest
J
Jamie Strandboge 已提交
96 97
endif

98
if WITH_CIL
99
check_PROGRAMS += object-locking
100 101
endif

102
check_PROGRAMS += networkxml2xmltest
103

104
check_PROGRAMS += nwfilterxml2xmltest
105

106
check_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest
107

108
check_PROGRAMS += nodedevxml2xmltest
M
Mark McLoughlin 已提交
109

110
check_PROGRAMS += interfacexml2xmltest
111

112 113
test_scripts = \
	capabilityschematest \
114
	interfaceschematest \
115 116 117 118
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
119
	nodedevschematest \
120 121
	nwfilterschematest \
	domainsnapshotschematest
122

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

J
Jamie Strandboge 已提交
142 143
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
144 145
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
146
endif
147

148 149
EXTRA_DIST += $(test_scripts)

150 151 152 153
TESTS = virshtest \
        nodeinfotest \
	statstest \
	qparamtest \
154
	virbuftest \
155 156 157 158 159 160 161
	$(test_scripts)

if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
	xencapstest
162
if ENABLE_XEN_TESTS
163 164
TESTS += reconnect
endif
165
endif
166

167
if WITH_QEMU
168
TESTS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
169
TESTS += nwfilterxml2xmltest
170
endif
K
Karel Zak 已提交
171

172 173 174 175
if WITH_ESX
TESTS += esxutilstest vmx2xmltest xml2vmxtest
endif

176 177 178 179
if WITH_SECDRIVER_SELINUX
TESTS += seclabeltest
endif

J
Jamie Strandboge 已提交
180 181 182 183
if WITH_SECDRIVER_APPARMOR
TESTS += secaatest
endif

184
if WITH_LIBVIRTD
185
check_PROGRAMS += eventtest
186 187 188
TESTS += eventtest
endif

189 190
TESTS += networkxml2xmltest

191
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
192

M
Mark McLoughlin 已提交
193 194
TESTS += nodedevxml2xmltest

195 196
TESTS += interfacexml2xmltest

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

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

214
valgrind:
215
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
216

217
if WITH_XEN
218
xml2sexprtest_SOURCES = \
219
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
220
	testutils.c testutils.h
221
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
222 223

sexpr2xmltest_SOURCES = \
224
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
225
	testutils.c testutils.h
226
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
227

228
xmconfigtest_SOURCES = \
229
	xmconfigtest.c testutilsxen.c testutilsxen.h \
230
	testutils.c testutils.h
231
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
232

233 234 235 236 237 238 239 240
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

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

241 242 243 244
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

245 246 247 248 249 250
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

251
if WITH_QEMU
252
qemuxml2argvtest_SOURCES = \
253
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
254
	testutils.c testutils.h
255
qemuxml2argvtest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
256 257

qemuxml2xmltest_SOURCES = \
258
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
259
	testutils.c testutils.h
260
qemuxml2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
261 262 263 264 265

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemuargv2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
266 267 268

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
qemuhelptest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
269
else
270
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h
271
endif
272

273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
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

292 293 294 295 296
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

297 298 299 300 301
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)

302 303 304 305 306
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

307 308 309 310 311
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
312 313 314
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
315
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
316

317 318 319 320 321
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

322 323 324 325 326
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
327 328 329 330
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

331 332 333 334
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

335 336 337 338 339 340 341 342
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 已提交
343 344 345 346 347 348 349 350
if WITH_SECDRIVER_APPARMOR
secaatest_SOURCES = \
	secaatest.c
secaatest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
else
EXTRA_DIST += secaatest.c
endif

351 352 353 354
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

355 356 357 358
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

359 360
if WITH_LIBVIRTD
eventtest_SOURCES = \
361
	eventtest.c testutils.h testutils.c ../daemon/event.c
362 363 364
eventtest_LDADD = -lrt $(LDADDS)
endif

365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385
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

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