xref: /openbmc/qemu/tests/Makefile.include (revision f15bff25)
13b8593eeSMarkus Armbruster# -*- Mode: makefile -*-
2e45eaef9SFam Zheng
3e45eaef9SFam Zheng.PHONY: check-help
4e45eaef9SFam Zhengcheck-help:
5e45eaef9SFam Zheng	@echo "Regression testing targets:"
6e45eaef9SFam Zheng	@echo
79865f39dSHuacai Chen	@echo " $(MAKE) check                Run block, qapi-schema, unit, softfloat, qtest and decodetree tests"
854f96b45SCleber Rosa	@echo
9b98a3baeSPhilippe Mathieu-Daudé	@echo " $(MAKE) check-qtest-TARGET   Run qtest tests for given target"
10b98a3baeSPhilippe Mathieu-Daudé	@echo " $(MAKE) check-qtest          Run qtest tests"
11b98a3baeSPhilippe Mathieu-Daudé	@echo " $(MAKE) check-unit           Run qobject tests"
12b98a3baeSPhilippe Mathieu-Daudé	@echo " $(MAKE) check-speed          Run qobject speed tests"
13b98a3baeSPhilippe Mathieu-Daudé	@echo " $(MAKE) check-qapi-schema    Run QAPI schema tests"
14b98a3baeSPhilippe Mathieu-Daudé	@echo " $(MAKE) check-block          Run block tests"
15ca6db469SPhilippe Mathieu-Daudéifeq ($(CONFIG_TCG),y)
168ba0a820SAlex Bennée	@echo " $(MAKE) check-tcg            Run TCG tests"
1776170102SAlex Bennée	@echo " $(MAKE) check-softfloat      Run FPU emulation tests"
18ca6db469SPhilippe Mathieu-Daudéendif
19a56931eeSCleber Rosa	@echo " $(MAKE) check-acceptance     Run all acceptance (functional) tests"
2054f96b45SCleber Rosa	@echo
21c3088cd3SWainer dos Santos Moschetta	@echo " $(MAKE) check-report.tap     Generates an aggregated TAP test report"
2221313721SCleber Rosa	@echo " $(MAKE) check-venv           Creates a Python venv for tests"
2354f96b45SCleber Rosa	@echo " $(MAKE) check-clean          Clean the tests and related data"
24e45eaef9SFam Zheng	@echo
25a6eeac3bSAlex Bennée	@echo "The following are useful for CI builds"
26a6eeac3bSAlex Bennée	@echo " $(MAKE) check-build          Build most test binaris"
274ec49f0fSCleber Rosa	@echo " $(MAKE) get-vm-images        Downloads all images used by acceptance tests, according to configured targets (~350 MB each, 1.5 GB max)"
284ec49f0fSCleber Rosa	@echo
29e45eaef9SFam Zheng	@echo
30e45eaef9SFam Zheng	@echo "The variable SPEED can be set to control the gtester speed setting."
31b98a3baeSPhilippe Mathieu-Daudé	@echo "Default options are -k and (for $(MAKE) V=1) --verbose; they can be"
32e45eaef9SFam Zheng	@echo "changed with variable GTESTER_OPTIONS."
33e45eaef9SFam Zheng
34e45eaef9SFam Zhengifneq ($(wildcard config-host.mak),)
3546e7b706SFam Zhengexport SRC_PATH
3646e7b706SFam Zheng
37fb0bc835SMarkus Armbruster# TODO don't duplicate $(SRC_PATH)/Makefile's qapi-py here
38e6c42b96SMarkus Armbrusterqapi-py = $(SRC_PATH)/scripts/qapi/__init__.py \
39e6c42b96SMarkus Armbruster$(SRC_PATH)/scripts/qapi/commands.py \
40fb0bc835SMarkus Armbruster$(SRC_PATH)/scripts/qapi/common.py \
41fb0bc835SMarkus Armbruster$(SRC_PATH)/scripts/qapi/doc.py \
42e6c42b96SMarkus Armbruster$(SRC_PATH)/scripts/qapi/error.py \
43e6c42b96SMarkus Armbruster$(SRC_PATH)/scripts/qapi/events.py \
44e6c42b96SMarkus Armbruster$(SRC_PATH)/scripts/qapi/expr.py \
45e6c42b96SMarkus Armbruster$(SRC_PATH)/scripts/qapi/gen.py \
46e6c42b96SMarkus Armbruster$(SRC_PATH)/scripts/qapi/introspect.py \
47e6c42b96SMarkus Armbruster$(SRC_PATH)/scripts/qapi/parser.py \
48e6c42b96SMarkus Armbruster$(SRC_PATH)/scripts/qapi/schema.py \
49e6c42b96SMarkus Armbruster$(SRC_PATH)/scripts/qapi/source.py \
50e6c42b96SMarkus Armbruster$(SRC_PATH)/scripts/qapi/types.py \
51e6c42b96SMarkus Armbruster$(SRC_PATH)/scripts/qapi/visit.py \
52fb0bc835SMarkus Armbruster$(SRC_PATH)/scripts/qapi-gen.py
5346e7b706SFam Zheng
5446e7b706SFam Zheng# Get the list of all supported sysemu targets
5546e7b706SFam ZhengSYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
5646e7b706SFam Zheng   $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak)))
5746e7b706SFam Zheng
587a6c377fSEric Blakecheck-unit-y += tests/check-qdict$(EXESUF)
59992159c7SMarkus Armbrustercheck-unit-y += tests/check-block-qdict$(EXESUF)
6001b2ffceSMarc-André Lureaucheck-unit-y += tests/check-qnum$(EXESUF)
6146e7b706SFam Zhengcheck-unit-y += tests/check-qstring$(EXESUF)
6246e7b706SFam Zhengcheck-unit-y += tests/check-qlist$(EXESUF)
6346e7b706SFam Zhengcheck-unit-y += tests/check-qnull$(EXESUF)
641b76e838SMax Reitzcheck-unit-y += tests/check-qobject$(EXESUF)
6546e7b706SFam Zhengcheck-unit-y += tests/check-qjson$(EXESUF)
66382176b4SMarc-André Lureaucheck-unit-y += tests/check-qlit$(EXESUF)
67b3db211fSDaniel P. Berrangecheck-unit-y += tests/test-qobject-output-visitor$(EXESUF)
68a15fcc3cSEric Blakecheck-unit-y += tests/test-clone-visitor$(EXESUF)
69b3db211fSDaniel P. Berrangecheck-unit-y += tests/test-qobject-input-visitor$(EXESUF)
7037914f60SPhilippe Mathieu-Daudécheck-unit-$(CONFIG_SOFTMMU) += tests/test-qmp-cmds$(EXESUF)
7146e7b706SFam Zhengcheck-unit-y += tests/test-string-input-visitor$(EXESUF)
7246e7b706SFam Zhengcheck-unit-y += tests/test-string-output-visitor$(EXESUF)
7346e7b706SFam Zhengcheck-unit-y += tests/test-qmp-event$(EXESUF)
7446e7b706SFam Zhengcheck-unit-y += tests/test-opts-visitor$(EXESUF)
7529de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-coroutine$(EXESUF)
7646e7b706SFam Zhengcheck-unit-y += tests/test-visitor-serialization$(EXESUF)
7737914f60SPhilippe Mathieu-Daudécheck-unit-$(CONFIG_SOFTMMU) += tests/test-iov$(EXESUF)
78ad37f24dSPeter Xucheck-unit-y += tests/test-bitmap$(EXESUF)
7929de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-aio$(EXESUF)
8029de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-aio-multithread$(EXESUF)
8129de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-throttle$(EXESUF)
8229de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-thread-pool$(EXESUF)
8329de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-hbitmap$(EXESUF)
8429de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-bdrv-drain$(EXESUF)
8529de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-bdrv-graph-mod$(EXESUF)
8629de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-blockjob$(EXESUF)
8729de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-blockjob-txn$(EXESUF)
8829de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-block-backend$(EXESUF)
8929de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-block-iothread$(EXESUF)
9029de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-image-locking$(EXESUF)
9146e7b706SFam Zhengcheck-unit-y += tests/test-x86-cpuid$(EXESUF)
9246e7b706SFam Zheng# all code tested by test-x86-cpuid is inside topology.h
9346e7b706SFam Zhengifeq ($(CONFIG_SOFTMMU),y)
9446e7b706SFam Zhengcheck-unit-y += tests/test-xbzrle$(EXESUF)
9546e7b706SFam Zhengcheck-unit-$(CONFIG_POSIX) += tests/test-vmstate$(EXESUF)
9646e7b706SFam Zhengendif
9746e7b706SFam Zhengcheck-unit-y += tests/test-cutils$(EXESUF)
98f539fbe3SJose Ricardo Zivianicheck-unit-y += tests/test-shift128$(EXESUF)
9946e7b706SFam Zhengcheck-unit-y += tests/test-mul64$(EXESUF)
10046e7b706SFam Zhengcheck-unit-y += tests/test-int128$(EXESUF)
10146e7b706SFam Zheng# all code tested by test-int128 is inside int128.h
10246e7b706SFam Zhengcheck-unit-y += tests/rcutorture$(EXESUF)
10346e7b706SFam Zhengcheck-unit-y += tests/test-rcu-list$(EXESUF)
10490487e45SEmilio G. Cotacheck-unit-y += tests/test-rcu-simpleq$(EXESUF)
105dbf8862aSEmilio G. Cotacheck-unit-y += tests/test-rcu-tailq$(EXESUF)
1068c3570e3SPaolo Bonzinicheck-unit-y += tests/test-rcu-slist$(EXESUF)
107ff9249b7SEmilio G. Cotacheck-unit-y += tests/test-qdist$(EXESUF)
1081a95404fSEmilio G. Cotacheck-unit-y += tests/test-qht$(EXESUF)
109a36270a4SAlex Bennéecheck-unit-y += tests/test-qht-par$(EXESUF)
11046e7b706SFam Zhengcheck-unit-y += tests/test-bitops$(EXESUF)
111c3f8962fSAlex Bennéecheck-unit-y += tests/test-bitcnt$(EXESUF)
11246e7b706SFam Zhengcheck-unit-y += tests/check-qom-interface$(EXESUF)
11346e7b706SFam Zhengcheck-unit-y += tests/check-qom-proplist$(EXESUF)
11446e7b706SFam Zhengcheck-unit-y += tests/test-qemu-opts$(EXESUF)
115d454dbe0SMarkus Armbrustercheck-unit-y += tests/test-keyval$(EXESUF)
11629de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-write-threshold$(EXESUF)
11729de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-crypto-hash$(EXESUF)
11829de2804SLaurent Viviercheck-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-hash$(EXESUF)
11929de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-crypto-hmac$(EXESUF)
12029de2804SLaurent Viviercheck-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-hmac$(EXESUF)
12129de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-crypto-cipher$(EXESUF)
12229de2804SLaurent Viviercheck-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-cipher$(EXESUF)
12329de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-crypto-secret$(EXESUF)
12429de2804SLaurent Viviercheck-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-crypto-tlscredsx509$(EXESUF)
12529de2804SLaurent Viviercheck-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-crypto-tlssession$(EXESUF)
126ff8f63daSRobert Foleyifndef CONFIG_TSAN
127ff8f63daSRobert Foley# Some tests: test-char, test-qdev-global-props, and test-qga,
128ff8f63daSRobert Foley# are not runnable under TSan due to a known issue.
129ff8f63daSRobert Foley# https://github.com/google/sanitizers/issues/1116
130ff8f63daSRobert Foleycheck-unit-$(CONFIG_SOFTMMU) += tests/test-char$(EXESUF)
131ff8f63daSRobert Foleycheck-unit-$(CONFIG_SOFTMMU) += tests/test-qdev-global-props$(EXESUF)
132*f15bff25SPaolo Bonziniifeq ($(CONFIG_GUEST_AGENT),y)
133a9d2e3f1SPhilippe Mathieu-Daudécheck-unit-$(call land,$(CONFIG_LINUX),$(CONFIG_VIRTIO_SERIAL)) += tests/test-qga$(EXESUF)
13446e7b706SFam Zhengendif
135ff8f63daSRobert Foleyendif
13637914f60SPhilippe Mathieu-Daudécheck-unit-$(CONFIG_SOFTMMU) += tests/test-timed-average$(EXESUF)
13737914f60SPhilippe Mathieu-Daudécheck-unit-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_INOTIFY1)) += tests/test-util-filemonitor$(EXESUF)
13837914f60SPhilippe Mathieu-Daudécheck-unit-$(CONFIG_SOFTMMU) += tests/test-util-sockets$(EXESUF)
13929de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-authz-simple$(EXESUF)
14029de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-authz-list$(EXESUF)
14129de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-authz-listfile$(EXESUF)
14229de2804SLaurent Viviercheck-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_AUTH_PAM)) += tests/test-authz-pam$(EXESUF)
14329de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-io-task$(EXESUF)
14429de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-io-channel-socket$(EXESUF)
14529de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-io-channel-file$(EXESUF)
14629de2804SLaurent Viviercheck-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-io-channel-tls$(EXESUF)
14729de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-io-channel-command$(EXESUF)
14829de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-io-channel-buffer$(EXESUF)
14937914f60SPhilippe Mathieu-Daudécheck-unit-$(CONFIG_SOFTMMU) += tests/test-base64$(EXESUF)
15029de2804SLaurent Viviercheck-unit-$(call land,$(CONFIG_BLOCK),$(if $(CONFIG_NETTLE),y,$(CONFIG_GCRYPT))) += tests/test-crypto-pbkdf$(EXESUF)
15129de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK) += tests/test-crypto-ivgen$(EXESUF)
15229de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK)  += tests/test-crypto-afsplit$(EXESUF)
1534e89ed19SDaniel P. Berrangécheck-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_QEMU_PRIVATE_XTS)) += tests/test-crypto-xts$(EXESUF)
15429de2804SLaurent Viviercheck-unit-$(CONFIG_BLOCK)  += tests/test-crypto-block$(EXESUF)
15546e7b706SFam Zhengcheck-unit-y += tests/test-logging$(EXESUF)
15629de2804SLaurent Viviercheck-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_REPLICATION)) += tests/test-replication$(EXESUF)
15737914f60SPhilippe Mathieu-Daudécheck-unit-$(CONFIG_SOFTMMU) += tests/test-bufferiszero$(EXESUF)
158c739cdddSFam Zhengcheck-unit-y += tests/test-uuid$(EXESUF)
15924b94625SPaolo Bonzinicheck-unit-y += tests/ptimer-test$(EXESUF)
1606c873d11SMarkus Armbrustercheck-unit-y += tests/test-qapi-util$(EXESUF)
16146e7b706SFam Zheng
162bdd95e47SThomas Huthcheck-block-$(call land,$(CONFIG_POSIX),$(CONFIG_SOFTMMU)) += tests/check-block.sh
16346e7b706SFam Zheng
16446e7b706SFam Zhengqapi-schema += alternate-any.json
16546e7b706SFam Zhengqapi-schema += alternate-array.json
16646e7b706SFam Zhengqapi-schema += alternate-base.json
167ef91ab0dSMarkus Armbrusterqapi-schema += alternate-branch-if-invalid.json
16846e7b706SFam Zhengqapi-schema += alternate-clash.json
16946e7b706SFam Zhengqapi-schema += alternate-conflict-dict.json
170c0644771SMarkus Armbrusterqapi-schema += alternate-conflict-enum-bool.json
171c0644771SMarkus Armbrusterqapi-schema += alternate-conflict-enum-int.json
17246e7b706SFam Zhengqapi-schema += alternate-conflict-string.json
173fda72ab4SEduardo Habkostqapi-schema += alternate-conflict-bool-string.json
174fda72ab4SEduardo Habkostqapi-schema += alternate-conflict-num-string.json
17546e7b706SFam Zhengqapi-schema += alternate-empty.json
17687adbbffSMarc-André Lureauqapi-schema += alternate-invalid-dict.json
17746e7b706SFam Zhengqapi-schema += alternate-nested.json
17846e7b706SFam Zhengqapi-schema += alternate-unknown.json
17946e7b706SFam Zhengqapi-schema += args-alternate.json
18046e7b706SFam Zhengqapi-schema += args-any.json
18146e7b706SFam Zhengqapi-schema += args-array-empty.json
18246e7b706SFam Zhengqapi-schema += args-array-unknown.json
183c818408eSEric Blakeqapi-schema += args-bad-boxed.json
184c818408eSEric Blakeqapi-schema += args-boxed-anon.json
185c818408eSEric Blakeqapi-schema += args-boxed-string.json
18646e7b706SFam Zhengqapi-schema += args-int.json
18746e7b706SFam Zhengqapi-schema += args-invalid.json
18846e7b706SFam Zhengqapi-schema += args-member-array-bad.json
18946e7b706SFam Zhengqapi-schema += args-member-case.json
19046e7b706SFam Zhengqapi-schema += args-member-unknown.json
19146e7b706SFam Zhengqapi-schema += args-name-clash.json
19246e7b706SFam Zhengqapi-schema += args-union.json
19346e7b706SFam Zhengqapi-schema += args-unknown.json
19446e7b706SFam Zhengqapi-schema += bad-base.json
19546e7b706SFam Zhengqapi-schema += bad-data.json
19646e7b706SFam Zhengqapi-schema += bad-ident.json
197967c8851SMarc-André Lureauqapi-schema += bad-if.json
198967c8851SMarc-André Lureauqapi-schema += bad-if-empty.json
199967c8851SMarc-André Lureauqapi-schema += bad-if-empty-list.json
200967c8851SMarc-André Lureauqapi-schema += bad-if-list.json
20146e7b706SFam Zhengqapi-schema += bad-type-bool.json
20246e7b706SFam Zhengqapi-schema += bad-type-dict.json
20346e7b706SFam Zhengqapi-schema += bad-type-int.json
20446e7b706SFam Zhengqapi-schema += base-cycle-direct.json
20546e7b706SFam Zhengqapi-schema += base-cycle-indirect.json
20646e7b706SFam Zhengqapi-schema += command-int.json
20746e7b706SFam Zhengqapi-schema += comments.json
208f641d06aSMarkus Armbrusterqapi-schema += doc-bad-alternate-member.json
209717cfcfaSMarkus Armbrusterqapi-schema += doc-bad-boxed-command-arg.json
210bdc001caSMarkus Armbrusterqapi-schema += doc-bad-command-arg.json
211f035b47eSMarkus Armbrusterqapi-schema += doc-bad-enum-member.json
212717cfcfaSMarkus Armbrusterqapi-schema += doc-bad-event-arg.json
213f035b47eSMarkus Armbrusterqapi-schema += doc-bad-feature.json
214cfa438ffSMarkus Armbrusterqapi-schema += doc-bad-section.json
2153313b612SMarc-André Lureauqapi-schema += doc-bad-symbol.json
216f641d06aSMarkus Armbrusterqapi-schema += doc-bad-union-member.json
2172028be8eSMarkus Armbrusterqapi-schema += doc-before-include.json
2182028be8eSMarkus Armbrusterqapi-schema += doc-before-pragma.json
2193313b612SMarc-André Lureauqapi-schema += doc-duplicated-arg.json
2203313b612SMarc-André Lureauqapi-schema += doc-duplicated-return.json
2213313b612SMarc-André Lureauqapi-schema += doc-duplicated-since.json
2223313b612SMarc-André Lureauqapi-schema += doc-empty-arg.json
2233313b612SMarc-André Lureauqapi-schema += doc-empty-section.json
2243313b612SMarc-André Lureauqapi-schema += doc-empty-symbol.json
22580d1f2e4SMarkus Armbrusterqapi-schema += doc-good.json
2263313b612SMarc-André Lureauqapi-schema += doc-interleaved-section.json
2273313b612SMarc-André Lureauqapi-schema += doc-invalid-end.json
2283313b612SMarc-André Lureauqapi-schema += doc-invalid-end2.json
2293313b612SMarc-André Lureauqapi-schema += doc-invalid-return.json
2303313b612SMarc-André Lureauqapi-schema += doc-invalid-section.json
2313313b612SMarc-André Lureauqapi-schema += doc-invalid-start.json
2323313b612SMarc-André Lureauqapi-schema += doc-missing-colon.json
2333313b612SMarc-André Lureauqapi-schema += doc-missing-expr.json
2343313b612SMarc-André Lureauqapi-schema += doc-missing-space.json
235cfa438ffSMarkus Armbrusterqapi-schema += doc-missing.json
2362028be8eSMarkus Armbrusterqapi-schema += doc-no-symbol.json
237f035b47eSMarkus Armbrusterqapi-schema += doc-undoc-feature.json
23846e7b706SFam Zhengqapi-schema += double-type.json
23946e7b706SFam Zhengqapi-schema += duplicate-key.json
24046e7b706SFam Zhengqapi-schema += empty.json
241ea738b21SMarc-André Lureauqapi-schema += enum-bad-member.json
24246e7b706SFam Zhengqapi-schema += enum-bad-name.json
24346e7b706SFam Zhengqapi-schema += enum-bad-prefix.json
24446e7b706SFam Zhengqapi-schema += enum-clash-member.json
245ea738b21SMarc-André Lureauqapi-schema += enum-dict-member-unknown.json
2466cc32b0eSMarc-André Lureauqapi-schema += enum-if-invalid.json
24746e7b706SFam Zhengqapi-schema += enum-int-member.json
24846e7b706SFam Zhengqapi-schema += enum-member-case.json
24946e7b706SFam Zhengqapi-schema += enum-missing-data.json
25046e7b706SFam Zhengqapi-schema += enum-wrong-data.json
251c818408eSEric Blakeqapi-schema += event-boxed-empty.json
25246e7b706SFam Zhengqapi-schema += event-case.json
25387adbbffSMarc-André Lureauqapi-schema += event-member-invalid-dict.json
25446e7b706SFam Zhengqapi-schema += event-nest-struct.json
255a00af404SKevin Wolfqapi-schema += features-bad-type.json
256f965e8feSMarkus Armbrusterqapi-schema += features-deprecated-type.json
257a00af404SKevin Wolfqapi-schema += features-duplicate-name.json
258ef91ab0dSMarkus Armbrusterqapi-schema += features-if-invalid.json
259a00af404SKevin Wolfqapi-schema += features-missing-name.json
260a00af404SKevin Wolfqapi-schema += features-name-bad-type.json
261a00af404SKevin Wolfqapi-schema += features-no-list.json
262a00af404SKevin Wolfqapi-schema += features-unknown-key.json
26346e7b706SFam Zhengqapi-schema += flat-union-array-branch.json
26446e7b706SFam Zhengqapi-schema += flat-union-bad-base.json
26546e7b706SFam Zhengqapi-schema += flat-union-bad-discriminator.json
26646e7b706SFam Zhengqapi-schema += flat-union-base-any.json
26746e7b706SFam Zhengqapi-schema += flat-union-base-union.json
26846e7b706SFam Zhengqapi-schema += flat-union-clash-member.json
269cd346bdcSMarkus Armbrusterqapi-schema += flat-union-discriminator-bad-name.json
27046e7b706SFam Zhengqapi-schema += flat-union-empty.json
27146e7b706SFam Zhengqapi-schema += flat-union-inline.json
27287adbbffSMarc-André Lureauqapi-schema += flat-union-inline-invalid-dict.json
27346e7b706SFam Zhengqapi-schema += flat-union-int-branch.json
27446e7b706SFam Zhengqapi-schema += flat-union-invalid-branch-key.json
27546e7b706SFam Zhengqapi-schema += flat-union-invalid-discriminator.json
276ccadd6bcSMarc-André Lureauqapi-schema += flat-union-invalid-if-discriminator.json
27746e7b706SFam Zhengqapi-schema += flat-union-no-base.json
27846e7b706SFam Zhengqapi-schema += flat-union-optional-discriminator.json
27946e7b706SFam Zhengqapi-schema += flat-union-string-discriminator.json
28046e7b706SFam Zhengqapi-schema += funny-char.json
2814d428155SMarkus Armbrusterqapi-schema += funny-word.json
28246e7b706SFam Zhengqapi-schema += ident-with-escape.json
28346e7b706SFam Zhengqapi-schema += include-before-err.json
28446e7b706SFam Zhengqapi-schema += include-cycle.json
285bc52d03fSMarkus Armbrusterqapi-schema += include-extra-junk.json
28646e7b706SFam Zhengqapi-schema += include-nested-err.json
28746e7b706SFam Zhengqapi-schema += include-no-file.json
28846e7b706SFam Zhengqapi-schema += include-non-file.json
28946e7b706SFam Zhengqapi-schema += include-repetition.json
29046e7b706SFam Zhengqapi-schema += include-self-cycle.json
29146e7b706SFam Zhengqapi-schema += include-simple.json
29246e7b706SFam Zhengqapi-schema += indented-expr.json
29346e7b706SFam Zhengqapi-schema += leading-comma-list.json
29446e7b706SFam Zhengqapi-schema += leading-comma-object.json
29546e7b706SFam Zhengqapi-schema += missing-colon.json
29646e7b706SFam Zhengqapi-schema += missing-comma-list.json
29746e7b706SFam Zhengqapi-schema += missing-comma-object.json
29846e7b706SFam Zhengqapi-schema += missing-type.json
29946e7b706SFam Zhengqapi-schema += nested-struct-data.json
30087adbbffSMarc-André Lureauqapi-schema += nested-struct-data-invalid-dict.json
30146e7b706SFam Zhengqapi-schema += non-objects.json
3021a1b11dcSPeter Xuqapi-schema += oob-test.json
3037b13f2c2SIgor Mammedovqapi-schema += allow-preconfig-test.json
304bc52d03fSMarkus Armbrusterqapi-schema += pragma-doc-required-crap.json
305bc52d03fSMarkus Armbrusterqapi-schema += pragma-extra-junk.json
3062cfbae3cSMarkus Armbrusterqapi-schema += pragma-name-case-whitelist-crap.json
307bc52d03fSMarkus Armbrusterqapi-schema += pragma-non-dict.json
308137cf6a9SMarkus Armbrusterqapi-schema += pragma-unknown.json
3091554a8faSMarkus Armbrusterqapi-schema += pragma-returns-whitelist-crap.json
31046e7b706SFam Zhengqapi-schema += qapi-schema-test.json
31146e7b706SFam Zhengqapi-schema += quoted-structural-chars.json
31246e7b706SFam Zhengqapi-schema += redefined-builtin.json
31346e7b706SFam Zhengqapi-schema += redefined-command.json
31446e7b706SFam Zhengqapi-schema += redefined-event.json
31546e7b706SFam Zhengqapi-schema += redefined-type.json
31646e7b706SFam Zhengqapi-schema += reserved-command-q.json
31746e7b706SFam Zhengqapi-schema += reserved-enum-q.json
31846e7b706SFam Zhengqapi-schema += reserved-member-has.json
31946e7b706SFam Zhengqapi-schema += reserved-member-q.json
32046e7b706SFam Zhengqapi-schema += reserved-member-u.json
32146e7b706SFam Zhengqapi-schema += reserved-member-underscore.json
32246e7b706SFam Zhengqapi-schema += reserved-type-kind.json
32346e7b706SFam Zhengqapi-schema += reserved-type-list.json
32446e7b706SFam Zhengqapi-schema += returns-alternate.json
32546e7b706SFam Zhengqapi-schema += returns-array-bad.json
32646e7b706SFam Zhengqapi-schema += returns-dict.json
32746e7b706SFam Zhengqapi-schema += returns-unknown.json
32846e7b706SFam Zhengqapi-schema += returns-whitelist.json
32956a8caffSMarkus Armbrusterqapi-schema += string-code-point-31.json
33056a8caffSMarkus Armbrusterqapi-schema += string-code-point-127.json
33146e7b706SFam Zhengqapi-schema += struct-base-clash-deep.json
33246e7b706SFam Zhengqapi-schema += struct-base-clash.json
33346e7b706SFam Zhengqapi-schema += struct-data-invalid.json
334ef91ab0dSMarkus Armbrusterqapi-schema += struct-member-if-invalid.json
33587adbbffSMarc-André Lureauqapi-schema += struct-member-invalid-dict.json
33646e7b706SFam Zhengqapi-schema += struct-member-invalid.json
33746e7b706SFam Zhengqapi-schema += trailing-comma-list.json
33846e7b706SFam Zhengqapi-schema += trailing-comma-object.json
33946e7b706SFam Zhengqapi-schema += type-bypass-bad-gen.json
34046e7b706SFam Zhengqapi-schema += unclosed-list.json
34146e7b706SFam Zhengqapi-schema += unclosed-object.json
34246e7b706SFam Zhengqapi-schema += unclosed-string.json
343707fb2d3SMarkus Armbrusterqapi-schema += union-base-empty.json
34446e7b706SFam Zhengqapi-schema += union-base-no-discriminator.json
34546e7b706SFam Zhengqapi-schema += union-branch-case.json
346ef91ab0dSMarkus Armbrusterqapi-schema += union-branch-if-invalid.json
34787adbbffSMarc-André Lureauqapi-schema += union-branch-invalid-dict.json
34846e7b706SFam Zhengqapi-schema += union-clash-branches.json
34946e7b706SFam Zhengqapi-schema += union-empty.json
35046e7b706SFam Zhengqapi-schema += union-invalid-base.json
35146e7b706SFam Zhengqapi-schema += union-optional-branch.json
35246e7b706SFam Zhengqapi-schema += union-unknown.json
35346e7b706SFam Zhengqapi-schema += unknown-escape.json
35446e7b706SFam Zhengqapi-schema += unknown-expr-key.json
3553313b612SMarc-André Lureau
3563313b612SMarc-André Lureau
35746e7b706SFam Zhengcheck-qapi-schema-y := $(addprefix tests/qapi-schema/, $(qapi-schema))
35846e7b706SFam Zheng
3593dff199cSLaurent Viviergenerated-files-y += tests/test-qapi-types.h
3603dff199cSLaurent Viviergenerated-files-y += tests/include/test-qapi-types-sub-module.h
3613dff199cSLaurent Viviergenerated-files-y += tests/test-qapi-types-sub-sub-module.h
3623dff199cSLaurent Viviergenerated-files-y += tests/test-qapi-visit.h
3633dff199cSLaurent Viviergenerated-files-y += tests/include/test-qapi-visit-sub-module.h
3643dff199cSLaurent Viviergenerated-files-y += tests/test-qapi-visit-sub-sub-module.h
3653dff199cSLaurent Viviergenerated-files-y += tests/test-qapi-commands.h
36600ca24ffSMarkus Armbrustergenerated-files-y += tests/test-qapi-init-commands.h
3673dff199cSLaurent Viviergenerated-files-y += tests/include/test-qapi-commands-sub-module.h
3683dff199cSLaurent Viviergenerated-files-y += tests/test-qapi-commands-sub-sub-module.h
3690cc0e268SMarkus Armbrustergenerated-files-y += tests/test-qapi-emit-events.h
3703dff199cSLaurent Viviergenerated-files-y += tests/test-qapi-events.h
3713dff199cSLaurent Viviergenerated-files-y += tests/include/test-qapi-events-sub-module.h
3723dff199cSLaurent Viviergenerated-files-y += tests/test-qapi-events-sub-sub-module.h
3733dff199cSLaurent Viviergenerated-files-y += tests/test-qapi-introspect.h
37446e7b706SFam Zheng
3751e8a1faeSThomas HuthQEMU_CFLAGS += -I$(SRC_PATH)/tests -I$(SRC_PATH)/tests/qtest
37646e7b706SFam Zheng
37746e7b706SFam Zheng
37846e7b706SFam Zheng# Deps that are common to various different sets of tests below
379ebedb37cSPaolo Bonzinitest-util-obj-y = libqemuutil.a
38046e7b706SFam Zhengtest-qom-obj-y = $(qom-obj-y) $(test-util-obj-y)
381709395f8SMarkus Armbrustertest-qapi-obj-y = tests/test-qapi-types.o \
382709395f8SMarkus Armbruster	tests/include/test-qapi-types-sub-module.o \
383709395f8SMarkus Armbruster	tests/test-qapi-types-sub-sub-module.o \
384709395f8SMarkus Armbruster	tests/test-qapi-visit.o \
385709395f8SMarkus Armbruster	tests/include/test-qapi-visit-sub-module.o \
386709395f8SMarkus Armbruster	tests/test-qapi-visit-sub-sub-module.o \
387a9529100SMarkus Armbruster	tests/test-qapi-introspect.o \
38846e7b706SFam Zheng	$(test-qom-obj-y)
38929de2804SLaurent Vivierbenchmark-crypto-obj-$(CONFIG_BLOCK) = $(authz-obj-y) $(crypto-obj-y) $(test-qom-obj-y)
39029de2804SLaurent Viviertest-crypto-obj-$(CONFIG_BLOCK) = $(authz-obj-y) $(crypto-obj-y) $(test-qom-obj-y)
39129de2804SLaurent Viviertest-io-obj-$(CONFIG_BLOCK) = $(io-obj-y) $(test-crypto-obj-y)
39229de2804SLaurent Viviertest-authz-obj-$(CONFIG_BLOCK) = $(test-qom-obj-y) $(authz-obj-y)
39329de2804SLaurent Viviertest-block-obj-$(CONFIG_BLOCK) = $(block-obj-y) $(test-io-obj-y) tests/iothread.o
39446e7b706SFam Zheng
39501b2ffceSMarc-André Lureautests/check-qnum$(EXESUF): tests/check-qnum.o $(test-util-obj-y)
39646e7b706SFam Zhengtests/check-qstring$(EXESUF): tests/check-qstring.o $(test-util-obj-y)
39746e7b706SFam Zhengtests/check-qdict$(EXESUF): tests/check-qdict.o $(test-util-obj-y)
3980bcc8e5bSMarkus Armbrustertests/check-block-qdict$(EXESUF): tests/check-block-qdict.o $(test-util-obj-y)
39946e7b706SFam Zhengtests/check-qlist$(EXESUF): tests/check-qlist.o $(test-util-obj-y)
40046e7b706SFam Zhengtests/check-qnull$(EXESUF): tests/check-qnull.o $(test-util-obj-y)
4011b76e838SMax Reitztests/check-qobject$(EXESUF): tests/check-qobject.o $(test-util-obj-y)
40246e7b706SFam Zhengtests/check-qjson$(EXESUF): tests/check-qjson.o $(test-util-obj-y)
403382176b4SMarc-André Lureautests/check-qlit$(EXESUF): tests/check-qlit.o $(test-util-obj-y)
40446e7b706SFam Zhengtests/check-qom-interface$(EXESUF): tests/check-qom-interface.o $(test-qom-obj-y)
40546e7b706SFam Zhengtests/check-qom-proplist$(EXESUF): tests/check-qom-proplist.o $(test-qom-obj-y)
406ea3af47dSMarc-André Lureau
4073db9f6a3SThomas Huthtests/test-char$(EXESUF): tests/test-char.o $(test-util-obj-y) $(test-io-obj-y) $(chardev-obj-y) tests/socket-helpers.o
40846e7b706SFam Zhengtests/test-coroutine$(EXESUF): tests/test-coroutine.o $(test-block-obj-y)
40946e7b706SFam Zhengtests/test-aio$(EXESUF): tests/test-aio.o $(test-block-obj-y)
4100c330a73SPaolo Bonzinitests/test-aio-multithread$(EXESUF): tests/test-aio-multithread.o $(test-block-obj-y)
41146e7b706SFam Zhengtests/test-throttle$(EXESUF): tests/test-throttle.o $(test-block-obj-y)
412881cfd17SKevin Wolftests/test-bdrv-drain$(EXESUF): tests/test-bdrv-drain.o $(test-block-obj-y) $(test-util-obj-y)
4132dbfadf6SVladimir Sementsov-Ogievskiytests/test-bdrv-graph-mod$(EXESUF): tests/test-bdrv-graph-mod.o $(test-block-obj-y) $(test-util-obj-y)
4149ef8112aSAlberto Garciatests/test-blockjob$(EXESUF): tests/test-blockjob.o $(test-block-obj-y) $(test-util-obj-y)
41546e7b706SFam Zhengtests/test-blockjob-txn$(EXESUF): tests/test-blockjob-txn.o $(test-block-obj-y) $(test-util-obj-y)
416ad0df3e0SKevin Wolftests/test-block-backend$(EXESUF): tests/test-block-backend.o $(test-block-obj-y) $(test-util-obj-y)
4174720cbeeSKevin Wolftests/test-block-iothread$(EXESUF): tests/test-block-iothread.o $(test-block-obj-y) $(test-util-obj-y)
418aef96d7dSFam Zhengtests/test-image-locking$(EXESUF): tests/test-image-locking.o $(test-block-obj-y) $(test-util-obj-y)
41946e7b706SFam Zhengtests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(test-block-obj-y)
42046e7b706SFam Zhengtests/test-iov$(EXESUF): tests/test-iov.o $(test-util-obj-y)
421a3b52535SVladimir Sementsov-Ogievskiytests/test-hbitmap$(EXESUF): tests/test-hbitmap.o $(test-util-obj-y) $(test-crypto-obj-y)
422ad37f24dSPeter Xutests/test-bitmap$(EXESUF): tests/test-bitmap.o $(test-util-obj-y)
42346e7b706SFam Zhengtests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o
424aa3544c3SJuan Quintelatests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o migration/page_cache.o $(test-util-obj-y)
42505cb8ed5SAlistair Francistests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o $(test-util-obj-y)
42646e7b706SFam Zhengtests/test-int128$(EXESUF): tests/test-int128.o
42746e7b706SFam Zhengtests/rcutorture$(EXESUF): tests/rcutorture.o $(test-util-obj-y)
42846e7b706SFam Zhengtests/test-rcu-list$(EXESUF): tests/test-rcu-list.o $(test-util-obj-y)
42990487e45SEmilio G. Cotatests/test-rcu-simpleq$(EXESUF): tests/test-rcu-simpleq.o $(test-util-obj-y)
430dbf8862aSEmilio G. Cotatests/test-rcu-tailq$(EXESUF): tests/test-rcu-tailq.o $(test-util-obj-y)
4318c3570e3SPaolo Bonzinitests/test-rcu-slist$(EXESUF): tests/test-rcu-slist.o $(test-util-obj-y)
432ff9249b7SEmilio G. Cotatests/test-qdist$(EXESUF): tests/test-qdist.o $(test-util-obj-y)
4331a95404fSEmilio G. Cotatests/test-qht$(EXESUF): tests/test-qht.o $(test-util-obj-y)
434896a9ee9SEmilio G. Cotatests/test-qht-par$(EXESUF): tests/test-qht-par.o tests/qht-bench$(EXESUF) $(test-util-obj-y)
435515864a0SEmilio G. Cotatests/qht-bench$(EXESUF): tests/qht-bench.o $(test-util-obj-y)
436efad6682SRichard Hendersontests/test-bufferiszero$(EXESUF): tests/test-bufferiszero.o $(test-util-obj-y)
437070e3edcSEmilio G. Cotatests/atomic_add-bench$(EXESUF): tests/atomic_add-bench.o $(test-util-obj-y)
43882fdfcbeSEmilio G. Cotatests/atomic64-bench$(EXESUF): tests/atomic64-bench.o $(test-util-obj-y)
43946e7b706SFam Zheng
4403ac1f813SEmilio G. Cotatests/fp/%:
4413ac1f813SEmilio G. Cota	$(MAKE) -C $(dir $@) $(notdir $@)
4423ac1f813SEmilio G. Cota
44346e7b706SFam Zhengtests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o \
44446e7b706SFam Zheng	hw/core/qdev.o hw/core/qdev-properties.o hw/core/hotplug.o\
44546e7b706SFam Zheng	hw/core/bus.o \
446c11256aaSDamien Hedde	hw/core/resettable.o \
44746e7b706SFam Zheng	hw/core/irq.o \
44846e7b706SFam Zheng	hw/core/fw-path-provider.o \
4492f7b92a0SPaolo Bonzini	hw/core/reset.o \
450107b5969SMarc-André Lureau	hw/core/vmstate-if.o \
4510e6934f2SDamien Hedde	hw/core/clock.o hw/core/qdev-clock.o \
45246e7b706SFam Zheng	$(test-qapi-obj-y)
45346e7b706SFam Zhengtests/test-vmstate$(EXESUF): tests/test-vmstate.o \
454576d1abcSJuan Quintela	migration/vmstate.o migration/vmstate-types.o migration/qemu-file.o \
45546e7b706SFam Zheng        migration/qemu-file-channel.o migration/qjson.o \
45646e7b706SFam Zheng	$(test-io-obj-y)
457c2b38b27SPaolo Bonzinitests/test-timed-average$(EXESUF): tests/test-timed-average.o $(test-util-obj-y)
458ebedb37cSPaolo Bonzinitests/test-base64$(EXESUF): tests/test-base64.o $(test-util-obj-y)
4599ee24e98SPaolo Bonzinitests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o hw/core/ptimer.o
46010ae5b30SThomas Huthtests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o $(test-util-obj-y)
46110ae5b30SThomas Huthtests/test-keyval$(EXESUF): tests/test-keyval.o $(test-util-obj-y) $(test-qapi-obj-y)
46210ae5b30SThomas Huthtests/test-write-threshold$(EXESUF): tests/test-write-threshold.o $(test-block-obj-y)
46310ae5b30SThomas Huthtests/test-uuid$(EXESUF): tests/test-uuid.o $(test-util-obj-y)
46410ae5b30SThomas Huthtests/test-qapi-util$(EXESUF): tests/test-qapi-util.o $(test-util-obj-y)
46546e7b706SFam Zheng
46646e7b706SFam Zhengtests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y)
46746e7b706SFam Zheng
468b3110466SChanglong Xietests/test-replication$(EXESUF): tests/test-replication.o $(test-util-obj-y) \
469b3110466SChanglong Xie	$(test-block-obj-y)
470b3110466SChanglong Xie
471fb0bc835SMarkus Armbrustertests/test-qapi-types.c tests/test-qapi-types.h \
472709395f8SMarkus Armbrustertests/include/test-qapi-types-sub-module.c \
473709395f8SMarkus Armbrustertests/include/test-qapi-types-sub-module.h \
474709395f8SMarkus Armbrustertests/test-qapi-types-sub-sub-module.c \
475709395f8SMarkus Armbrustertests/test-qapi-types-sub-sub-module.h \
476fb0bc835SMarkus Armbrustertests/test-qapi-visit.c tests/test-qapi-visit.h \
477709395f8SMarkus Armbrustertests/include/test-qapi-visit-sub-module.c \
478709395f8SMarkus Armbrustertests/include/test-qapi-visit-sub-module.h \
479709395f8SMarkus Armbrustertests/test-qapi-visit-sub-sub-module.c \
480709395f8SMarkus Armbrustertests/test-qapi-visit-sub-sub-module.h \
481eb815e24SMarkus Armbrustertests/test-qapi-commands.h tests/test-qapi-commands.c \
482709395f8SMarkus Armbrustertests/include/test-qapi-commands-sub-module.h \
483709395f8SMarkus Armbrustertests/include/test-qapi-commands-sub-module.c \
484709395f8SMarkus Armbrustertests/test-qapi-commands-sub-sub-module.h \
485709395f8SMarkus Armbrustertests/test-qapi-commands-sub-sub-module.c \
4860cc0e268SMarkus Armbrustertests/test-qapi-emit-events.c tests/test-qapi-emit-events.h \
487eb815e24SMarkus Armbrustertests/test-qapi-events.c tests/test-qapi-events.h \
48800ca24ffSMarkus Armbrustertests/test-qapi-init-commands.c \
48900ca24ffSMarkus Armbrustertests/test-qapi-init-commands.h \
490709395f8SMarkus Armbrustertests/include/test-qapi-events-sub-module.c \
491709395f8SMarkus Armbrustertests/include/test-qapi-events-sub-module.h \
492709395f8SMarkus Armbrustertests/test-qapi-events-sub-sub-module.c \
493709395f8SMarkus Armbrustertests/test-qapi-events-sub-sub-module.h \
494eb815e24SMarkus Armbrustertests/test-qapi-introspect.c tests/test-qapi-introspect.h: \
495fb0bc835SMarkus Armbrustertests/test-qapi-gen-timestamp ;
496709395f8SMarkus Armbrustertests/test-qapi-gen-timestamp: \
497709395f8SMarkus Armbruster		$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json \
498709395f8SMarkus Armbruster		$(SRC_PATH)/tests/qapi-schema/include/sub-module.json \
499709395f8SMarkus Armbruster		$(SRC_PATH)/tests/qapi-schema/sub-sub-module.json \
500709395f8SMarkus Armbruster		$(qapi-py)
5010d6b93deSMatthias Maier	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
502fb0bc835SMarkus Armbruster		-o tests -p "test-" $<, \
503fb0bc835SMarkus Armbruster		"GEN","$(@:%-timestamp=%)")
504f3d4aa5aSMarkus Armbruster	@rm -f tests/test-qapi-doc.texi
505fb0bc835SMarkus Armbruster	@>$@
50646e7b706SFam Zheng
507fb0bc835SMarkus Armbrustertests/qapi-schema/doc-good.test.texi: $(SRC_PATH)/tests/qapi-schema/doc-good.json $(qapi-py)
5080d6b93deSMatthias Maier	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
509fb0bc835SMarkus Armbruster		-o tests/qapi-schema -p "doc-good-" $<, \
510fb0bc835SMarkus Armbruster		"GEN","$@")
511fb0bc835SMarkus Armbruster	@mv tests/qapi-schema/doc-good-qapi-doc.texi $@
512fb0bc835SMarkus Armbruster	@rm -f tests/qapi-schema/doc-good-qapi-*.[ch] tests/qapi-schema/doc-good-qmp-*.[ch]
51380d1f2e4SMarkus Armbruster
5141e8a1faeSThomas Huthtests/qtest/dbus-vmstate1.h tests/qtest/dbus-vmstate1.c: tests/qtest/dbus-vmstate1-gen-timestamp ;
5151e8a1faeSThomas Huthtests/qtest/dbus-vmstate1-gen-timestamp: $(SRC_PATH)/tests/qtest/dbus-vmstate1.xml
516586ca6baSMarc-André Lureau	$(call quiet-command,$(GDBUS_CODEGEN) $< \
5171e8a1faeSThomas Huth		--interface-prefix org.qemu --generate-c-code tests/qtest/dbus-vmstate1, \
518586ca6baSMarc-André Lureau		"GEN","$(@:%-timestamp=%)")
519586ca6baSMarc-André Lureau	@>$@
520586ca6baSMarc-André Lureau
5211e8a1faeSThomas Huthtests/qtest/dbus-vmstate-test.o-cflags := -DSRCDIR="$(SRC_PATH)"
5221e8a1faeSThomas Huthtests/qtest/dbus-vmstate1.o-cflags := $(GIO_CFLAGS)
5231e8a1faeSThomas Huthtests/qtest/dbus-vmstate1.o-libs := $(GIO_LIBS)
524586ca6baSMarc-André Lureau
5251e8a1faeSThomas Huthtests/qtest/dbus-vmstate-test.o: tests/qtest/dbus-vmstate1.h
526586ca6baSMarc-André Lureau
52746e7b706SFam Zhengtests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y)
52846e7b706SFam Zhengtests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y)
5290cc0e268SMarkus Armbrustertests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y) tests/test-qapi-emit-events.o tests/test-qapi-events.o
530b3db211fSDaniel P. Berrangetests/test-qobject-output-visitor$(EXESUF): tests/test-qobject-output-visitor.o $(test-qapi-obj-y)
531a15fcc3cSEric Blaketests/test-clone-visitor$(EXESUF): tests/test-clone-visitor.o $(test-qapi-obj-y)
532b3db211fSDaniel P. Berrangetests/test-qobject-input-visitor$(EXESUF): tests/test-qobject-input-visitor.o $(test-qapi-obj-y)
53300ca24ffSMarkus Armbrustertests/test-qmp-cmds$(EXESUF): tests/test-qmp-cmds.o tests/test-qapi-commands.o tests/test-qapi-init-commands.o $(test-qapi-obj-y)
53446e7b706SFam Zhengtests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y)
53546e7b706SFam Zhengtests/test-opts-visitor$(EXESUF): tests/test-opts-visitor.o $(test-qapi-obj-y)
53646e7b706SFam Zheng
537f539fbe3SJose Ricardo Zivianitests/test-shift128$(EXESUF): tests/test-shift128.o $(test-util-obj-y)
53846e7b706SFam Zhengtests/test-mul64$(EXESUF): tests/test-mul64.o $(test-util-obj-y)
53946e7b706SFam Zhengtests/test-bitops$(EXESUF): tests/test-bitops.o $(test-util-obj-y)
540c3f8962fSAlex Bennéetests/test-bitcnt$(EXESUF): tests/test-bitcnt.o $(test-util-obj-y)
54146e7b706SFam Zhengtests/test-crypto-hash$(EXESUF): tests/test-crypto-hash.o $(test-crypto-obj-y)
5420128cd29SLongpeng(Mike)tests/benchmark-crypto-hash$(EXESUF): tests/benchmark-crypto-hash.o $(test-crypto-obj-y)
5434fd460bfSLongpeng(Mike)tests/test-crypto-hmac$(EXESUF): tests/test-crypto-hmac.o $(test-crypto-obj-y)
544c7a9af4bSLongpeng(Mike)tests/benchmark-crypto-hmac$(EXESUF): tests/benchmark-crypto-hmac.o $(test-crypto-obj-y)
54546e7b706SFam Zhengtests/test-crypto-cipher$(EXESUF): tests/test-crypto-cipher.o $(test-crypto-obj-y)
5461efd9d5eSLongpeng(Mike)tests/benchmark-crypto-cipher$(EXESUF): tests/benchmark-crypto-cipher.o $(test-crypto-obj-y)
54746e7b706SFam Zhengtests/test-crypto-secret$(EXESUF): tests/test-crypto-secret.o $(test-crypto-obj-y)
54846e7b706SFam Zhengtests/test-crypto-xts$(EXESUF): tests/test-crypto-xts.o $(test-crypto-obj-y)
54946e7b706SFam Zheng
55092500362SAlexey Krasikovifeq ($(CONFIG_TEST_SECRET_KEYRING),y)
55192500362SAlexey Krasikovtests/test-crypto-secret.o-libs := -lkeyutils
55292500362SAlexey Krasikovendif
55392500362SAlexey Krasikov
55446e7b706SFam Zhengtests/crypto-tls-x509-helpers.o-cflags := $(TASN1_CFLAGS)
55546e7b706SFam Zhengtests/crypto-tls-x509-helpers.o-libs := $(TASN1_LIBS)
55646e7b706SFam Zhengtests/pkix_asn1_tab.o-cflags := $(TASN1_CFLAGS)
55746e7b706SFam Zheng
55846e7b706SFam Zhengtests/test-crypto-tlscredsx509.o-cflags := $(TASN1_CFLAGS)
55946e7b706SFam Zhengtests/test-crypto-tlscredsx509$(EXESUF): tests/test-crypto-tlscredsx509.o \
56046e7b706SFam Zheng	tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y)
56146e7b706SFam Zheng
56246e7b706SFam Zhengtests/test-crypto-tlssession.o-cflags := $(TASN1_CFLAGS)
56346e7b706SFam Zhengtests/test-crypto-tlssession$(EXESUF): tests/test-crypto-tlssession.o \
564e1a6dc91SRichard W.M. Jones	tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o \
565e1a6dc91SRichard W.M. Jones	tests/crypto-tls-psk-helpers.o \
566e1a6dc91SRichard W.M. Jones        $(test-crypto-obj-y)
56790e33dfeSDaniel P. Berrangétests/test-util-filemonitor$(EXESUF): tests/test-util-filemonitor.o \
56890e33dfeSDaniel P. Berrangé	$(test-util-obj-y)
56958dc31f1SDaniel P. Berrangetests/test-util-sockets$(EXESUF): tests/test-util-sockets.o \
57058dc31f1SDaniel P. Berrange	tests/socket-helpers.o $(test-util-obj-y)
571fb5c4ebcSDaniel P. Berrangétests/test-authz-simple$(EXESUF): tests/test-authz-simple.o $(test-authz-obj-y)
572c8c99887SDaniel P. Berrangetests/test-authz-list$(EXESUF): tests/test-authz-list.o $(test-authz-obj-y)
57355d86984SDaniel P. Berrangétests/test-authz-listfile$(EXESUF): tests/test-authz-listfile.o $(test-authz-obj-y)
5748953caf3SDaniel P. Berrangetests/test-authz-pam$(EXESUF): tests/test-authz-pam.o $(test-authz-obj-y)
57546e7b706SFam Zhengtests/test-io-task$(EXESUF): tests/test-io-task.o $(test-io-obj-y)
57646e7b706SFam Zhengtests/test-io-channel-socket$(EXESUF): tests/test-io-channel-socket.o \
5779b589ffbSDaniel P. Berrange        tests/io-channel-helpers.o tests/socket-helpers.o $(test-io-obj-y)
57846e7b706SFam Zhengtests/test-io-channel-file$(EXESUF): tests/test-io-channel-file.o \
57946e7b706SFam Zheng        tests/io-channel-helpers.o $(test-io-obj-y)
58046e7b706SFam Zhengtests/test-io-channel-tls$(EXESUF): tests/test-io-channel-tls.o \
58146e7b706SFam Zheng	tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o \
58246e7b706SFam Zheng	tests/io-channel-helpers.o $(test-io-obj-y)
58346e7b706SFam Zhengtests/test-io-channel-command$(EXESUF): tests/test-io-channel-command.o \
58446e7b706SFam Zheng        tests/io-channel-helpers.o $(test-io-obj-y)
58546e7b706SFam Zhengtests/test-io-channel-buffer$(EXESUF): tests/test-io-channel-buffer.o \
58646e7b706SFam Zheng        tests/io-channel-helpers.o $(test-io-obj-y)
58746e7b706SFam Zhengtests/test-crypto-pbkdf$(EXESUF): tests/test-crypto-pbkdf.o $(test-crypto-obj-y)
58846e7b706SFam Zhengtests/test-crypto-ivgen$(EXESUF): tests/test-crypto-ivgen.o $(test-crypto-obj-y)
58946e7b706SFam Zhengtests/test-crypto-afsplit$(EXESUF): tests/test-crypto-afsplit.o $(test-crypto-obj-y)
59046e7b706SFam Zhengtests/test-crypto-block$(EXESUF): tests/test-crypto-block.o $(test-crypto-obj-y)
59146e7b706SFam Zheng
592409437e1SDaniel P. Berrangetests/migration/stress$(EXESUF): tests/migration/stress.o
5930bdb12c7SPeter Maydell	$(call quiet-command, $(LINKPROG) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"LINK","$(TARGET_DIR)$@")
594409437e1SDaniel P. Berrange
595409437e1SDaniel P. BerrangeINITRD_WORK_DIR=tests/migration/initrd
596409437e1SDaniel P. Berrange
597409437e1SDaniel P. Berrangetests/migration/initrd-stress.img: tests/migration/stress$(EXESUF)
598409437e1SDaniel P. Berrange	mkdir -p $(INITRD_WORK_DIR)
599409437e1SDaniel P. Berrange	cp $< $(INITRD_WORK_DIR)/init
600409437e1SDaniel P. Berrange	(cd $(INITRD_WORK_DIR) && (find | cpio --quiet -o -H newc | gzip -9)) > $@
601409437e1SDaniel P. Berrange	rm $(INITRD_WORK_DIR)/init
602409437e1SDaniel P. Berrange	rmdir $(INITRD_WORK_DIR)
603409437e1SDaniel P. Berrange
604833884f3SThomas Huthinclude $(SRC_PATH)/tests/qtest/Makefile.include
60546e7b706SFam Zheng
606*f15bff25SPaolo Bonzinitests/test-qga$(EXESUF): qga/qemu-ga$(EXESUF)
6074be75077SPhilippe Mathieu-Daudétests/test-qga$(EXESUF): tests/test-qga.o $(qtest-obj-y)
6084eb38726SDr. David Alan Gilberttests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o $(test-util-obj-y) libvhost-user.a
6096e1da96bSPhilippe Mathieu-Daudétests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o
61046e7b706SFam Zheng
61146e7b706SFam ZhengSPEED = quick
61246e7b706SFam Zheng
61346e7b706SFam Zheng# gtester tests, possibly with verbose output
6149df43317SPaolo Bonzini# do_test_tap runs all tests, even if some of them fail, while do_test_human
6159df43317SPaolo Bonzini# stops at the first failure unless -k is given on the command line
6169df43317SPaolo Bonzini
6179df43317SPaolo Bonzinidefine do_test_human_k
6189df43317SPaolo Bonzini        $(quiet-@)rc=0; $(foreach COMMAND, $1, \
6199df43317SPaolo Bonzini          $(call quiet-command-run, \
6209df43317SPaolo Bonzini            export MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} $2; \
6219df43317SPaolo Bonzini              $(COMMAND) -m=$(SPEED) -k --tap < /dev/null \
6229df43317SPaolo Bonzini              | ./scripts/tap-driver.pl --test-name="$(notdir $(COMMAND))" $(if $(V),, --show-failures-only) \
6239df43317SPaolo Bonzini              || rc=$$?;, "TEST", "$@: $(COMMAND)")) exit $$rc
6249df43317SPaolo Bonziniendef
6259df43317SPaolo Bonzinidefine do_test_human_no_k
6269df43317SPaolo Bonzini        $(foreach COMMAND, $1, \
6279df43317SPaolo Bonzini          $(call quiet-command, \
6289df43317SPaolo Bonzini            MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} $2 \
6299df43317SPaolo Bonzini              $(COMMAND) -m=$(SPEED) -k --tap < /dev/null \
6309df43317SPaolo Bonzini              | ./scripts/tap-driver.pl --test-name="$(notdir $(COMMAND))" $(if $(V),, --show-failures-only), \
6319df43317SPaolo Bonzini              "TEST", "$@: $(COMMAND)")
6329df43317SPaolo Bonzini)
6339df43317SPaolo Bonziniendef
6349df43317SPaolo Bonzinido_test_human = \
6359df43317SPaolo Bonzini        $(if $(findstring k, $(MAKEFLAGS)), $(do_test_human_k), $(do_test_human_no_k))
6369df43317SPaolo Bonzini
6379df43317SPaolo Bonzinidefine do_test_tap
6389df43317SPaolo Bonzini	$(call quiet-command, \
6399df43317SPaolo Bonzini          { export MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} $2; \
6409df43317SPaolo Bonzini            $(foreach COMMAND, $1, \
6419df43317SPaolo Bonzini	      $(COMMAND) -m=$(SPEED) -k --tap < /dev/null \
6423bcb5840SHavard Skinnemoen	      | sed "s/^\(not \)\?ok [0-9]* /&$(notdir $(COMMAND)) /" || true; ) } \
6439df43317SPaolo Bonzini	      | ./scripts/tap-merge.pl | tee "$@" \
6449df43317SPaolo Bonzini	      | ./scripts/tap-driver.pl $(if $(V),, --show-failures-only), \
6459df43317SPaolo Bonzini	  "TAP","$@")
6469df43317SPaolo Bonziniendef
64746e7b706SFam Zheng
64846e7b706SFam Zheng.PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS))
6493b8593eeSMarkus Armbruster$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: %-softmmu/all $(check-qtest-y)
6501e8a1faeSThomas Huth	$(call do_test_human,$(check-qtest-$*-y:%=tests/qtest/%$(EXESUF)) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)), \
6519df43317SPaolo Bonzini	  QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
6529df43317SPaolo Bonzini	  QTEST_QEMU_IMG=qemu-img$(EXESUF))
65346e7b706SFam Zheng
654a6eeac3bSAlex Bennéebuild-qtest: $(patsubst %, %-softmmu/all, $(QTEST_TARGETS)) $(check-qtest-y)
655a6eeac3bSAlex Bennée
656a6eeac3bSAlex Bennéebuild-unit: $(check-unit-y)
657a6eeac3bSAlex Bennée
6589df43317SPaolo Bonzinicheck-unit: $(check-unit-y)
6599df43317SPaolo Bonzini	$(call do_test_human, $^)
66046e7b706SFam Zheng
6619df43317SPaolo Bonzinicheck-speed: $(check-speed-y)
6629df43317SPaolo Bonzini	$(call do_test_human, $^)
66346e7b706SFam Zheng
6649df43317SPaolo Bonzini# gtester tests with TAP output
66546e7b706SFam Zheng
6663b8593eeSMarkus Armbruster$(patsubst %, check-report-qtest-%.tap, $(QTEST_TARGETS)): check-report-qtest-%.tap: %-softmmu/all $(check-qtest-y)
6671e8a1faeSThomas Huth	$(call do_test_tap, $(check-qtest-$*-y:%=tests/qtest/%$(EXESUF)) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)), \
6689df43317SPaolo Bonzini	  QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
6699df43317SPaolo Bonzini	  QTEST_QEMU_IMG=qemu-img$(EXESUF))
6709df43317SPaolo Bonzini
6719df43317SPaolo Bonzinicheck-report-unit.tap: $(check-unit-y)
6729df43317SPaolo Bonzini	$(call do_test_tap,$^)
67346e7b706SFam Zheng
67446e7b706SFam Zheng# Reports and overall runs
67546e7b706SFam Zheng
6769df43317SPaolo Bonzinicheck-report.tap: $(patsubst %,check-report-qtest-%.tap, $(QTEST_TARGETS)) check-report-unit.tap
67746e7b706SFam Zheng
6782cade3d7SAlex Bennée# FPU Emulation tests (aka softfloat)
6792cade3d7SAlex Bennée#
6802cade3d7SAlex Bennée# As we still have some places that need fixing the rules are a little
6812cade3d7SAlex Bennée# more complex than they need to be and have to override some of the
6822cade3d7SAlex Bennée# generic Makefile expansions. Once we are cleanly passing all
6832cade3d7SAlex Bennée# the tests we can simplify the make syntax.
6842cade3d7SAlex Bennée
6852cade3d7SAlex BennéeFP_TEST_BIN=$(BUILD_DIR)/tests/fp/fp-test
6862cade3d7SAlex Bennée
6872cade3d7SAlex Bennée# the build dir is created by configure
6883618e3a6SAlex Bennée$(FP_TEST_BIN): config-host.h $(test-util-obj-y)
6892cade3d7SAlex Bennée	$(call quiet-command, \
6902cade3d7SAlex Bennée	 	$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" $(notdir $@), \
6912cade3d7SAlex Bennée	         "BUILD", "$(notdir $@)")
6922cade3d7SAlex Bennée
6932cade3d7SAlex Bennée# The full test suite can take a bit of time, default to a quick run
6944f575c08SAlex Bennée# "-l 2 -r all" can take more than a day for some operations and is best
6954f575c08SAlex Bennée# run manually
696bf30e866SAlex BennéeFP_TL=-l 1 -r all
6972cade3d7SAlex Bennée
698bf30e866SAlex Bennée# $1 = tests, $2 = description, $3 = test flags
6992cade3d7SAlex Bennéetest-softfloat = $(call quiet-command, \
7002cade3d7SAlex Bennée			cd $(BUILD_DIR)/tests/fp && \
701bf30e866SAlex Bennée			./fp-test -s $(if $3,$3,$(FP_TL)) $1 > $2.out 2>&1 || \
7022cade3d7SAlex Bennée			(cat $2.out && exit 1;), \
7032cade3d7SAlex Bennée			"FLOAT TEST", $2)
7042cade3d7SAlex Bennée
7058281a157SAlex Bennée# Conversion Routines: Float to Float
7068281a157SAlex Bennée# FIXME: f32_to_f128 (broken), f64_to_f128 (broken)
7078281a157SAlex Bennée# FIXME: f128_to_f32(broken), f128_to_f64 (broken)
7088281a157SAlex Bennée# FIXME: f128_to_extF80 (broken)
7098281a157SAlex Bennéecheck-softfloat-conv-f2f: $(FP_TEST_BIN)
7108281a157SAlex Bennée	$(call test-softfloat, \
7118281a157SAlex Bennée		f16_to_f32 f16_to_f64 \
7128281a157SAlex Bennée		f16_to_extF80 f16_to_f128 \
7138281a157SAlex Bennée		f32_to_f16 f32_to_f64 \
7148281a157SAlex Bennée		f32_to_extF80 \
7158281a157SAlex Bennée		f64_to_f16 f64_to_f32 \
7168281a157SAlex Bennée		extF80_to_f16 extF80_to_f32 \
7178281a157SAlex Bennée		extF80_to_f64 extF80_to_f128 \
7188281a157SAlex Bennée		f128_to_f16, \
7198281a157SAlex Bennée		float-to-float)
7208281a157SAlex Bennée
7218281a157SAlex Bennée# Conversion Routines: Int and Uint to Float
7222cade3d7SAlex Bennée# FIXME: i32_to_extF80 (broken), i64_to_extF80 (broken)
7238281a157SAlex Bennée#        ui32_to_f128 (not implemented)
7248281a157SAlex Bennéecheck-softfloat-conv-to-float: $(FP_TEST_BIN)
7252cade3d7SAlex Bennée	$(call test-softfloat, \
7262cade3d7SAlex Bennée		i32_to_f16 i64_to_f16 \
7272cade3d7SAlex Bennée		i32_to_f32 i64_to_f32 \
7282cade3d7SAlex Bennée		i32_to_f64 i64_to_f64 \
7292cade3d7SAlex Bennée		i32_to_f128 i64_to_f128, int-to-float)
7302cade3d7SAlex Bennée	$(call test-softfloat, \
7312cade3d7SAlex Bennée		ui32_to_f16 ui64_to_f16 \
7322cade3d7SAlex Bennée		ui32_to_f32 ui64_to_f32 \
7332cade3d7SAlex Bennée		ui32_to_f64 ui64_to_f64 \
7348281a157SAlex Bennée		ui32_to_extF80 ui64_to_extF80 \
7352cade3d7SAlex Bennée		ui64_to_f128, uint-to-float)
7368281a157SAlex Bennée
7378281a157SAlex Bennée# Conversion Routines: Float to integers
7388281a157SAlex Bennée# FIXME: extF80_roundToInt (broken)
7398281a157SAlex Bennéecheck-softfloat-conv-to-int: $(FP_TEST_BIN)
7402cade3d7SAlex Bennée	$(call test-softfloat, \
7412cade3d7SAlex Bennée		f16_to_i32 f16_to_i32_r_minMag \
7422cade3d7SAlex Bennée		f32_to_i32 f32_to_i32_r_minMag \
7432cade3d7SAlex Bennée		f64_to_i32 f64_to_i32_r_minMag \
7442cade3d7SAlex Bennée		extF80_to_i32 extF80_to_i32_r_minMag \
7452cade3d7SAlex Bennée		f128_to_i32 f128_to_i32_r_minMag \
7462cade3d7SAlex Bennée		f16_to_i64 f16_to_i64_r_minMag \
7472cade3d7SAlex Bennée		f32_to_i64 f32_to_i64_r_minMag \
7482cade3d7SAlex Bennée		f64_to_i64 f64_to_i64_r_minMag \
7492cade3d7SAlex Bennée		extF80_to_i64 extF80_to_i64_r_minMag \
7502cade3d7SAlex Bennée		f128_to_i64 f128_to_i64_r_minMag, \
7512cade3d7SAlex Bennée		float-to-int)
7522cade3d7SAlex Bennée	$(call test-softfloat, \
7532cade3d7SAlex Bennée		f16_to_ui32 f16_to_ui32_r_minMag \
7542cade3d7SAlex Bennée		f32_to_ui32 f32_to_ui32_r_minMag \
7552cade3d7SAlex Bennée		f64_to_ui32 f64_to_ui32_r_minMag \
7568281a157SAlex Bennée		extF80_to_ui32 extF80_to_ui32_r_minMag \
757dc3f8a9dSAlex Bennée		f128_to_ui32 f128_to_ui32_r_minMag \
7582cade3d7SAlex Bennée		f16_to_ui64 f16_to_ui64_r_minMag \
7592cade3d7SAlex Bennée		f32_to_ui64 f32_to_ui64_r_minMag \
760dc3f8a9dSAlex Bennée		f64_to_ui64 f64_to_ui64_r_minMag \
7618281a157SAlex Bennée		extF80_to_ui64 extF80_to_ui64_r_minMag \
762dc3f8a9dSAlex Bennée		f128_to_ui64 f128_to_ui64_r_minMag, \
7632cade3d7SAlex Bennée		float-to-uint)
7642cade3d7SAlex Bennée	$(call test-softfloat, \
7652cade3d7SAlex Bennée		f16_roundToInt f32_roundToInt \
7662cade3d7SAlex Bennée		f64_roundToInt f128_roundToInt, \
7672cade3d7SAlex Bennée		round-to-integer)
7682cade3d7SAlex Bennée
7698281a157SAlex Bennée.PHONY: check-softfloat-conv
7708281a157SAlex Bennéecheck-softfloat-conv: check-softfloat-conv-f2f
7718281a157SAlex Bennéecheck-softfloat-conv: check-softfloat-conv-to-float
7728281a157SAlex Bennéecheck-softfloat-conv: check-softfloat-conv-to-int
7738281a157SAlex Bennée
7742cade3d7SAlex Bennée# Generic rule for all float operations
7752cade3d7SAlex Bennée#
7768281a157SAlex Bennée# Some patterns are overridden due to broken or missing tests.
7772cade3d7SAlex Bennée# Hopefully these can be removed over time.
7782cade3d7SAlex Bennée
7792cade3d7SAlex Bennéecheck-softfloat-%: $(FP_TEST_BIN)
7802cade3d7SAlex Bennée	$(call test-softfloat, f16_$* f32_$* f64_$* extF80_$* f128_$*, $*)
7812cade3d7SAlex Bennée
7822cade3d7SAlex Bennée# Float Compare routines
7832cade3d7SAlex BennéeSF_COMPARE_OPS=eq eq_signaling le le_quiet lt_quiet
7842cade3d7SAlex BennéeSF_COMPARE_RULES=$(patsubst %,check-softfloat-%, $(SF_COMPARE_OPS))
7852cade3d7SAlex Bennée
7862cade3d7SAlex Bennée# FIXME: extF80_lt_quiet (broken)
7872cade3d7SAlex Bennéecheck-softfloat-lt_quiet: $(FP_TEST_BIN)
7882cade3d7SAlex Bennée	$(call test-softfloat, 				\
7892cade3d7SAlex Bennée		f16_lt_quiet f32_lt_quiet f64_lt_quiet  \
7902cade3d7SAlex Bennée		f128_lt_quiet, 				\
7912cade3d7SAlex Bennée		lt_quiet)
7922cade3d7SAlex Bennée
7932cade3d7SAlex Bennée.PHONY: check-softfloat-compare
7942cade3d7SAlex Bennéecheck-softfloat-compare: $(SF_COMPARE_RULES)
7952cade3d7SAlex Bennée
7962cade3d7SAlex Bennée# Math Operations
7972cade3d7SAlex Bennée
7982cade3d7SAlex Bennée# FIXME: extF80_mulAdd (missing)
7992cade3d7SAlex Bennéecheck-softfloat-mulAdd: $(FP_TEST_BIN)
8002cade3d7SAlex Bennée	$(call test-softfloat, \
8012cade3d7SAlex Bennée		f16_mulAdd f32_mulAdd f64_mulAdd f128_mulAdd, \
802bf30e866SAlex Bennée		mulAdd,-l 1)
8032cade3d7SAlex Bennée
8042cade3d7SAlex Bennée# FIXME: extF80_rem (broken)
8052cade3d7SAlex Bennéecheck-softfloat-rem: $(FP_TEST_BIN)
8062cade3d7SAlex Bennée	$(call test-softfloat, \
8072cade3d7SAlex Bennée		f16_rem f32_rem f64_rem f128_rem, \
8082cade3d7SAlex Bennée		rem)
8092cade3d7SAlex Bennée
8102cade3d7SAlex BennéeSF_MATH_OPS=add sub mul mulAdd div rem sqrt
8112cade3d7SAlex BennéeSF_MATH_RULES=$(patsubst %,check-softfloat-%, $(SF_MATH_OPS))
8122cade3d7SAlex Bennée
8132cade3d7SAlex Bennée.PHONY: check-softfloat-ops
8142cade3d7SAlex Bennéecheck-softfloat-ops: $(SF_MATH_RULES)
8152cade3d7SAlex Bennée
81676170102SAlex Bennée# Finally a generic rule to test all of softfoat. If TCG isnt't
81776170102SAlex Bennée# enabled we define a null operation which skips the tests.
81876170102SAlex Bennée
81976170102SAlex Bennée.PHONY: check-softfloat
82076170102SAlex Bennéeifeq ($(CONFIG_TCG),y)
821a6eeac3bSAlex Bennéebuild-softfloat: $(FP_TEST_BIN)
822a6eeac3bSAlex Bennéecheck-softfloat: build-softfloat check-softfloat-conv check-softfloat-compare check-softfloat-ops
82376170102SAlex Bennéeelse
824a6eeac3bSAlex Bennéebuild-softfloat check-softfloat:
82576170102SAlex Bennée	$(call quiet-command, /bin/true, "FLOAT TEST", \
82676170102SAlex Bennée		"SKIPPED for non-TCG builds")
82776170102SAlex Bennéeendif
82876170102SAlex Bennée
8293089e74eSAlex Bennée# Plugins
8303089e74eSAlex Bennéeifeq ($(CONFIG_PLUGIN),y)
8313089e74eSAlex Bennée.PHONY: plugins
8323089e74eSAlex Bennéeplugins:
8333089e74eSAlex Bennée	$(call quiet-command,\
8343089e74eSAlex Bennée		$(MAKE) $(SUBDIR_MAKEFLAGS) -C tests/plugin V="$(V)", \
8353089e74eSAlex Bennée		"BUILD", "plugins")
8363089e74eSAlex Bennéeendif
8373089e74eSAlex Bennée
8388ba0a820SAlex Bennée# Per guest TCG tests
8398ba0a820SAlex Bennée
840e24e66f0SAlex BennéeBUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS))
841e24e66f0SAlex BennéeCLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TARGET_DIRS))
842e24e66f0SAlex BennéeRUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TARGET_DIRS))
8438ba0a820SAlex Bennée
8441a7fab92SAlex Bennée# Probe for the Docker Builds needed for each build
8452b1f35b9SAlex Bennée$(foreach PROBE_TARGET,$(TARGET_DIRS), 				\
846fc76c56dSPaolo Bonzini	$(eval -include $(SRC_PATH)/tests/tcg/Makefile.prereqs))
8471a7fab92SAlex Bennée
8483089e74eSAlex Bennéebuild-tcg-tests-%: $(if $(CONFIG_PLUGIN),plugins)
849fc76c56dSPaolo Bonzini	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
850fc76c56dSPaolo Bonzini		-f $(SRC_PATH)/tests/tcg/Makefile.qemu \
851fc76c56dSPaolo Bonzini		SRC_PATH=$(SRC_PATH) \
8522038f8c8SPaolo Bonzini	       	V="$(V)" TARGET="$*" guest-tests, \
853cff54773SAlex Bennée		"BUILD", "TCG tests for $*")
8548ba0a820SAlex Bennée
855fc76c56dSPaolo Bonzinirun-tcg-tests-%: build-tcg-tests-% %/all
856fc76c56dSPaolo Bonzini	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
857fc76c56dSPaolo Bonzini		-f $(SRC_PATH)/tests/tcg/Makefile.qemu \
858fc76c56dSPaolo Bonzini		SRC_PATH=$(SRC_PATH) SPEED="$(SPEED)" \
8592038f8c8SPaolo Bonzini		V="$(V)" TARGET="$*" run-guest-tests, \
860cff54773SAlex Bennée		"RUN", "TCG tests for $*")
8618ba0a820SAlex Bennée
8628ba0a820SAlex Bennéeclean-tcg-tests-%:
863fc76c56dSPaolo Bonzini	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
864fc76c56dSPaolo Bonzini		-f $(SRC_PATH)/tests/tcg/Makefile.qemu \
8652038f8c8SPaolo Bonzini		SRC_PATH=$(SRC_PATH) TARGET="$*" clean-guest-tests, \
866dda60da3SAlex Bennée		"CLEAN", "TCG tests for $*")
8678ba0a820SAlex Bennée
8688ba0a820SAlex Bennée.PHONY: build-tcg
8698ba0a820SAlex Bennéebuild-tcg: $(BUILD_TCG_TARGET_RULES)
8708ba0a820SAlex Bennée
8718ba0a820SAlex Bennée.PHONY: check-tcg
872df2bb38eSAlex Bennéecheck-tcg: $(RUN_TCG_TARGET_RULES)
8738ba0a820SAlex Bennée
8748ba0a820SAlex Bennée.PHONY: clean-tcg
8758ba0a820SAlex Bennéeclean-tcg: $(CLEAN_TCG_TARGET_RULES)
87646e7b706SFam Zheng
87746e7b706SFam Zheng# Other tests
87846e7b706SFam Zheng
879206d1b9cSLaurent VivierQEMU_IOTESTS_HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = tests/qemu-iotests/socket_scm_helper$(EXESUF)
88046e7b706SFam Zheng
881bdd95e47SThomas Huth.PHONY: check-tests/check-block.sh
882bdd95e47SThomas Huthcheck-tests/check-block.sh: tests/check-block.sh qemu-img$(EXESUF) \
883bdd95e47SThomas Huth		qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) \
884bdd95e47SThomas Huth		$(patsubst %,%/all,$(filter %-softmmu,$(TARGET_DIRS)))
8853fb643c3SThomas Huth	@$<
88646e7b706SFam Zheng
887f01338ccSMarkus Armbruster.PHONY: check-tests/qapi-schema/frontend
888f01338ccSMarkus Armbrustercheck-tests/qapi-schema/frontend: $(addprefix $(SRC_PATH)/, $(check-qapi-schema-y))
88946e7b706SFam Zheng	$(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts \
890f01338ccSMarkus Armbruster	  PYTHONIOENCODING=utf-8 $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py $^, \
891f01338ccSMarkus Armbruster	  TEST, check-qapi-schema)
89246e7b706SFam Zheng
89380d1f2e4SMarkus Armbruster.PHONY: check-tests/qapi-schema/doc-good.texi
89480d1f2e4SMarkus Armbrustercheck-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi
89502e3092dSEric Blake	@diff -u $(SRC_PATH)/tests/qapi-schema/doc-good.texi $<
89680d1f2e4SMarkus Armbruster
897568ae7efSRichard Henderson.PHONY: check-decodetree
898568ae7efSRichard Hendersoncheck-decodetree:
899568ae7efSRichard Henderson	$(call quiet-command, \
900568ae7efSRichard Henderson	  cd $(SRC_PATH)/tests/decode && \
901568ae7efSRichard Henderson          ./check.sh "$(PYTHON)" "$(SRC_PATH)/scripts/decodetree.py", \
902568ae7efSRichard Henderson          TEST, decodetree.py)
903568ae7efSRichard Henderson
90421313721SCleber Rosa# Python venv for running tests
90521313721SCleber Rosa
906a56931eeSCleber Rosa.PHONY: check-venv check-acceptance
90721313721SCleber Rosa
90821313721SCleber RosaTESTS_VENV_DIR=$(BUILD_DIR)/tests/venv
90921313721SCleber RosaTESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt
910a56931eeSCleber RosaTESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
911a56931eeSCleber Rosa# Controls the output generated by Avocado when running tests.
912a56931eeSCleber Rosa# Any number of command separated loggers are accepted.  For more
913a56931eeSCleber Rosa# information please refer to "avocado --help".
91459692a12SCleber RosaAVOCADO_SHOW=app
915b194713fSCleber RosaAVOCADO_TAGS=$(patsubst %-softmmu,-t arch:%, $(filter %-softmmu,$(TARGET_DIRS)))
91621313721SCleber Rosa
91721313721SCleber Rosa$(TESTS_VENV_DIR): $(TESTS_VENV_REQ)
91821313721SCleber Rosa	$(call quiet-command, \
91921313721SCleber Rosa            $(PYTHON) -m venv --system-site-packages $@, \
92021313721SCleber Rosa            VENV, $@)
92121313721SCleber Rosa	$(call quiet-command, \
92221313721SCleber Rosa            $(TESTS_VENV_DIR)/bin/python -m pip -q install -r $(TESTS_VENV_REQ), \
92321313721SCleber Rosa            PIP, $(TESTS_VENV_REQ))
92421313721SCleber Rosa	$(call quiet-command, touch $@)
92521313721SCleber Rosa
926a56931eeSCleber Rosa$(TESTS_RESULTS_DIR):
927a56931eeSCleber Rosa	$(call quiet-command, mkdir -p $@, \
928a56931eeSCleber Rosa            MKDIR, $@)
929a56931eeSCleber Rosa
93021313721SCleber Rosacheck-venv: $(TESTS_VENV_DIR)
93121313721SCleber Rosa
9324ec49f0fSCleber RosaFEDORA_31_ARCHES_CANDIDATES=$(patsubst ppc64,ppc64le,$(TARGETS))
9334ec49f0fSCleber RosaFEDORA_31_ARCHES := x86_64 aarch64 ppc64le s390x
9344ec49f0fSCleber RosaFEDORA_31_DOWNLOAD=$(filter $(FEDORA_31_ARCHES),$(FEDORA_31_ARCHES_CANDIDATES))
9354ec49f0fSCleber Rosa
9364ec49f0fSCleber Rosa# download one specific Fedora 31 image
9374ec49f0fSCleber Rosaget-vm-image-fedora-31-%: check-venv
9384ec49f0fSCleber Rosa	$(call quiet-command, \
9394ec49f0fSCleber Rosa             $(TESTS_VENV_DIR)/bin/python -m avocado vmimage get \
9404ec49f0fSCleber Rosa             --distro=fedora --distro-version=31 --arch=$*, \
9414ec49f0fSCleber Rosa	"AVOCADO", "Downloading acceptance tests VM image for $*")
9424ec49f0fSCleber Rosa
9434ec49f0fSCleber Rosa# download all vm images, according to defined targets
9444ec49f0fSCleber Rosaget-vm-images: check-venv $(patsubst %,get-vm-image-fedora-31-%, $(FEDORA_31_DOWNLOAD))
9454ec49f0fSCleber Rosa
9464ec49f0fSCleber Rosacheck-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
947a56931eeSCleber Rosa	$(call quiet-command, \
948a56931eeSCleber Rosa            $(TESTS_VENV_DIR)/bin/python -m avocado \
949a56931eeSCleber Rosa            --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
950b194713fSCleber Rosa            --filter-by-tags-include-empty --filter-by-tags-include-empty-key \
951b194713fSCleber Rosa            $(AVOCADO_TAGS) \
952c5008c76SAlex Bennée            $(if $(GITLAB_CI),,--failfast=on) tests/acceptance, \
953a56931eeSCleber Rosa            "AVOCADO", "tests/acceptance")
954a56931eeSCleber Rosa
95546e7b706SFam Zheng# Consolidated targets
95646e7b706SFam Zheng
9574ec49f0fSCleber Rosa.PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean get-vm-images
958f01338ccSMarkus Armbrustercheck-qapi-schema: check-tests/qapi-schema/frontend check-tests/qapi-schema/doc-good.texi
95946e7b706SFam Zhengcheck-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
960ee6fe053SMarc-André Lureauifeq ($(CONFIG_TOOLS),y)
96146e7b706SFam Zhengcheck-block: $(patsubst %,check-%, $(check-block-y))
962ee6fe053SMarc-André Lureauendif
963a6eeac3bSAlex Bennéecheck-build: build-unit build-softfloat build-qtest
964a6eeac3bSAlex Bennée
96546e7b706SFam Zhengcheck-clean:
9661e8a1faeSThomas Huth	rm -rf $(check-unit-y) tests/*.o tests/*/*.o $(QEMU_IOTESTS_HELPERS-y)
9671e8a1faeSThomas Huth	rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y:%=tests/qtest/%$(EXESUF))) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)))
968fb0bc835SMarkus Armbruster	rm -f tests/test-qapi-gen-timestamp
9691e8a1faeSThomas Huth	rm -f tests/qtest/dbus-vmstate1-gen-timestamp
970a56931eeSCleber Rosa	rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR)
97146e7b706SFam Zheng
972a6eeac3bSAlex Bennéecheck: check-block check-qapi-schema check-unit check-softfloat check-qtest check-decodetree
973a6eeac3bSAlex Bennée
97446e7b706SFam Zhengclean: check-clean
97546e7b706SFam Zheng
97646e7b706SFam Zheng# Build the help program automatically
97746e7b706SFam Zheng
97846e7b706SFam Zhengall: $(QEMU_IOTESTS_HELPERS-y)
97946e7b706SFam Zheng
98046e7b706SFam Zheng-include $(wildcard tests/*.d)
9811e8a1faeSThomas Huth-include $(wildcard tests/qtest/*.d)
982ab00cf4dSThomas Huth-include $(wildcard tests/qtest/libqos/*.d)
983e45eaef9SFam Zheng
984e45eaef9SFam Zhengendif
985