Makefile.am 11.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 \
E
Eric Blake 已提交
11 12 13
	-I$(top_srcdir)/src/conf

AM_CFLAGS = \
14 15
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
16
	$(SASL_CFLAGS) \
17
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
18
	$(APPARMOR_CFLAGS) \
19
	$(YAJL_CFLAGS) \
E
Eric Blake 已提交
20 21
	$(COVERAGE_CFLAGS) \
	$(WARN_CFLAGS)
22

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

K
Karel Zak 已提交
28
LDADDS = \
29
	$(STATIC_BINARIES) \
30 31
	$(LIBXML_LIBS) \
        $(GNUTLS_LIBS) \
32
        $(SASL_LIBS) \
33
        $(SELINUX_LIBS) \
J
Jamie Strandboge 已提交
34
        $(APPARMOR_LIBS) \
35
        $(YAJL_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
	capabilityschemadata \
E
Eric Blake 已提交
44 45 46 47
	capabilityschematest \
	commanddata \
	confdata \
	cputestdata \
48
	domainschemadata \
E
Eric Blake 已提交
49 50 51 52
	domainschematest \
	domainsnapshotschematest \
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
53
	interfaceschemadata \
E
Eric Blake 已提交
54 55 56
	networkschematest \
	networkxml2xmlin \
	networkxml2xmlout \
57
	networkxml2argvdata \
E
Eric Blake 已提交
58 59 60 61 62 63 64 65 66 67 68 69
	nodedevschemadata \
	nodedevschematest \
	nodeinfodata     \
	nwfilterschematest \
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
	qemuhelpdata \
	qemuxml2argvdata \
	qemuxml2xmloutdata \
	schematestutils.sh \
	sexpr2xmldata \
70
	storagepoolschematest \
71
	storagepoolxml2xmlin \
E
Eric Blake 已提交
72
	storagepoolxml2xmlout \
73
	storagevolschematest \
74
	storagevolxml2xmlin \
E
Eric Blake 已提交
75 76
	storagevolxml2xmlout \
	test-lib.sh	\
77
	vmx2xmldata \
E
Eric Blake 已提交
78 79 80
	xencapsdata \
	xmconfigdata \
	xml2sexprdata \
81 82
	xml2vmxdata \
	.valgrind.supp
K
Karel Zak 已提交
83

84
check_PROGRAMS = virshtest conftest sockettest \
85
	nodeinfotest qparamtest virbuftest \
86
	commandtest commandhelper seclabeltest \
M
Matthias Bolte 已提交
87 88
	hashtest virnetmessagetest virnetsockettest ssh \
	utiltest
89 90 91 92

# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
93

94
if WITH_XEN
95
check_PROGRAMS += xml2sexprtest sexpr2xmltest \
96
	xmconfigtest xencapstest statstest reconnect
97
endif
98
if WITH_QEMU
99
check_PROGRAMS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
100 101
endif

102 103 104 105
if WITH_OPENVZ
check_PROGRAMS += openvzutilstest
endif

106
if WITH_ESX
107 108 109 110 111
check_PROGRAMS += esxutilstest
endif

if WITH_VMX
check_PROGRAMS += vmx2xmltest xml2vmxtest
112 113
endif

114
if WITH_CIL
115
check_PROGRAMS += object-locking
116 117
endif

118 119 120 121
if HAVE_YAJL
check_PROGRAMS += jsontest
endif

122
check_PROGRAMS += networkxml2xmltest
123

124
if WITH_NETWORK
125
check_PROGRAMS += networkxml2argvtest
126
endif
127

128
check_PROGRAMS += nwfilterxml2xmltest
129

130
check_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest
131

132
check_PROGRAMS += nodedevxml2xmltest
M
Mark McLoughlin 已提交
133

134
check_PROGRAMS += interfacexml2xmltest
135

136 137
check_PROGRAMS += cputest

138 139
test_scripts = \
	capabilityschematest \
140
	interfaceschematest \
141 142 143 144
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
145
	nodedevschematest \
146 147
	nwfilterschematest \
	domainsnapshotschematest
148

A
Atsushi SAKAI 已提交
149
if WITH_LIBVIRTD
150 151 152 153 154 155
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	daemon-conf			\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
156 157
	libvirtd-fail			\
	libvirtd-pool			\
158 159 160 161 162 163
	read-bufsiz			\
	read-non-seekable		\
	start				\
	undefine			\
	vcpupin				\
	virsh-all			\
164
	virsh-optparse			\
165
	virsh-schedinfo			\
J
Jim Meyering 已提交
166
	virsh-synopsis
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
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 已提交
185
endif
186

J
Jamie Strandboge 已提交
187 188
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
189 190
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
191
endif
192

193 194
EXTRA_DIST += $(test_scripts)

195 196 197
TESTS = virshtest \
        nodeinfotest \
	qparamtest \
198
	virbuftest \
199
	sockettest \
200
	commandtest \
201
	seclabeltest \
202
	hashtest \
203
	virnetmessagetest \
204
	virnetsockettest \
M
Matthias Bolte 已提交
205
	utiltest \
206 207
	$(test_scripts)

208 209 210 211
if HAVE_YAJL
TESTS += jsontest
endif

212 213 214 215
if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
216 217 218
	xencapstest \
	reconnect \
	statstest
219
endif
220

221
if WITH_QEMU
222
TESTS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
223
TESTS += nwfilterxml2xmltest
224
endif
K
Karel Zak 已提交
225

226 227 228 229
if WITH_OPENVZ
TESTS += openvzutilstest
endif

230
if WITH_ESX
231 232 233 234 235
TESTS += esxutilstest
endif

if WITH_VMX
TESTS += vmx2xmltest xml2vmxtest
236 237
endif

238
if WITH_LIBVIRTD
239
check_PROGRAMS += eventtest
240 241 242
TESTS += eventtest
endif

243 244
TESTS += networkxml2xmltest

245
if WITH_NETWORK
246
TESTS += networkxml2argvtest
247
endif
248

249
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
250

M
Mark McLoughlin 已提交
251 252
TESTS += nodedevxml2xmltest

253 254
TESTS += interfacexml2xmltest

255 256
TESTS += cputest

257
path_add = $$abs_top_builddir/daemon$(PATH_SEPARATOR)$$abs_top_builddir/tools$(PATH_SEPARATOR)$$abs_top_builddir/tests
J
Jim Meyering 已提交
258

259
# NB, automake < 1.10 does not provide the real
260
# abs_top_{src/build}dir or builddir variables, so don't rely
261
# on them here. Fake them with 'pwd'
262
TESTS_ENVIRONMENT =				\
J
Jim Meyering 已提交
263 264
  abs_top_builddir=`cd '$(top_builddir)'; pwd`	\
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
265
  abs_builddir=`pwd`				\
266
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
267
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
268
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
269
  SHELL="$(SHELL)"				\
270
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
271
  LC_ALL=C					\
272 273
  $(VG)

274
valgrind:
275
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
276

277 278 279 280 281
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
sockettest_LDADD = ../src/libvirt_util.la $(LDADDS)

282
if WITH_XEN
283
xml2sexprtest_SOURCES = \
284
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
285
	testutils.c testutils.h
286
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
287 288

sexpr2xmltest_SOURCES = \
289
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
290
	testutils.c testutils.h
291
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
292

293
xmconfigtest_SOURCES = \
294
	xmconfigtest.c testutilsxen.c testutilsxen.h \
295
	testutils.c testutils.h
296
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
297

298 299 300 301 302
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

reconnect_SOURCES = \
303
	reconnect.c testutils.h testutils.c
304 305
reconnect_LDADD = $(LDADDS)

306 307 308 309
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

310 311 312 313 314 315
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

316
if WITH_QEMU
317
qemuxml2argvtest_SOURCES = \
318
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
319
	testutils.c testutils.h
320
qemuxml2argvtest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
321 322

qemuxml2xmltest_SOURCES = \
323
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
324
	testutils.c testutils.h
325
qemuxml2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
326 327 328 329 330

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemuargv2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
331 332 333

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
qemuhelptest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
334
else
335
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h
336
endif
337

338 339 340 341 342 343 344 345 346 347
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
openvzutilstest_LDADD = ../src/libvirt_driver_openvz.la $(LDADDS)
else
EXTRA_DIST += openvzutilstest.c
endif
EXTRA_DIST += openvzutilstest.conf

348 349 350 351 352
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
esxutilstest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)
353 354 355
else
EXTRA_DIST += esxutilstest.c
endif
356

357
if WITH_VMX
358 359 360
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
361
vmx2xmltest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
362 363 364 365

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
366
xml2vmxtest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
367
else
368
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
369 370
endif

371 372 373 374 375
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

376
if WITH_NETWORK
377 378 379 380
networkxml2argvtest_SOURCES = \
	networkxml2argvtest.c \
	testutils.c testutils.h
networkxml2argvtest_LDADD = ../src/libvirt_driver_network.la $(LDADDS)
381 382 383
else
EXTRA_DIST += networkxml2argvtest.c
endif
384

385 386 387 388 389
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)

390 391 392 393 394
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

395 396 397 398 399
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
400 401 402
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
403
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
404

405 406 407 408 409
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

410 411 412 413 414
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

415 416 417 418 419
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
420 421 422 423
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

424 425 426 427
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

428 429
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
E
Eric Blake 已提交
430
commandtest_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
431 432 433 434
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
E
Eric Blake 已提交
435
commandhelper_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
436 437
commandhelper_LDADD = $(LDADDS)

438 439
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
E
Eric Blake 已提交
440
virnetmessagetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
441 442
virnetmessagetest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

443 444
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
E
Eric Blake 已提交
445
virnetsockettest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
446 447
virnetsockettest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

448

449 450 451
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
J
Jamie Strandboge 已提交
452

453 454 455 456
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

457 458 459 460
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

461 462 463 464
hashtest_SOURCES = \
	hashtest.c hashdata.h testutils.h testutils.c
hashtest_LDADD = $(LDADDS)

465
jsontest_SOURCES = \
466
	jsontest.c testutils.h testutils.c
467 468
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
469 470 471 472
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

473 474
if WITH_LIBVIRTD
eventtest_SOURCES = \
475
	eventtest.c testutils.h testutils.c
476 477 478
eventtest_LDADD = -lrt $(LDADDS)
endif

479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499
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

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