Makefile.am 6.4 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 11
	-I$(top_builddir)/include \
	-I$(top_builddir)/src \
12 13
	-I$(top_srcdir)/include \
	-I$(top_srcdir)/src \
14 15
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
16
	$(SASL_CFLAGS) \
17
	$(SELINUX_CFLAGS) \
18
        -DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
19
         $(COVERAGE_CFLAGS) \
20
         $(WARN_CFLAGS)
21

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

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

39 40 41 42 43 44 45
qemuhelpdata = \
	kvm-74 \
	kvm-86 \
	qemu-0.10.5 \
	qemu-0.9.1 \
	qemu-kvm-0.10.5

46
EXTRA_DIST =		\
47
        oomtrace.pl     \
48
	test-lib.sh	\
49
	qemuxml2argvdata \
50
	nodeinfodata     \
51 52 53
	capabilityschematest \
	capabilityschemadata \
	networkschematest \
J
Jim Meyering 已提交
54
	domainschematest \
55 56 57 58 59 60
	domainschemadata \
	storagepoolschematest \
	storagepoolschemadata \
	storagevolschematest \
	storagevolschemadata \
	nodedevschematest \
61 62
	nodedevschemadata \
	$(patsubst %,qemuhelpdata/%,$(qemuhelpdata))
K
Karel Zak 已提交
63

J
Jim Meyering 已提交
64
noinst_PROGRAMS = virshtest conftest \
65
        nodeinfotest statstest qparamtest
66

67 68 69 70
if WITH_XEN
noinst_PROGRAMS += xml2sexprtest sexpr2xmltest \
	reconnect xmconfigtest xencapstest
endif
71
if WITH_QEMU
72
noinst_PROGRAMS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
73 74
endif

75 76 77 78
if WITH_SECDRIVER_SELINUX
noinst_PROGRAMS += seclabeltest
endif

79 80 81 82
if WITH_CIL
noinst_PROGRAMS += object-locking
endif

M
Mark McLoughlin 已提交
83 84
noinst_PROGRAMS += nodedevxml2xmltest

85 86 87 88 89 90 91 92
test_scripts = \
	capabilityschematest \
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
	nodedevschematest

A
Atsushi SAKAI 已提交
93
if WITH_LIBVIRTD
94 95 96 97 98 99
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	daemon-conf			\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
100 101
	libvirtd-fail			\
	libvirtd-pool			\
102 103 104 105 106 107
	read-bufsiz			\
	read-non-seekable		\
	start				\
	undefine			\
	vcpupin				\
	virsh-all			\
J
Jim Meyering 已提交
108
	virsh-synopsis
A
Atsushi SAKAI 已提交
109
endif
110

111 112
EXTRA_DIST += $(test_scripts)

113 114 115 116 117 118 119 120 121 122 123
TESTS = virshtest \
        nodeinfotest \
	statstest \
	qparamtest \
	$(test_scripts)

if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
	xencapstest
124
if ENABLE_XEN_TESTS
125 126
TESTS += reconnect
endif
127
endif
128

129
if WITH_QEMU
130
TESTS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
131
endif
K
Karel Zak 已提交
132

133 134 135 136
if WITH_SECDRIVER_SELINUX
TESTS += seclabeltest
endif

137 138 139 140 141
if WITH_LIBVIRTD
noinst_PROGRAMS += eventtest
TESTS += eventtest
endif

M
Mark McLoughlin 已提交
142 143
TESTS += nodedevxml2xmltest

J
Jim Meyering 已提交
144 145
path_add = $$abs_top_builddir/src$(PATH_SEPARATOR)$$abs_top_builddir/qemud

146 147 148
# 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'
149
TESTS_ENVIRONMENT =				\
J
Jim Meyering 已提交
150 151
  abs_top_builddir=`cd '$(top_builddir)'; pwd`	\
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
152 153
  abs_builddir=`cd '$(builddir)'; pwd`		\
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
154
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
155
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
156
  SHELL="$(SHELL)"				\
157
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
158
  LIBVIRT_DEBUG="error"				\
159
  LC_ALL=C					\
160 161
  $(VG)

162
valgrind:
163
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
164

165
if WITH_XEN
166
xml2sexprtest_SOURCES = \
167
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
168
	testutils.c testutils.h
169
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
170 171

sexpr2xmltest_SOURCES = \
172
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
173
	testutils.c testutils.h
174
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
175

176
xmconfigtest_SOURCES = \
177
	xmconfigtest.c testutilsxen.c testutilsxen.h \
178
	testutils.c testutils.h
179
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
180

181 182 183 184 185 186 187 188 189 190 191 192 193 194
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

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

else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

195
if WITH_QEMU
196
qemuxml2argvtest_SOURCES = \
197
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
198
	testutils.c testutils.h
199
qemuxml2argvtest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
200 201

qemuxml2xmltest_SOURCES = \
202
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
203
	testutils.c testutils.h
204
qemuxml2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
205 206 207 208 209

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemuargv2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
210 211 212

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
qemuhelptest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
213
else
214
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h
215
endif
216

M
Mark McLoughlin 已提交
217 218 219
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
220
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
221

222 223 224 225 226
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
227 228 229 230
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

231 232 233 234
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

235 236 237 238
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = $(LDADDS)

239 240 241 242 243 244 245 246
if WITH_SECDRIVER_SELINUX
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
else
EXTRA_DIST += seclabeltest.c
endif

247 248 249 250
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

251 252 253 254 255 256
if WITH_LIBVIRTD
eventtest_SOURCES = \
	eventtest.c testutils.h testutils.c ../qemud/event.c
eventtest_LDADD = -lrt $(LDADDS)
endif

257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
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

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