Makefile.am 10.8 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
	$(YAJL_CFLAGS) \
18
         $(COVERAGE_CFLAGS) \
19
         $(WARN_CFLAGS)
20

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

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

40
EXTRA_DIST =		\
41
	capabilityschemadata \
E
Eric Blake 已提交
42 43 44 45
	capabilityschematest \
	commanddata \
	confdata \
	cputestdata \
46
	domainschemadata \
E
Eric Blake 已提交
47 48 49 50
	domainschematest \
	domainsnapshotschematest \
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
51
	interfaceschemadata \
E
Eric Blake 已提交
52 53 54
	networkschematest \
	networkxml2xmlin \
	networkxml2xmlout \
55
	networkxml2argvdata \
E
Eric Blake 已提交
56 57 58 59 60 61 62 63 64 65 66 67
	nodedevschemadata \
	nodedevschematest \
	nodeinfodata     \
	nwfilterschematest \
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
	qemuhelpdata \
	qemuxml2argvdata \
	qemuxml2xmloutdata \
	schematestutils.sh \
	sexpr2xmldata \
68
	storagepoolschematest \
69
	storagepoolxml2xmlin \
E
Eric Blake 已提交
70
	storagepoolxml2xmlout \
71
	storagevolschematest \
72
	storagevolxml2xmlin \
E
Eric Blake 已提交
73 74
	storagevolxml2xmlout \
	test-lib.sh	\
75
	vmx2xmldata \
E
Eric Blake 已提交
76 77 78
	xencapsdata \
	xmconfigdata \
	xml2sexprdata \
79 80
	xml2vmxdata \
	.valgrind.supp
K
Karel Zak 已提交
81

82
check_PROGRAMS = virshtest conftest sockettest \
83
	nodeinfotest qparamtest virbuftest \
84
	commandtest commandhelper seclabeltest \
85 86 87 88 89
	hashtest virnetmessagetest virnetsockettest ssh

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

91
if WITH_XEN
92
check_PROGRAMS += xml2sexprtest sexpr2xmltest \
93 94 95 96
	xmconfigtest xencapstest
if ENABLE_XEN_TESTS
check_PROGRAMS += statstest reconnect
endif
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 125
check_PROGRAMS += networkxml2argvtest

126
check_PROGRAMS += nwfilterxml2xmltest
127

128
check_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest
129

130
check_PROGRAMS += nodedevxml2xmltest
M
Mark McLoughlin 已提交
131

132
check_PROGRAMS += interfacexml2xmltest
133

134 135
check_PROGRAMS += cputest

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

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

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

191 192
EXTRA_DIST += $(test_scripts)

193 194 195
TESTS = virshtest \
        nodeinfotest \
	qparamtest \
196
	virbuftest \
197
	sockettest \
198
	commandtest \
199
	seclabeltest \
200
	hashtest \
201
	virnetmessagetest \
202
	virnetsockettest \
203 204
	$(test_scripts)

205 206 207 208
if HAVE_YAJL
TESTS += jsontest
endif

209 210 211 212 213
if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
	xencapstest
214
if ENABLE_XEN_TESTS
215
TESTS += reconnect statstest
216
endif
217
endif
218

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

224 225 226 227
if WITH_OPENVZ
TESTS += openvzutilstest
endif

228
if WITH_ESX
229 230 231 232 233
TESTS += esxutilstest
endif

if WITH_VMX
TESTS += vmx2xmltest xml2vmxtest
234 235
endif

236
if WITH_LIBVIRTD
237
check_PROGRAMS += eventtest
238 239 240
TESTS += eventtest
endif

241 242
TESTS += networkxml2xmltest

243 244
TESTS += networkxml2argvtest

245
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
246

M
Mark McLoughlin 已提交
247 248
TESTS += nodedevxml2xmltest

249 250
TESTS += interfacexml2xmltest

251 252
TESTS += cputest

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

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

270
valgrind:
271
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
272

273 274 275 276 277
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
sockettest_LDADD = ../src/libvirt_util.la $(LDADDS)

278
if WITH_XEN
279
xml2sexprtest_SOURCES = \
280
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
281
	testutils.c testutils.h
282
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
283 284

sexpr2xmltest_SOURCES = \
285
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
286
	testutils.c testutils.h
287
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
288

289
xmconfigtest_SOURCES = \
290
	xmconfigtest.c testutilsxen.c testutilsxen.h \
291
	testutils.c testutils.h
292
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
293

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

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

302 303 304 305
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

306 307 308 309 310 311
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

312
if WITH_QEMU
313
qemuxml2argvtest_SOURCES = \
314
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
315
	testutils.c testutils.h
316
qemuxml2argvtest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
317 318

qemuxml2xmltest_SOURCES = \
319
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
320
	testutils.c testutils.h
321
qemuxml2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
322 323 324 325 326

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemuargv2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
327 328 329

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
qemuhelptest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
330
else
331
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h
332
endif
333

334 335 336 337 338 339 340 341 342 343
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

344 345 346 347 348
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
esxutilstest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)
349 350 351
else
EXTRA_DIST += esxutilstest.c
endif
352

353
if WITH_VMX
354 355 356
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
357
vmx2xmltest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
358 359 360 361

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
362
xml2vmxtest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
363
else
364
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
365 366
endif

367 368 369 370 371
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

372 373 374 375 376
networkxml2argvtest_SOURCES = \
	networkxml2argvtest.c \
	testutils.c testutils.h
networkxml2argvtest_LDADD = ../src/libvirt_driver_network.la $(LDADDS)

377 378 379 380 381
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)

382 383 384 385 386
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

387 388 389 390 391
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
392 393 394
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
395
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
396

397 398 399 400 401
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

402 403 404 405 406
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

407 408 409 410 411
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
412 413 414 415
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

416 417 418 419
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

420 421
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
422
commandtest_CFLAGS = -Dabs_builddir="\"`pwd`\""
423 424 425 426
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
427
commandhelper_CFLAGS = -Dabs_builddir="\"`pwd`\""
428 429
commandhelper_LDADD = $(LDADDS)

430 431 432 433 434
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
virnetmessagetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\""
virnetmessagetest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

435 436 437 438 439
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
virnetsockettest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\""
virnetsockettest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

440

441 442 443
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
J
Jamie Strandboge 已提交
444

445 446 447 448
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

449 450 451 452
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

453 454 455 456
hashtest_SOURCES = \
	hashtest.c hashdata.h testutils.h testutils.c
hashtest_LDADD = $(LDADDS)

457
jsontest_SOURCES = \
458
	jsontest.c testutils.h testutils.c
459 460
jsontest_LDADD = $(LDADDS)

461 462
if WITH_LIBVIRTD
eventtest_SOURCES = \
463
	eventtest.c testutils.h testutils.c
464 465 466
eventtest_LDADD = -lrt $(LDADDS)
endif

467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487
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

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