Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-01-14' into staging
[qemu/ar7.git] / tests / Makefile.include
blobc6827ce8c29323a0eca8b7084c5373c9083499f3
1 # -*- Mode: makefile -*-
3 .PHONY: check-help
4 check-help:
5         @echo "Regression testing targets:"
6         @echo
7         @echo " $(MAKE) check                Run unit, qapi-schema, qtest and decodetree"
8         @echo
9         @echo " $(MAKE) check-qtest-TARGET   Run qtest tests for given target"
10         @echo " $(MAKE) check-qtest          Run qtest tests"
11         @echo " $(MAKE) check-unit           Run qobject tests"
12         @echo " $(MAKE) check-speed          Run qobject speed tests"
13         @echo " $(MAKE) check-qapi-schema    Run QAPI schema tests"
14         @echo " $(MAKE) check-block          Run block tests"
15         @echo " $(MAKE) check-tcg            Run TCG tests"
16         @echo " $(MAKE) check-softfloat      Run FPU emulation tests"
17         @echo " $(MAKE) check-acceptance     Run all acceptance (functional) tests"
18         @echo
19         @echo " $(MAKE) check-report.tap     Generates an aggregated TAP test report"
20         @echo " $(MAKE) check-venv           Creates a Python venv for tests"
21         @echo " $(MAKE) check-clean          Clean the tests and related data"
22         @echo
23         @echo
24         @echo "The variable SPEED can be set to control the gtester speed setting."
25         @echo "Default options are -k and (for $(MAKE) V=1) --verbose; they can be"
26         @echo "changed with variable GTESTER_OPTIONS."
28 ifneq ($(wildcard config-host.mak),)
29 export SRC_PATH
31 # TODO don't duplicate $(SRC_PATH)/Makefile's qapi-py here
32 qapi-py = $(SRC_PATH)/scripts/qapi/__init__.py \
33 $(SRC_PATH)/scripts/qapi/commands.py \
34 $(SRC_PATH)/scripts/qapi/common.py \
35 $(SRC_PATH)/scripts/qapi/doc.py \
36 $(SRC_PATH)/scripts/qapi/error.py \
37 $(SRC_PATH)/scripts/qapi/events.py \
38 $(SRC_PATH)/scripts/qapi/expr.py \
39 $(SRC_PATH)/scripts/qapi/gen.py \
40 $(SRC_PATH)/scripts/qapi/introspect.py \
41 $(SRC_PATH)/scripts/qapi/parser.py \
42 $(SRC_PATH)/scripts/qapi/schema.py \
43 $(SRC_PATH)/scripts/qapi/source.py \
44 $(SRC_PATH)/scripts/qapi/types.py \
45 $(SRC_PATH)/scripts/qapi/visit.py \
46 $(SRC_PATH)/scripts/qapi-gen.py
48 # Get the list of all supported sysemu targets
49 SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
50    $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak)))
52 check-unit-y += tests/check-qdict$(EXESUF)
53 check-unit-y += tests/check-block-qdict$(EXESUF)
54 check-unit-$(CONFIG_SOFTMMU) += tests/test-char$(EXESUF)
55 check-unit-y += tests/check-qnum$(EXESUF)
56 check-unit-y += tests/check-qstring$(EXESUF)
57 check-unit-y += tests/check-qlist$(EXESUF)
58 check-unit-y += tests/check-qnull$(EXESUF)
59 check-unit-y += tests/check-qobject$(EXESUF)
60 check-unit-y += tests/check-qjson$(EXESUF)
61 check-unit-y += tests/check-qlit$(EXESUF)
62 check-unit-y += tests/test-qobject-output-visitor$(EXESUF)
63 check-unit-y += tests/test-clone-visitor$(EXESUF)
64 check-unit-y += tests/test-qobject-input-visitor$(EXESUF)
65 check-unit-y += tests/test-qmp-cmds$(EXESUF)
66 check-unit-y += tests/test-string-input-visitor$(EXESUF)
67 check-unit-y += tests/test-string-output-visitor$(EXESUF)
68 check-unit-y += tests/test-qmp-event$(EXESUF)
69 check-unit-y += tests/test-opts-visitor$(EXESUF)
70 check-unit-$(CONFIG_BLOCK) += tests/test-coroutine$(EXESUF)
71 check-unit-y += tests/test-visitor-serialization$(EXESUF)
72 check-unit-y += tests/test-iov$(EXESUF)
73 check-unit-y += tests/test-bitmap$(EXESUF)
74 check-unit-$(CONFIG_BLOCK) += tests/test-aio$(EXESUF)
75 check-unit-$(CONFIG_BLOCK) += tests/test-aio-multithread$(EXESUF)
76 check-unit-$(CONFIG_BLOCK) += tests/test-throttle$(EXESUF)
77 check-unit-$(CONFIG_BLOCK) += tests/test-thread-pool$(EXESUF)
78 check-unit-$(CONFIG_BLOCK) += tests/test-hbitmap$(EXESUF)
79 check-unit-$(CONFIG_BLOCK) += tests/test-bdrv-drain$(EXESUF)
80 check-unit-$(CONFIG_BLOCK) += tests/test-bdrv-graph-mod$(EXESUF)
81 check-unit-$(CONFIG_BLOCK) += tests/test-blockjob$(EXESUF)
82 check-unit-$(CONFIG_BLOCK) += tests/test-blockjob-txn$(EXESUF)
83 check-unit-$(CONFIG_BLOCK) += tests/test-block-backend$(EXESUF)
84 check-unit-$(CONFIG_BLOCK) += tests/test-block-iothread$(EXESUF)
85 check-unit-$(CONFIG_BLOCK) += tests/test-image-locking$(EXESUF)
86 check-unit-y += tests/test-x86-cpuid$(EXESUF)
87 # all code tested by test-x86-cpuid is inside topology.h
88 ifeq ($(CONFIG_SOFTMMU),y)
89 check-unit-y += tests/test-xbzrle$(EXESUF)
90 check-unit-$(CONFIG_POSIX) += tests/test-vmstate$(EXESUF)
91 endif
92 check-unit-y += tests/test-cutils$(EXESUF)
93 check-unit-y += tests/test-shift128$(EXESUF)
94 check-unit-y += tests/test-mul64$(EXESUF)
95 check-unit-y += tests/test-int128$(EXESUF)
96 # all code tested by test-int128 is inside int128.h
97 check-unit-y += tests/rcutorture$(EXESUF)
98 check-unit-y += tests/test-rcu-list$(EXESUF)
99 check-unit-y += tests/test-rcu-simpleq$(EXESUF)
100 check-unit-y += tests/test-rcu-tailq$(EXESUF)
101 check-unit-y += tests/test-qdist$(EXESUF)
102 check-unit-y += tests/test-qht$(EXESUF)
103 check-unit-y += tests/test-qht-par$(EXESUF)
104 check-unit-y += tests/test-bitops$(EXESUF)
105 check-unit-y += tests/test-bitcnt$(EXESUF)
106 check-unit-y += tests/test-qdev-global-props$(EXESUF)
107 check-unit-y += tests/check-qom-interface$(EXESUF)
108 check-unit-y += tests/check-qom-proplist$(EXESUF)
109 check-unit-y += tests/test-qemu-opts$(EXESUF)
110 check-unit-y += tests/test-keyval$(EXESUF)
111 check-unit-$(CONFIG_BLOCK) += tests/test-write-threshold$(EXESUF)
112 check-unit-$(CONFIG_BLOCK) += tests/test-crypto-hash$(EXESUF)
113 check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-hash$(EXESUF)
114 check-unit-$(CONFIG_BLOCK) += tests/test-crypto-hmac$(EXESUF)
115 check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-hmac$(EXESUF)
116 check-unit-$(CONFIG_BLOCK) += tests/test-crypto-cipher$(EXESUF)
117 check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-cipher$(EXESUF)
118 check-unit-$(CONFIG_BLOCK) += tests/test-crypto-secret$(EXESUF)
119 check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-crypto-tlscredsx509$(EXESUF)
120 check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-crypto-tlssession$(EXESUF)
121 ifneq (,$(findstring qemu-ga,$(TOOLS)))
122 check-unit-$(call land,$(CONFIG_LINUX),$(CONFIG_VIRTIO_SERIAL)) += tests/test-qga$(EXESUF)
123 endif
124 check-unit-y += tests/test-timed-average$(EXESUF)
125 check-unit-$(CONFIG_INOTIFY1) += tests/test-util-filemonitor$(EXESUF)
126 check-unit-y += tests/test-util-sockets$(EXESUF)
127 check-unit-$(CONFIG_BLOCK) += tests/test-authz-simple$(EXESUF)
128 check-unit-$(CONFIG_BLOCK) += tests/test-authz-list$(EXESUF)
129 check-unit-$(CONFIG_BLOCK) += tests/test-authz-listfile$(EXESUF)
130 check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_AUTH_PAM)) += tests/test-authz-pam$(EXESUF)
131 check-unit-$(CONFIG_BLOCK) += tests/test-io-task$(EXESUF)
132 check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-socket$(EXESUF)
133 check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-file$(EXESUF)
134 check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-io-channel-tls$(EXESUF)
135 check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-command$(EXESUF)
136 check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-buffer$(EXESUF)
137 check-unit-y += tests/test-base64$(EXESUF)
138 check-unit-$(call land,$(CONFIG_BLOCK),$(if $(CONFIG_NETTLE),y,$(CONFIG_GCRYPT))) += tests/test-crypto-pbkdf$(EXESUF)
139 check-unit-$(CONFIG_BLOCK) += tests/test-crypto-ivgen$(EXESUF)
140 check-unit-$(CONFIG_BLOCK)  += tests/test-crypto-afsplit$(EXESUF)
141 check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_QEMU_PRIVATE_XTS)) += tests/test-crypto-xts$(EXESUF)
142 check-unit-$(CONFIG_BLOCK)  += tests/test-crypto-block$(EXESUF)
143 check-unit-y += tests/test-logging$(EXESUF)
144 check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_REPLICATION)) += tests/test-replication$(EXESUF)
145 check-unit-y += tests/test-bufferiszero$(EXESUF)
146 check-unit-y += tests/test-uuid$(EXESUF)
147 check-unit-y += tests/ptimer-test$(EXESUF)
148 check-unit-y += tests/test-qapi-util$(EXESUF)
150 check-block-$(call land,$(CONFIG_POSIX),$(CONFIG_SOFTMMU)) += tests/check-block.sh
152 qapi-schema += alternate-any.json
153 qapi-schema += alternate-array.json
154 qapi-schema += alternate-base.json
155 qapi-schema += alternate-branch-if-invalid.json
156 qapi-schema += alternate-clash.json
157 qapi-schema += alternate-conflict-dict.json
158 qapi-schema += alternate-conflict-enum-bool.json
159 qapi-schema += alternate-conflict-enum-int.json
160 qapi-schema += alternate-conflict-string.json
161 qapi-schema += alternate-conflict-bool-string.json
162 qapi-schema += alternate-conflict-num-string.json
163 qapi-schema += alternate-empty.json
164 qapi-schema += alternate-invalid-dict.json
165 qapi-schema += alternate-nested.json
166 qapi-schema += alternate-unknown.json
167 qapi-schema += args-alternate.json
168 qapi-schema += args-any.json
169 qapi-schema += args-array-empty.json
170 qapi-schema += args-array-unknown.json
171 qapi-schema += args-bad-boxed.json
172 qapi-schema += args-boxed-anon.json
173 qapi-schema += args-boxed-string.json
174 qapi-schema += args-int.json
175 qapi-schema += args-invalid.json
176 qapi-schema += args-member-array-bad.json
177 qapi-schema += args-member-case.json
178 qapi-schema += args-member-unknown.json
179 qapi-schema += args-name-clash.json
180 qapi-schema += args-union.json
181 qapi-schema += args-unknown.json
182 qapi-schema += bad-base.json
183 qapi-schema += bad-data.json
184 qapi-schema += bad-ident.json
185 qapi-schema += bad-if.json
186 qapi-schema += bad-if-empty.json
187 qapi-schema += bad-if-empty-list.json
188 qapi-schema += bad-if-list.json
189 qapi-schema += bad-type-bool.json
190 qapi-schema += bad-type-dict.json
191 qapi-schema += bad-type-int.json
192 qapi-schema += base-cycle-direct.json
193 qapi-schema += base-cycle-indirect.json
194 qapi-schema += command-int.json
195 qapi-schema += comments.json
196 qapi-schema += doc-bad-alternate-member.json
197 qapi-schema += doc-bad-boxed-command-arg.json
198 qapi-schema += doc-bad-command-arg.json
199 qapi-schema += doc-bad-enum-member.json
200 qapi-schema += doc-bad-event-arg.json
201 qapi-schema += doc-bad-feature.json
202 qapi-schema += doc-bad-section.json
203 qapi-schema += doc-bad-symbol.json
204 qapi-schema += doc-bad-union-member.json
205 qapi-schema += doc-before-include.json
206 qapi-schema += doc-before-pragma.json
207 qapi-schema += doc-duplicated-arg.json
208 qapi-schema += doc-duplicated-return.json
209 qapi-schema += doc-duplicated-since.json
210 qapi-schema += doc-empty-arg.json
211 qapi-schema += doc-empty-section.json
212 qapi-schema += doc-empty-symbol.json
213 qapi-schema += doc-good.json
214 qapi-schema += doc-interleaved-section.json
215 qapi-schema += doc-invalid-end.json
216 qapi-schema += doc-invalid-end2.json
217 qapi-schema += doc-invalid-return.json
218 qapi-schema += doc-invalid-section.json
219 qapi-schema += doc-invalid-start.json
220 qapi-schema += doc-missing-colon.json
221 qapi-schema += doc-missing-expr.json
222 qapi-schema += doc-missing-space.json
223 qapi-schema += doc-missing.json
224 qapi-schema += doc-no-symbol.json
225 qapi-schema += doc-undoc-feature.json
226 qapi-schema += double-type.json
227 qapi-schema += duplicate-key.json
228 qapi-schema += empty.json
229 qapi-schema += enum-bad-member.json
230 qapi-schema += enum-bad-name.json
231 qapi-schema += enum-bad-prefix.json
232 qapi-schema += enum-clash-member.json
233 qapi-schema += enum-dict-member-unknown.json
234 qapi-schema += enum-if-invalid.json
235 qapi-schema += enum-int-member.json
236 qapi-schema += enum-member-case.json
237 qapi-schema += enum-missing-data.json
238 qapi-schema += enum-wrong-data.json
239 qapi-schema += event-boxed-empty.json
240 qapi-schema += event-case.json
241 qapi-schema += event-member-invalid-dict.json
242 qapi-schema += event-nest-struct.json
243 qapi-schema += features-bad-type.json
244 qapi-schema += features-duplicate-name.json
245 qapi-schema += features-if-invalid.json
246 qapi-schema += features-missing-name.json
247 qapi-schema += features-name-bad-type.json
248 qapi-schema += features-no-list.json
249 qapi-schema += features-unknown-key.json
250 qapi-schema += flat-union-array-branch.json
251 qapi-schema += flat-union-bad-base.json
252 qapi-schema += flat-union-bad-discriminator.json
253 qapi-schema += flat-union-base-any.json
254 qapi-schema += flat-union-base-union.json
255 qapi-schema += flat-union-clash-member.json
256 qapi-schema += flat-union-discriminator-bad-name.json
257 qapi-schema += flat-union-empty.json
258 qapi-schema += flat-union-inline.json
259 qapi-schema += flat-union-inline-invalid-dict.json
260 qapi-schema += flat-union-int-branch.json
261 qapi-schema += flat-union-invalid-branch-key.json
262 qapi-schema += flat-union-invalid-discriminator.json
263 qapi-schema += flat-union-invalid-if-discriminator.json
264 qapi-schema += flat-union-no-base.json
265 qapi-schema += flat-union-optional-discriminator.json
266 qapi-schema += flat-union-string-discriminator.json
267 qapi-schema += funny-char.json
268 qapi-schema += funny-word.json
269 qapi-schema += ident-with-escape.json
270 qapi-schema += include-before-err.json
271 qapi-schema += include-cycle.json
272 qapi-schema += include-extra-junk.json
273 qapi-schema += include-nested-err.json
274 qapi-schema += include-no-file.json
275 qapi-schema += include-non-file.json
276 qapi-schema += include-repetition.json
277 qapi-schema += include-self-cycle.json
278 qapi-schema += include-simple.json
279 qapi-schema += indented-expr.json
280 qapi-schema += leading-comma-list.json
281 qapi-schema += leading-comma-object.json
282 qapi-schema += missing-colon.json
283 qapi-schema += missing-comma-list.json
284 qapi-schema += missing-comma-object.json
285 qapi-schema += missing-type.json
286 qapi-schema += nested-struct-data.json
287 qapi-schema += nested-struct-data-invalid-dict.json
288 qapi-schema += non-objects.json
289 qapi-schema += oob-test.json
290 qapi-schema += allow-preconfig-test.json
291 qapi-schema += pragma-doc-required-crap.json
292 qapi-schema += pragma-extra-junk.json
293 qapi-schema += pragma-name-case-whitelist-crap.json
294 qapi-schema += pragma-non-dict.json
295 qapi-schema += pragma-unknown.json
296 qapi-schema += pragma-returns-whitelist-crap.json
297 qapi-schema += qapi-schema-test.json
298 qapi-schema += quoted-structural-chars.json
299 qapi-schema += redefined-builtin.json
300 qapi-schema += redefined-command.json
301 qapi-schema += redefined-event.json
302 qapi-schema += redefined-type.json
303 qapi-schema += reserved-command-q.json
304 qapi-schema += reserved-enum-q.json
305 qapi-schema += reserved-member-has.json
306 qapi-schema += reserved-member-q.json
307 qapi-schema += reserved-member-u.json
308 qapi-schema += reserved-member-underscore.json
309 qapi-schema += reserved-type-kind.json
310 qapi-schema += reserved-type-list.json
311 qapi-schema += returns-alternate.json
312 qapi-schema += returns-array-bad.json
313 qapi-schema += returns-dict.json
314 qapi-schema += returns-unknown.json
315 qapi-schema += returns-whitelist.json
316 qapi-schema += string-code-point-31.json
317 qapi-schema += string-code-point-127.json
318 qapi-schema += struct-base-clash-deep.json
319 qapi-schema += struct-base-clash.json
320 qapi-schema += struct-data-invalid.json
321 qapi-schema += struct-member-if-invalid.json
322 qapi-schema += struct-member-invalid-dict.json
323 qapi-schema += struct-member-invalid.json
324 qapi-schema += trailing-comma-list.json
325 qapi-schema += trailing-comma-object.json
326 qapi-schema += type-bypass-bad-gen.json
327 qapi-schema += unclosed-list.json
328 qapi-schema += unclosed-object.json
329 qapi-schema += unclosed-string.json
330 qapi-schema += union-base-empty.json
331 qapi-schema += union-base-no-discriminator.json
332 qapi-schema += union-branch-case.json
333 qapi-schema += union-branch-if-invalid.json
334 qapi-schema += union-branch-invalid-dict.json
335 qapi-schema += union-clash-branches.json
336 qapi-schema += union-empty.json
337 qapi-schema += union-invalid-base.json
338 qapi-schema += union-optional-branch.json
339 qapi-schema += union-unknown.json
340 qapi-schema += unknown-escape.json
341 qapi-schema += unknown-expr-key.json
344 check-qapi-schema-y := $(addprefix tests/qapi-schema/, $(qapi-schema))
346 generated-files-y += tests/test-qapi-types.h
347 generated-files-y += tests/include/test-qapi-types-sub-module.h
348 generated-files-y += tests/test-qapi-types-sub-sub-module.h
349 generated-files-y += tests/test-qapi-visit.h
350 generated-files-y += tests/include/test-qapi-visit-sub-module.h
351 generated-files-y += tests/test-qapi-visit-sub-sub-module.h
352 generated-files-y += tests/test-qapi-commands.h
353 generated-files-y += tests/test-qapi-init-commands.h
354 generated-files-y += tests/include/test-qapi-commands-sub-module.h
355 generated-files-y += tests/test-qapi-commands-sub-sub-module.h
356 generated-files-y += tests/test-qapi-emit-events.h
357 generated-files-y += tests/test-qapi-events.h
358 generated-files-y += tests/include/test-qapi-events-sub-module.h
359 generated-files-y += tests/test-qapi-events-sub-sub-module.h
360 generated-files-y += tests/test-qapi-introspect.h
362 QEMU_CFLAGS += -I$(SRC_PATH)/tests -I$(SRC_PATH)/tests/qtest
365 # Deps that are common to various different sets of tests below
366 test-util-obj-y = libqemuutil.a
367 test-qom-obj-y = $(qom-obj-y) $(test-util-obj-y)
368 test-qapi-obj-y = tests/test-qapi-types.o \
369         tests/include/test-qapi-types-sub-module.o \
370         tests/test-qapi-types-sub-sub-module.o \
371         tests/test-qapi-visit.o \
372         tests/include/test-qapi-visit-sub-module.o \
373         tests/test-qapi-visit-sub-sub-module.o \
374         tests/test-qapi-introspect.o \
375         $(test-qom-obj-y)
376 benchmark-crypto-obj-$(CONFIG_BLOCK) = $(authz-obj-y) $(crypto-obj-y) $(test-qom-obj-y)
377 test-crypto-obj-$(CONFIG_BLOCK) = $(authz-obj-y) $(crypto-obj-y) $(test-qom-obj-y)
378 test-io-obj-$(CONFIG_BLOCK) = $(io-obj-y) $(test-crypto-obj-y)
379 test-authz-obj-$(CONFIG_BLOCK) = $(test-qom-obj-y) $(authz-obj-y)
380 test-block-obj-$(CONFIG_BLOCK) = $(block-obj-y) $(test-io-obj-y) tests/iothread.o
382 tests/check-qnum$(EXESUF): tests/check-qnum.o $(test-util-obj-y)
383 tests/check-qstring$(EXESUF): tests/check-qstring.o $(test-util-obj-y)
384 tests/check-qdict$(EXESUF): tests/check-qdict.o $(test-util-obj-y)
385 tests/check-block-qdict$(EXESUF): tests/check-block-qdict.o $(test-util-obj-y)
386 tests/check-qlist$(EXESUF): tests/check-qlist.o $(test-util-obj-y)
387 tests/check-qnull$(EXESUF): tests/check-qnull.o $(test-util-obj-y)
388 tests/check-qobject$(EXESUF): tests/check-qobject.o $(test-util-obj-y)
389 tests/check-qjson$(EXESUF): tests/check-qjson.o $(test-util-obj-y)
390 tests/check-qlit$(EXESUF): tests/check-qlit.o $(test-util-obj-y)
391 tests/check-qom-interface$(EXESUF): tests/check-qom-interface.o $(test-qom-obj-y)
392 tests/check-qom-proplist$(EXESUF): tests/check-qom-proplist.o $(test-qom-obj-y)
394 tests/test-char$(EXESUF): tests/test-char.o $(test-util-obj-y) $(test-io-obj-y) $(chardev-obj-y) tests/socket-helpers.o
395 tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(test-block-obj-y)
396 tests/test-aio$(EXESUF): tests/test-aio.o $(test-block-obj-y)
397 tests/test-aio-multithread$(EXESUF): tests/test-aio-multithread.o $(test-block-obj-y)
398 tests/test-throttle$(EXESUF): tests/test-throttle.o $(test-block-obj-y)
399 tests/test-bdrv-drain$(EXESUF): tests/test-bdrv-drain.o $(test-block-obj-y) $(test-util-obj-y)
400 tests/test-bdrv-graph-mod$(EXESUF): tests/test-bdrv-graph-mod.o $(test-block-obj-y) $(test-util-obj-y)
401 tests/test-blockjob$(EXESUF): tests/test-blockjob.o $(test-block-obj-y) $(test-util-obj-y)
402 tests/test-blockjob-txn$(EXESUF): tests/test-blockjob-txn.o $(test-block-obj-y) $(test-util-obj-y)
403 tests/test-block-backend$(EXESUF): tests/test-block-backend.o $(test-block-obj-y) $(test-util-obj-y)
404 tests/test-block-iothread$(EXESUF): tests/test-block-iothread.o $(test-block-obj-y) $(test-util-obj-y)
405 tests/test-image-locking$(EXESUF): tests/test-image-locking.o $(test-block-obj-y) $(test-util-obj-y)
406 tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(test-block-obj-y)
407 tests/test-iov$(EXESUF): tests/test-iov.o $(test-util-obj-y)
408 tests/test-hbitmap$(EXESUF): tests/test-hbitmap.o $(test-util-obj-y) $(test-crypto-obj-y)
409 tests/test-bitmap$(EXESUF): tests/test-bitmap.o $(test-util-obj-y)
410 tests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o
411 tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o migration/page_cache.o $(test-util-obj-y)
412 tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o $(test-util-obj-y)
413 tests/test-int128$(EXESUF): tests/test-int128.o
414 tests/rcutorture$(EXESUF): tests/rcutorture.o $(test-util-obj-y)
415 tests/test-rcu-list$(EXESUF): tests/test-rcu-list.o $(test-util-obj-y)
416 tests/test-rcu-simpleq$(EXESUF): tests/test-rcu-simpleq.o $(test-util-obj-y)
417 tests/test-rcu-tailq$(EXESUF): tests/test-rcu-tailq.o $(test-util-obj-y)
418 tests/test-qdist$(EXESUF): tests/test-qdist.o $(test-util-obj-y)
419 tests/test-qht$(EXESUF): tests/test-qht.o $(test-util-obj-y)
420 tests/test-qht-par$(EXESUF): tests/test-qht-par.o tests/qht-bench$(EXESUF) $(test-util-obj-y)
421 tests/qht-bench$(EXESUF): tests/qht-bench.o $(test-util-obj-y)
422 tests/test-bufferiszero$(EXESUF): tests/test-bufferiszero.o $(test-util-obj-y)
423 tests/atomic_add-bench$(EXESUF): tests/atomic_add-bench.o $(test-util-obj-y)
424 tests/atomic64-bench$(EXESUF): tests/atomic64-bench.o $(test-util-obj-y)
426 tests/fp/%:
427         $(MAKE) -C $(dir $@) $(notdir $@)
429 tests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o \
430         hw/core/qdev.o hw/core/qdev-properties.o hw/core/hotplug.o\
431         hw/core/bus.o \
432         hw/core/irq.o \
433         hw/core/fw-path-provider.o \
434         hw/core/reset.o \
435         hw/core/vmstate-if.o \
436         $(test-qapi-obj-y)
437 tests/test-vmstate$(EXESUF): tests/test-vmstate.o \
438         migration/vmstate.o migration/vmstate-types.o migration/qemu-file.o \
439         migration/qemu-file-channel.o migration/qjson.o \
440         $(test-io-obj-y)
441 tests/test-timed-average$(EXESUF): tests/test-timed-average.o $(test-util-obj-y)
442 tests/test-base64$(EXESUF): tests/test-base64.o $(test-util-obj-y)
443 tests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o hw/core/ptimer.o
444 tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o $(test-util-obj-y)
445 tests/test-keyval$(EXESUF): tests/test-keyval.o $(test-util-obj-y) $(test-qapi-obj-y)
446 tests/test-write-threshold$(EXESUF): tests/test-write-threshold.o $(test-block-obj-y)
447 tests/test-uuid$(EXESUF): tests/test-uuid.o $(test-util-obj-y)
448 tests/test-qapi-util$(EXESUF): tests/test-qapi-util.o $(test-util-obj-y)
450 tests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y)
452 tests/test-replication$(EXESUF): tests/test-replication.o $(test-util-obj-y) \
453         $(test-block-obj-y)
455 tests/test-qapi-types.c tests/test-qapi-types.h \
456 tests/include/test-qapi-types-sub-module.c \
457 tests/include/test-qapi-types-sub-module.h \
458 tests/test-qapi-types-sub-sub-module.c \
459 tests/test-qapi-types-sub-sub-module.h \
460 tests/test-qapi-visit.c tests/test-qapi-visit.h \
461 tests/include/test-qapi-visit-sub-module.c \
462 tests/include/test-qapi-visit-sub-module.h \
463 tests/test-qapi-visit-sub-sub-module.c \
464 tests/test-qapi-visit-sub-sub-module.h \
465 tests/test-qapi-commands.h tests/test-qapi-commands.c \
466 tests/include/test-qapi-commands-sub-module.h \
467 tests/include/test-qapi-commands-sub-module.c \
468 tests/test-qapi-commands-sub-sub-module.h \
469 tests/test-qapi-commands-sub-sub-module.c \
470 tests/test-qapi-emit-events.c tests/test-qapi-emit-events.h \
471 tests/test-qapi-events.c tests/test-qapi-events.h \
472 tests/test-qapi-init-commands.c \
473 tests/test-qapi-init-commands.h \
474 tests/include/test-qapi-events-sub-module.c \
475 tests/include/test-qapi-events-sub-module.h \
476 tests/test-qapi-events-sub-sub-module.c \
477 tests/test-qapi-events-sub-sub-module.h \
478 tests/test-qapi-introspect.c tests/test-qapi-introspect.h: \
479 tests/test-qapi-gen-timestamp ;
480 tests/test-qapi-gen-timestamp: \
481                 $(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json \
482                 $(SRC_PATH)/tests/qapi-schema/include/sub-module.json \
483                 $(SRC_PATH)/tests/qapi-schema/sub-sub-module.json \
484                 $(qapi-py)
485         $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
486                 -o tests -p "test-" $<, \
487                 "GEN","$(@:%-timestamp=%)")
488         @rm -f tests/test-qapi-doc.texi
489         @>$@
491 tests/qapi-schema/doc-good.test.texi: $(SRC_PATH)/tests/qapi-schema/doc-good.json $(qapi-py)
492         $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
493                 -o tests/qapi-schema -p "doc-good-" $<, \
494                 "GEN","$@")
495         @mv tests/qapi-schema/doc-good-qapi-doc.texi $@
496         @rm -f tests/qapi-schema/doc-good-qapi-*.[ch] tests/qapi-schema/doc-good-qmp-*.[ch]
498 tests/qtest/dbus-vmstate1.h tests/qtest/dbus-vmstate1.c: tests/qtest/dbus-vmstate1-gen-timestamp ;
499 tests/qtest/dbus-vmstate1-gen-timestamp: $(SRC_PATH)/tests/qtest/dbus-vmstate1.xml
500         $(call quiet-command,$(GDBUS_CODEGEN) $< \
501                 --interface-prefix org.qemu --generate-c-code tests/qtest/dbus-vmstate1, \
502                 "GEN","$(@:%-timestamp=%)")
503         @>$@
505 tests/qtest/dbus-vmstate-test.o-cflags := -DSRCDIR="$(SRC_PATH)"
506 tests/qtest/dbus-vmstate1.o-cflags := $(GIO_CFLAGS)
507 tests/qtest/dbus-vmstate1.o-libs := $(GIO_LIBS)
509 tests/qtest/dbus-vmstate-test.o: tests/qtest/dbus-vmstate1.h
511 tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y)
512 tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y)
513 tests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y) tests/test-qapi-emit-events.o tests/test-qapi-events.o
514 tests/test-qobject-output-visitor$(EXESUF): tests/test-qobject-output-visitor.o $(test-qapi-obj-y)
515 tests/test-clone-visitor$(EXESUF): tests/test-clone-visitor.o $(test-qapi-obj-y)
516 tests/test-qobject-input-visitor$(EXESUF): tests/test-qobject-input-visitor.o $(test-qapi-obj-y)
517 tests/test-qmp-cmds$(EXESUF): tests/test-qmp-cmds.o tests/test-qapi-commands.o tests/test-qapi-init-commands.o $(test-qapi-obj-y)
518 tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y)
519 tests/test-opts-visitor$(EXESUF): tests/test-opts-visitor.o $(test-qapi-obj-y)
521 tests/test-shift128$(EXESUF): tests/test-shift128.o $(test-util-obj-y)
522 tests/test-mul64$(EXESUF): tests/test-mul64.o $(test-util-obj-y)
523 tests/test-bitops$(EXESUF): tests/test-bitops.o $(test-util-obj-y)
524 tests/test-bitcnt$(EXESUF): tests/test-bitcnt.o $(test-util-obj-y)
525 tests/test-crypto-hash$(EXESUF): tests/test-crypto-hash.o $(test-crypto-obj-y)
526 tests/benchmark-crypto-hash$(EXESUF): tests/benchmark-crypto-hash.o $(test-crypto-obj-y)
527 tests/test-crypto-hmac$(EXESUF): tests/test-crypto-hmac.o $(test-crypto-obj-y)
528 tests/benchmark-crypto-hmac$(EXESUF): tests/benchmark-crypto-hmac.o $(test-crypto-obj-y)
529 tests/test-crypto-cipher$(EXESUF): tests/test-crypto-cipher.o $(test-crypto-obj-y)
530 tests/benchmark-crypto-cipher$(EXESUF): tests/benchmark-crypto-cipher.o $(test-crypto-obj-y)
531 tests/test-crypto-secret$(EXESUF): tests/test-crypto-secret.o $(test-crypto-obj-y)
532 tests/test-crypto-xts$(EXESUF): tests/test-crypto-xts.o $(test-crypto-obj-y)
534 tests/crypto-tls-x509-helpers.o-cflags := $(TASN1_CFLAGS)
535 tests/crypto-tls-x509-helpers.o-libs := $(TASN1_LIBS)
536 tests/pkix_asn1_tab.o-cflags := $(TASN1_CFLAGS)
538 tests/test-crypto-tlscredsx509.o-cflags := $(TASN1_CFLAGS)
539 tests/test-crypto-tlscredsx509$(EXESUF): tests/test-crypto-tlscredsx509.o \
540         tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y)
542 tests/test-crypto-tlssession.o-cflags := $(TASN1_CFLAGS)
543 tests/test-crypto-tlssession$(EXESUF): tests/test-crypto-tlssession.o \
544         tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o \
545         tests/crypto-tls-psk-helpers.o \
546         $(test-crypto-obj-y)
547 tests/test-util-filemonitor$(EXESUF): tests/test-util-filemonitor.o \
548         $(test-util-obj-y)
549 tests/test-util-sockets$(EXESUF): tests/test-util-sockets.o \
550         tests/socket-helpers.o $(test-util-obj-y)
551 tests/test-authz-simple$(EXESUF): tests/test-authz-simple.o $(test-authz-obj-y)
552 tests/test-authz-list$(EXESUF): tests/test-authz-list.o $(test-authz-obj-y)
553 tests/test-authz-listfile$(EXESUF): tests/test-authz-listfile.o $(test-authz-obj-y)
554 tests/test-authz-pam$(EXESUF): tests/test-authz-pam.o $(test-authz-obj-y)
555 tests/test-io-task$(EXESUF): tests/test-io-task.o $(test-io-obj-y)
556 tests/test-io-channel-socket$(EXESUF): tests/test-io-channel-socket.o \
557         tests/io-channel-helpers.o tests/socket-helpers.o $(test-io-obj-y)
558 tests/test-io-channel-file$(EXESUF): tests/test-io-channel-file.o \
559         tests/io-channel-helpers.o $(test-io-obj-y)
560 tests/test-io-channel-tls$(EXESUF): tests/test-io-channel-tls.o \
561         tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o \
562         tests/io-channel-helpers.o $(test-io-obj-y)
563 tests/test-io-channel-command$(EXESUF): tests/test-io-channel-command.o \
564         tests/io-channel-helpers.o $(test-io-obj-y)
565 tests/test-io-channel-buffer$(EXESUF): tests/test-io-channel-buffer.o \
566         tests/io-channel-helpers.o $(test-io-obj-y)
567 tests/test-crypto-pbkdf$(EXESUF): tests/test-crypto-pbkdf.o $(test-crypto-obj-y)
568 tests/test-crypto-ivgen$(EXESUF): tests/test-crypto-ivgen.o $(test-crypto-obj-y)
569 tests/test-crypto-afsplit$(EXESUF): tests/test-crypto-afsplit.o $(test-crypto-obj-y)
570 tests/test-crypto-block$(EXESUF): tests/test-crypto-block.o $(test-crypto-obj-y)
572 tests/migration/stress$(EXESUF): tests/migration/stress.o
573         $(call quiet-command, $(LINKPROG) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"LINK","$(TARGET_DIR)$@")
575 INITRD_WORK_DIR=tests/migration/initrd
577 tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF)
578         mkdir -p $(INITRD_WORK_DIR)
579         cp $< $(INITRD_WORK_DIR)/init
580         (cd $(INITRD_WORK_DIR) && (find | cpio --quiet -o -H newc | gzip -9)) > $@
581         rm $(INITRD_WORK_DIR)/init
582         rmdir $(INITRD_WORK_DIR)
584 include $(SRC_PATH)/tests/qtest/Makefile.include
586 tests/test-qga$(EXESUF): qemu-ga$(EXESUF)
587 tests/test-qga$(EXESUF): tests/test-qga.o $(qtest-obj-y)
589 SPEED = quick
591 # gtester tests, possibly with verbose output
592 # do_test_tap runs all tests, even if some of them fail, while do_test_human
593 # stops at the first failure unless -k is given on the command line
595 define do_test_human_k
596         $(quiet-@)rc=0; $(foreach COMMAND, $1, \
597           $(call quiet-command-run, \
598             export MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} $2; \
599               $(COMMAND) -m=$(SPEED) -k --tap < /dev/null \
600               | ./scripts/tap-driver.pl --test-name="$(notdir $(COMMAND))" $(if $(V),, --show-failures-only) \
601               || rc=$$?;, "TEST", "$@: $(COMMAND)")) exit $$rc
602 endef
603 define do_test_human_no_k
604         $(foreach COMMAND, $1, \
605           $(call quiet-command, \
606             MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} $2 \
607               $(COMMAND) -m=$(SPEED) -k --tap < /dev/null \
608               | ./scripts/tap-driver.pl --test-name="$(notdir $(COMMAND))" $(if $(V),, --show-failures-only), \
609               "TEST", "$@: $(COMMAND)")
611 endef
612 do_test_human = \
613         $(if $(findstring k, $(MAKEFLAGS)), $(do_test_human_k), $(do_test_human_no_k))
615 define do_test_tap
616         $(call quiet-command, \
617           { export MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} $2; \
618             $(foreach COMMAND, $1, \
619               $(COMMAND) -m=$(SPEED) -k --tap < /dev/null \
620               | sed "s/^[a-z][a-z]* [0-9]* /&$(notdir $(COMMAND)) /" || true; ) } \
621               | ./scripts/tap-merge.pl | tee "$@" \
622               | ./scripts/tap-driver.pl $(if $(V),, --show-failures-only), \
623           "TAP","$@")
624 endef
626 .PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS))
627 $(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: %-softmmu/all $(check-qtest-y)
628         $(call do_test_human,$(check-qtest-$*-y:%=tests/qtest/%$(EXESUF)) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)), \
629           QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
630           QTEST_QEMU_IMG=qemu-img$(EXESUF))
632 check-unit: $(check-unit-y)
633         $(call do_test_human, $^)
635 check-speed: $(check-speed-y)
636         $(call do_test_human, $^)
638 # gtester tests with TAP output
640 $(patsubst %, check-report-qtest-%.tap, $(QTEST_TARGETS)): check-report-qtest-%.tap: %-softmmu/all $(check-qtest-y)
641         $(call do_test_tap, $(check-qtest-$*-y:%=tests/qtest/%$(EXESUF)) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)), \
642           QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
643           QTEST_QEMU_IMG=qemu-img$(EXESUF))
645 check-report-unit.tap: $(check-unit-y)
646         $(call do_test_tap,$^)
648 # Reports and overall runs
650 check-report.tap: $(patsubst %,check-report-qtest-%.tap, $(QTEST_TARGETS)) check-report-unit.tap
651         $(call quiet-command, cat $^ | scripts/tap-merge.pl >$@,"GEN","$@")
653 # FPU Emulation tests (aka softfloat)
655 # As we still have some places that need fixing the rules are a little
656 # more complex than they need to be and have to override some of the
657 # generic Makefile expansions. Once we are cleanly passing all
658 # the tests we can simplify the make syntax.
660 FP_TEST_BIN=$(BUILD_DIR)/tests/fp/fp-test
662 # the build dir is created by configure
663 .PHONY: $(FP_TEST_BIN)
664 $(FP_TEST_BIN): config-host.h $(test-util-obj-y)
665         $(call quiet-command, \
666                 $(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" $(notdir $@), \
667                  "BUILD", "$(notdir $@)")
669 # The full test suite can take a bit of time, default to a quick run
670 # "-l 2 -r all" can take more than a day for some operations and is best
671 # run manually
672 FP_TL=-l 1 -r all
674 # $1 = tests, $2 = description, $3 = test flags
675 test-softfloat = $(call quiet-command, \
676                         cd $(BUILD_DIR)/tests/fp && \
677                         ./fp-test -s $(if $3,$3,$(FP_TL)) $1 > $2.out 2>&1 || \
678                         (cat $2.out && exit 1;), \
679                         "FLOAT TEST", $2)
681 # Conversion Routines:
682 # FIXME: i32_to_extF80 (broken), i64_to_extF80 (broken)
683 #        ui32_to_f128 (not implemented), extF80_roundToInt (broken)
685 check-softfloat-conv: $(FP_TEST_BIN)
686         $(call test-softfloat, \
687                 i32_to_f16 i64_to_f16 \
688                 i32_to_f32 i64_to_f32 \
689                 i32_to_f64 i64_to_f64 \
690                 i32_to_f128 i64_to_f128, int-to-float)
691         $(call test-softfloat, \
692                 ui32_to_f16 ui64_to_f16 \
693                 ui32_to_f32 ui64_to_f32 \
694                 ui32_to_f64 ui64_to_f64 \
695                 ui64_to_f128, uint-to-float)
696         $(call test-softfloat, \
697                 f16_to_i32 f16_to_i32_r_minMag \
698                 f32_to_i32 f32_to_i32_r_minMag \
699                 f64_to_i32 f64_to_i32_r_minMag \
700                 extF80_to_i32 extF80_to_i32_r_minMag \
701                 f128_to_i32 f128_to_i32_r_minMag \
702                 f16_to_i64 f16_to_i64_r_minMag \
703                 f32_to_i64 f32_to_i64_r_minMag \
704                 f64_to_i64 f64_to_i64_r_minMag \
705                 extF80_to_i64 extF80_to_i64_r_minMag \
706                 f128_to_i64 f128_to_i64_r_minMag, \
707                 float-to-int)
708         $(call test-softfloat, \
709                 f16_to_ui32 f16_to_ui32_r_minMag \
710                 f32_to_ui32 f32_to_ui32_r_minMag \
711                 f64_to_ui32 f64_to_ui32_r_minMag \
712                 f128_to_ui32 f128_to_ui32_r_minMag \
713                 f16_to_ui64 f16_to_ui64_r_minMag \
714                 f32_to_ui64 f32_to_ui64_r_minMag \
715                 f64_to_ui64 f64_to_ui64_r_minMag \
716                 f128_to_ui64 f128_to_ui64_r_minMag, \
717                 float-to-uint)
718         $(call test-softfloat, \
719                 f16_roundToInt f32_roundToInt \
720                 f64_roundToInt f128_roundToInt, \
721                 round-to-integer)
723 # Generic rule for all float operations
725 # Some patterns are overidden due to broken or missing tests.
726 # Hopefully these can be removed over time.
728 check-softfloat-%: $(FP_TEST_BIN)
729         $(call test-softfloat, f16_$* f32_$* f64_$* extF80_$* f128_$*, $*)
731 # Float Compare routines
732 SF_COMPARE_OPS=eq eq_signaling le le_quiet lt_quiet
733 SF_COMPARE_RULES=$(patsubst %,check-softfloat-%, $(SF_COMPARE_OPS))
735 # FIXME: extF80_le_quiet (broken)
736 check-softfloat-le_quiet: $(FP_TEST_BIN)
737         $(call test-softfloat,                          \
738                 f16_le_quiet f32_le_quiet f64_le_quiet  \
739                 f128_le_quiet,                          \
740                 le_quiet)
742 # FIXME: extF80_lt_quiet (broken)
743 check-softfloat-lt_quiet: $(FP_TEST_BIN)
744         $(call test-softfloat,                          \
745                 f16_lt_quiet f32_lt_quiet f64_lt_quiet  \
746                 f128_lt_quiet,                          \
747                 lt_quiet)
749 .PHONY: check-softfloat-compare
750 check-softfloat-compare: $(SF_COMPARE_RULES)
752 # Math Operations
754 # FIXME: extF80_mulAdd (missing)
755 check-softfloat-mulAdd: $(FP_TEST_BIN)
756         $(call test-softfloat, \
757                 f16_mulAdd f32_mulAdd f64_mulAdd f128_mulAdd, \
758                 mulAdd,-l 1)
760 # FIXME: extF80_rem (broken)
761 check-softfloat-rem: $(FP_TEST_BIN)
762         $(call test-softfloat, \
763                 f16_rem f32_rem f64_rem f128_rem, \
764                 rem)
766 SF_MATH_OPS=add sub mul mulAdd div rem sqrt
767 SF_MATH_RULES=$(patsubst %,check-softfloat-%, $(SF_MATH_OPS))
769 .PHONY: check-softfloat-ops
770 check-softfloat-ops: $(SF_MATH_RULES)
772 # Finally a generic rule to test all of softfoat. If TCG isnt't
773 # enabled we define a null operation which skips the tests.
775 .PHONY: check-softfloat
776 ifeq ($(CONFIG_TCG),y)
777 check-softfloat: check-softfloat-conv check-softfloat-compare check-softfloat-ops
778 else
779 check-softfloat:
780         $(call quiet-command, /bin/true, "FLOAT TEST", \
781                 "SKIPPED for non-TCG builds")
782 endif
784 # Plugins
785 ifeq ($(CONFIG_PLUGIN),y)
786 .PHONY: plugins
787 plugins:
788         $(call quiet-command,\
789                 $(MAKE) $(SUBDIR_MAKEFLAGS) -C tests/plugin V="$(V)", \
790                 "BUILD", "plugins")
791 endif
793 # Per guest TCG tests
795 BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS))
796 CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TARGET_DIRS))
797 RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TARGET_DIRS))
799 # Probe for the Docker Builds needed for each build
800 $(foreach PROBE_TARGET,$(TARGET_DIRS),                          \
801         $(eval -include $(SRC_PATH)/tests/tcg/Makefile.prereqs))
803 build-tcg-tests-%: $(if $(CONFIG_PLUGIN),plugins)
804         $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
805                 -f $(SRC_PATH)/tests/tcg/Makefile.qemu \
806                 SRC_PATH=$(SRC_PATH) \
807                 V="$(V)" TARGET="$*" guest-tests, \
808                 "BUILD", "TCG tests for $*")
810 run-tcg-tests-%: build-tcg-tests-% %/all
811         $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
812                 -f $(SRC_PATH)/tests/tcg/Makefile.qemu \
813                 SRC_PATH=$(SRC_PATH) SPEED="$(SPEED)" \
814                 V="$(V)" TARGET="$*" run-guest-tests, \
815                 "RUN", "TCG tests for $*")
817 clean-tcg-tests-%:
818         $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
819                 -f $(SRC_PATH)/tests/tcg/Makefile.qemu \
820                 SRC_PATH=$(SRC_PATH) TARGET="$*" clean-guest-tests, \
821                 "CLEAN", "TCG tests for $*")
823 .PHONY: build-tcg
824 build-tcg: $(BUILD_TCG_TARGET_RULES)
826 .PHONY: check-tcg
827 check-tcg: $(RUN_TCG_TARGET_RULES)
829 .PHONY: clean-tcg
830 clean-tcg: $(CLEAN_TCG_TARGET_RULES)
832 # Other tests
834 QEMU_IOTESTS_HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = tests/qemu-iotests/socket_scm_helper$(EXESUF)
836 .PHONY: check-tests/check-block.sh
837 check-tests/check-block.sh: tests/check-block.sh qemu-img$(EXESUF) \
838                 qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) \
839                 $(patsubst %,%/all,$(filter %-softmmu,$(TARGET_DIRS)))
840         @$<
842 .PHONY: check-tests/qapi-schema/frontend
843 check-tests/qapi-schema/frontend: $(addprefix $(SRC_PATH)/, $(check-qapi-schema-y))
844         $(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts \
845           PYTHONIOENCODING=utf-8 $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py $^, \
846           TEST, check-qapi-schema)
848 .PHONY: check-tests/qapi-schema/doc-good.texi
849 check-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi
850         @diff -u $(SRC_PATH)/tests/qapi-schema/doc-good.texi $<
852 .PHONY: check-decodetree
853 check-decodetree:
854         $(call quiet-command, \
855           cd $(SRC_PATH)/tests/decode && \
856           ./check.sh "$(PYTHON)" "$(SRC_PATH)/scripts/decodetree.py", \
857           TEST, decodetree.py)
859 # Python venv for running tests
861 .PHONY: check-venv check-acceptance
863 TESTS_VENV_DIR=$(BUILD_DIR)/tests/venv
864 TESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt
865 TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
866 # Controls the output generated by Avocado when running tests.
867 # Any number of command separated loggers are accepted.  For more
868 # information please refer to "avocado --help".
869 AVOCADO_SHOW=app
870 AVOCADO_TAGS=$(patsubst %-softmmu,-t arch:%, $(filter %-softmmu,$(TARGET_DIRS)))
872 $(TESTS_VENV_DIR): $(TESTS_VENV_REQ)
873         $(call quiet-command, \
874             $(PYTHON) -m venv --system-site-packages $@, \
875             VENV, $@)
876         $(call quiet-command, \
877             $(TESTS_VENV_DIR)/bin/python -m pip -q install -r $(TESTS_VENV_REQ), \
878             PIP, $(TESTS_VENV_REQ))
879         $(call quiet-command, touch $@)
881 $(TESTS_RESULTS_DIR):
882         $(call quiet-command, mkdir -p $@, \
883             MKDIR, $@)
885 check-venv: $(TESTS_VENV_DIR)
887 check-acceptance: check-venv $(TESTS_RESULTS_DIR)
888         $(call quiet-command, \
889             $(TESTS_VENV_DIR)/bin/python -m avocado \
890             --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
891             --filter-by-tags-include-empty --filter-by-tags-include-empty-key \
892             $(AVOCADO_TAGS) \
893             --failfast=on tests/acceptance, \
894             "AVOCADO", "tests/acceptance")
896 # Consolidated targets
898 .PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean
899 check-qapi-schema: check-tests/qapi-schema/frontend check-tests/qapi-schema/doc-good.texi
900 check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
901 ifeq ($(CONFIG_TOOLS),y)
902 check-block: $(patsubst %,check-%, $(check-block-y))
903 endif
904 check: check-block check-qapi-schema check-unit check-softfloat check-qtest check-decodetree
905 check-clean:
906         rm -rf $(check-unit-y) tests/*.o tests/*/*.o $(QEMU_IOTESTS_HELPERS-y)
907         rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y:%=tests/qtest/%$(EXESUF))) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)))
908         rm -f tests/test-qapi-gen-timestamp
909         rm -f tests/qtest/dbus-vmstate1-gen-timestamp
910         rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR)
912 clean: check-clean
914 # Build the help program automatically
916 all: $(QEMU_IOTESTS_HELPERS-y)
918 -include $(wildcard tests/*.d)
919 -include $(wildcard tests/qtest/*.d)
920 -include $(wildcard tests/qtest/qos/*.d)
922 endif