]> git.proxmox.com Git - mirror_qemu.git/blame - tests/Makefile.include
test: Move qtests to a separate directory
[mirror_qemu.git] / tests / Makefile.include
CommitLineData
3b8593ee 1# -*- Mode: makefile -*-
e45eaef9
FZ
2
3.PHONY: check-help
4check-help:
5 @echo "Regression testing targets:"
6 @echo
54f96b45
CR
7 @echo " $(MAKE) check Run unit, qapi-schema, qtest and decodetree"
8 @echo
b98a3bae
PMD
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"
8ba0a820 15 @echo " $(MAKE) check-tcg Run TCG tests"
76170102 16 @echo " $(MAKE) check-softfloat Run FPU emulation tests"
a56931ee 17 @echo " $(MAKE) check-acceptance Run all acceptance (functional) tests"
54f96b45 18 @echo
c3088cd3 19 @echo " $(MAKE) check-report.tap Generates an aggregated TAP test report"
21313721 20 @echo " $(MAKE) check-venv Creates a Python venv for tests"
54f96b45 21 @echo " $(MAKE) check-clean Clean the tests and related data"
e45eaef9 22 @echo
e45eaef9
FZ
23 @echo
24 @echo "The variable SPEED can be set to control the gtester speed setting."
b98a3bae 25 @echo "Default options are -k and (for $(MAKE) V=1) --verbose; they can be"
e45eaef9
FZ
26 @echo "changed with variable GTESTER_OPTIONS."
27
28ifneq ($(wildcard config-host.mak),)
8959449b
KW
29export SRC_PATH
30
fb0bc835 31# TODO don't duplicate $(SRC_PATH)/Makefile's qapi-py here
e6c42b96
MA
32qapi-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 \
fb0bc835 37$(SRC_PATH)/scripts/qapi/events.py \
e6c42b96
MA
38$(SRC_PATH)/scripts/qapi/expr.py \
39$(SRC_PATH)/scripts/qapi/gen.py \
fb0bc835 40$(SRC_PATH)/scripts/qapi/introspect.py \
e6c42b96
MA
41$(SRC_PATH)/scripts/qapi/parser.py \
42$(SRC_PATH)/scripts/qapi/schema.py \
43$(SRC_PATH)/scripts/qapi/source.py \
fb0bc835
MA
44$(SRC_PATH)/scripts/qapi/types.py \
45$(SRC_PATH)/scripts/qapi/visit.py \
fb0bc835 46$(SRC_PATH)/scripts/qapi-gen.py
b124533e 47
3687d532
PM
48# Get the list of all supported sysemu targets
49SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
50 $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak)))
51
7a6c377f 52check-unit-y += tests/check-qdict$(EXESUF)
992159c7 53check-unit-y += tests/check-block-qdict$(EXESUF)
29de2804 54check-unit-$(CONFIG_SOFTMMU) += tests/test-char$(EXESUF)
01b2ffce 55check-unit-y += tests/check-qnum$(EXESUF)
b93b63f5
PB
56check-unit-y += tests/check-qstring$(EXESUF)
57check-unit-y += tests/check-qlist$(EXESUF)
7d7a337e 58check-unit-y += tests/check-qnull$(EXESUF)
1b76e838 59check-unit-y += tests/check-qobject$(EXESUF)
b93b63f5 60check-unit-y += tests/check-qjson$(EXESUF)
382176b4 61check-unit-y += tests/check-qlit$(EXESUF)
b3db211f 62check-unit-y += tests/test-qobject-output-visitor$(EXESUF)
a15fcc3c 63check-unit-y += tests/test-clone-visitor$(EXESUF)
b3db211f 64check-unit-y += tests/test-qobject-input-visitor$(EXESUF)
834a3f34 65check-unit-y += tests/test-qmp-cmds$(EXESUF)
b93b63f5
PB
66check-unit-y += tests/test-string-input-visitor$(EXESUF)
67check-unit-y += tests/test-string-output-visitor$(EXESUF)
f6dadb02 68check-unit-y += tests/test-qmp-event$(EXESUF)
3953e3a5 69check-unit-y += tests/test-opts-visitor$(EXESUF)
29de2804 70check-unit-$(CONFIG_BLOCK) += tests/test-coroutine$(EXESUF)
2d496105 71check-unit-y += tests/test-visitor-serialization$(EXESUF)
2278a69e 72check-unit-y += tests/test-iov$(EXESUF)
ad37f24d 73check-unit-y += tests/test-bitmap$(EXESUF)
29de2804
LV
74check-unit-$(CONFIG_BLOCK) += tests/test-aio$(EXESUF)
75check-unit-$(CONFIG_BLOCK) += tests/test-aio-multithread$(EXESUF)
76check-unit-$(CONFIG_BLOCK) += tests/test-throttle$(EXESUF)
77check-unit-$(CONFIG_BLOCK) += tests/test-thread-pool$(EXESUF)
78check-unit-$(CONFIG_BLOCK) += tests/test-hbitmap$(EXESUF)
79check-unit-$(CONFIG_BLOCK) += tests/test-bdrv-drain$(EXESUF)
80check-unit-$(CONFIG_BLOCK) += tests/test-bdrv-graph-mod$(EXESUF)
81check-unit-$(CONFIG_BLOCK) += tests/test-blockjob$(EXESUF)
82check-unit-$(CONFIG_BLOCK) += tests/test-blockjob-txn$(EXESUF)
83check-unit-$(CONFIG_BLOCK) += tests/test-block-backend$(EXESUF)
84check-unit-$(CONFIG_BLOCK) += tests/test-block-iothread$(EXESUF)
85check-unit-$(CONFIG_BLOCK) += tests/test-image-locking$(EXESUF)
247c9de1
EH
86check-unit-y += tests/test-x86-cpuid$(EXESUF)
87# all code tested by test-x86-cpuid is inside topology.h
60fe637b 88ifeq ($(CONFIG_SOFTMMU),y)
21e3cd29 89check-unit-y += tests/test-xbzrle$(EXESUF)
60fe637b
DDAG
90check-unit-$(CONFIG_POSIX) += tests/test-vmstate$(EXESUF)
91endif
e3f9fe2d 92check-unit-y += tests/test-cutils$(EXESUF)
f539fbe3 93check-unit-y += tests/test-shift128$(EXESUF)
f4c0f986 94check-unit-y += tests/test-mul64$(EXESUF)
6046c620
PB
95check-unit-y += tests/test-int128$(EXESUF)
96# all code tested by test-int128 is inside int128.h
8fda74a5 97check-unit-y += tests/rcutorture$(EXESUF)
341774fe 98check-unit-y += tests/test-rcu-list$(EXESUF)
90487e45 99check-unit-y += tests/test-rcu-simpleq$(EXESUF)
dbf8862a 100check-unit-y += tests/test-rcu-tailq$(EXESUF)
ff9249b7 101check-unit-y += tests/test-qdist$(EXESUF)
1a95404f 102check-unit-y += tests/test-qht$(EXESUF)
a36270a4 103check-unit-y += tests/test-qht-par$(EXESUF)
3464700f 104check-unit-y += tests/test-bitops$(EXESUF)
c3f8962f 105check-unit-y += tests/test-bitcnt$(EXESUF)
692fbdf9 106check-unit-y += tests/test-qdev-global-props$(EXESUF)
14389dbd 107check-unit-y += tests/check-qom-interface$(EXESUF)
a31bdae5 108check-unit-y += tests/check-qom-proplist$(EXESUF)
4ba6fabf 109check-unit-y += tests/test-qemu-opts$(EXESUF)
d454dbe0 110check-unit-y += tests/test-keyval$(EXESUF)
29de2804
LV
111check-unit-$(CONFIG_BLOCK) += tests/test-write-threshold$(EXESUF)
112check-unit-$(CONFIG_BLOCK) += tests/test-crypto-hash$(EXESUF)
113check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-hash$(EXESUF)
114check-unit-$(CONFIG_BLOCK) += tests/test-crypto-hmac$(EXESUF)
115check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-hmac$(EXESUF)
116check-unit-$(CONFIG_BLOCK) += tests/test-crypto-cipher$(EXESUF)
117check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-cipher$(EXESUF)
118check-unit-$(CONFIG_BLOCK) += tests/test-crypto-secret$(EXESUF)
119check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-crypto-tlscredsx509$(EXESUF)
120check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-crypto-tlssession$(EXESUF)
fb91f30b 121ifneq (,$(findstring qemu-ga,$(TOOLS)))
a9d2e3f1 122check-unit-$(call land,$(CONFIG_LINUX),$(CONFIG_VIRTIO_SERIAL)) += tests/test-qga$(EXESUF)
fb91f30b 123endif
bd797fc1 124check-unit-y += tests/test-timed-average$(EXESUF)
90e33dfe 125check-unit-$(CONFIG_INOTIFY1) += tests/test-util-filemonitor$(EXESUF)
58dc31f1 126check-unit-y += tests/test-util-sockets$(EXESUF)
29de2804
LV
127check-unit-$(CONFIG_BLOCK) += tests/test-authz-simple$(EXESUF)
128check-unit-$(CONFIG_BLOCK) += tests/test-authz-list$(EXESUF)
129check-unit-$(CONFIG_BLOCK) += tests/test-authz-listfile$(EXESUF)
130check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_AUTH_PAM)) += tests/test-authz-pam$(EXESUF)
131check-unit-$(CONFIG_BLOCK) += tests/test-io-task$(EXESUF)
132check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-socket$(EXESUF)
133check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-file$(EXESUF)
134check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-io-channel-tls$(EXESUF)
135check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-command$(EXESUF)
136check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-buffer$(EXESUF)
89bc0b6c 137check-unit-y += tests/test-base64$(EXESUF)
29de2804
LV
138check-unit-$(call land,$(CONFIG_BLOCK),$(if $(CONFIG_NETTLE),y,$(CONFIG_GCRYPT))) += tests/test-crypto-pbkdf$(EXESUF)
139check-unit-$(CONFIG_BLOCK) += tests/test-crypto-ivgen$(EXESUF)
140check-unit-$(CONFIG_BLOCK) += tests/test-crypto-afsplit$(EXESUF)
4e89ed19 141check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_QEMU_PRIVATE_XTS)) += tests/test-crypto-xts$(EXESUF)
29de2804 142check-unit-$(CONFIG_BLOCK) += tests/test-crypto-block$(EXESUF)
3514552e 143check-unit-y += tests/test-logging$(EXESUF)
29de2804 144check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_REPLICATION)) += tests/test-replication$(EXESUF)
efad6682 145check-unit-y += tests/test-bufferiszero$(EXESUF)
c739cddd 146check-unit-y += tests/test-uuid$(EXESUF)
24b94625 147check-unit-y += tests/ptimer-test$(EXESUF)
6c873d11 148check-unit-y += tests/test-qapi-util$(EXESUF)
b93b63f5 149
bdd95e47 150check-block-$(call land,$(CONFIG_POSIX),$(CONFIG_SOFTMMU)) += tests/check-block.sh
b93b63f5 151
d1aaf543
AL
152# All QTests for now are POSIX-only, but the dependencies are
153# really in libqtest, not in the testcases themselves.
a21baf79 154
55e997a7
TH
155check-qtest-generic-y += qmp-test
156check-qtest-generic-y += qmp-cmd-test
157check-qtest-generic-$(CONFIG_MODULES) += modules-test
158
159check-qtest-generic-y += device-introspect-test
160check-qtest-generic-y += cdrom-test
d93bb9d5 161
586ca6ba
MAL
162DBUS_DAEMON := $(shell which dbus-daemon 2>/dev/null)
163ifneq ($(GDBUS_CODEGEN),)
164ifneq ($(DBUS_DAEMON),)
55e997a7 165check-qtest-pci-$(CONFIG_GIO) += dbus-vmstate-test
586ca6ba
MAL
166endif
167endif
e253c287 168
55e997a7
TH
169check-qtest-pci-$(CONFIG_RTL8139_PCI) += rtl8139-test
170check-qtest-pci-$(CONFIG_VGA) += display-vga-test
171check-qtest-pci-$(CONFIG_HDA) += intel-hda-test
172check-qtest-pci-$(CONFIG_IVSHMEM_DEVICE) += ivshmem-test
173
174check-qtest-i386-$(CONFIG_ISA_TESTDEV) = endianness-test
175check-qtest-i386-y += fdc-test
176check-qtest-i386-y += ide-test
177check-qtest-i386-$(CONFIG_TOOLS) += ahci-test
178check-qtest-i386-y += hd-geo-test
179check-qtest-i386-y += boot-order-test
180check-qtest-i386-y += bios-tables-test
181check-qtest-i386-$(CONFIG_SGA) += boot-serial-test
182check-qtest-i386-$(CONFIG_SLIRP) += pxe-test
183check-qtest-i386-y += rtc-test
184check-qtest-i386-$(CONFIG_ISA_IPMI_KCS) += ipmi-kcs-test
860eacec 185ifdef CONFIG_LINUX
55e997a7 186check-qtest-i386-$(CONFIG_ISA_IPMI_BT) += ipmi-bt-test
860eacec 187endif
55e997a7
TH
188check-qtest-i386-y += i440fx-test
189check-qtest-i386-y += fw_cfg-test
190check-qtest-i386-y += device-plug-test
191check-qtest-i386-y += drive_del-test
192check-qtest-i386-$(CONFIG_WDT_IB700) += wdt_ib700-test
193check-qtest-i386-y += tco-test
a21baf79 194check-qtest-i386-y += $(check-qtest-pci-y)
55e997a7
TH
195check-qtest-i386-$(CONFIG_PVPANIC) += pvpanic-test
196check-qtest-i386-$(CONFIG_I82801B11) += i82801b11-test
197check-qtest-i386-$(CONFIG_IOH3420) += ioh3420-test
198check-qtest-i386-$(CONFIG_USB_UHCI) += usb-hcd-uhci-test
199check-qtest-i386-$(call land,$(CONFIG_USB_EHCI),$(CONFIG_USB_UHCI)) += usb-hcd-ehci-test
200check-qtest-i386-$(CONFIG_USB_XHCI_NEC) += usb-hcd-xhci-test
201check-qtest-i386-y += cpu-plug-test
202check-qtest-i386-y += q35-test
203check-qtest-i386-y += vmgenid-test
204check-qtest-i386-$(CONFIG_TPM_CRB) += tpm-crb-swtpm-test
205check-qtest-i386-$(CONFIG_TPM_CRB) += tpm-crb-test
206check-qtest-i386-$(CONFIG_TPM_TIS) += tpm-tis-swtpm-test
207check-qtest-i386-$(CONFIG_TPM_TIS) += tpm-tis-test
208check-qtest-i386-$(CONFIG_SLIRP) += test-netfilter
209check-qtest-i386-$(CONFIG_POSIX) += test-filter-mirror
210check-qtest-i386-$(CONFIG_RTL8139_PCI) += test-filter-redirector
211check-qtest-i386-y += migration-test
212check-qtest-i386-y += test-x86-cpuid-compat
213check-qtest-i386-y += numa-test
214
0ee2e9da 215check-qtest-x86_64-y += $(check-qtest-i386-y)
29531542 216
55e997a7
TH
217check-qtest-alpha-y += boot-serial-test
218check-qtest-alpha-$(CONFIG_VGA) += display-vga-test
d2ab58ff 219
55e997a7
TH
220check-qtest-hppa-y += boot-serial-test
221check-qtest-hppa-$(CONFIG_VGA) += display-vga-test
3ff6dd47 222
55e997a7 223check-qtest-m68k-y = boot-serial-test
598a29f3 224
55e997a7 225check-qtest-microblaze-y += boot-serial-test
acf53766 226
55e997a7
TH
227check-qtest-mips-$(CONFIG_ISA_TESTDEV) = endianness-test
228check-qtest-mips-$(CONFIG_VGA) += display-vga-test
c9324bf5 229
55e997a7
TH
230check-qtest-mips64-$(CONFIG_ISA_TESTDEV) = endianness-test
231check-qtest-mips64-$(CONFIG_VGA) += display-vga-test
c9324bf5 232
55e997a7
TH
233check-qtest-mips64el-$(CONFIG_ISA_TESTDEV) = endianness-test
234check-qtest-mips64el-$(CONFIG_VGA) += display-vga-test
c9324bf5 235
55e997a7 236check-qtest-moxie-y += boot-serial-test
7244edf2 237
55e997a7
TH
238check-qtest-ppc-$(CONFIG_ISA_TESTDEV) = endianness-test
239check-qtest-ppc-y += boot-order-test
240check-qtest-ppc-y += prom-env-test
241check-qtest-ppc-y += drive_del-test
242check-qtest-ppc-y += boot-serial-test
243check-qtest-ppc-$(CONFIG_M48T59) += m48t59-test
29531542 244
7a6c377f 245check-qtest-ppc64-y += $(check-qtest-ppc-y)
55e997a7
TH
246check-qtest-ppc64-$(CONFIG_PSERIES) += device-plug-test
247check-qtest-ppc64-$(CONFIG_POWERNV) += pnv-xscom-test
248check-qtest-ppc64-y += migration-test
249check-qtest-ppc64-$(CONFIG_PSERIES) += rtas-test
250check-qtest-ppc64-$(CONFIG_SLIRP) += pxe-test
251check-qtest-ppc64-$(CONFIG_USB_UHCI) += usb-hcd-uhci-test
252check-qtest-ppc64-$(CONFIG_USB_XHCI_NEC) += usb-hcd-xhci-test
253check-qtest-ppc64-$(CONFIG_SLIRP) += test-netfilter
254check-qtest-ppc64-$(CONFIG_POSIX) += test-filter-mirror
255check-qtest-ppc64-$(CONFIG_RTL8139_PCI) += test-filter-redirector
256check-qtest-ppc64-$(CONFIG_VGA) += display-vga-test
257check-qtest-ppc64-y += numa-test
258check-qtest-ppc64-$(CONFIG_IVSHMEM_DEVICE) += ivshmem-test
259check-qtest-ppc64-y += cpu-plug-test
260
261check-qtest-sh4-$(CONFIG_ISA_TESTDEV) = endianness-test
262
263check-qtest-sh4eb-$(CONFIG_ISA_TESTDEV) = endianness-test
264
265check-qtest-sparc-y += prom-env-test
266check-qtest-sparc-y += m48t59-test
267check-qtest-sparc-y += boot-serial-test
268
269check-qtest-sparc64-$(CONFIG_ISA_TESTDEV) = endianness-test
270check-qtest-sparc64-y += prom-env-test
271check-qtest-sparc64-y += boot-serial-test
272
273check-qtest-arm-y += arm-cpu-features
274check-qtest-arm-y += microbit-test
275check-qtest-arm-y += m25p80-test
276check-qtest-arm-y += test-arm-mptimer
277check-qtest-arm-y += boot-serial-test
278check-qtest-arm-y += hexloader-test
279check-qtest-arm-$(CONFIG_PFLASH_CFI02) += pflash-cfi02-test
280
281check-qtest-aarch64-y += arm-cpu-features
282check-qtest-aarch64-y += numa-test
283check-qtest-aarch64-y += boot-serial-test
284check-qtest-aarch64-y += migration-test
285
ab6b6a77
IM
286# TODO: once aarch64 TCG is fixed on ARM 32 bit host, make test unconditional
287ifneq ($(ARCH),arm)
55e997a7 288check-qtest-aarch64-y += bios-tables-test
ab6b6a77 289endif
63baf8bf 290
7a6c377f 291check-qtest-microblazeel-y += $(check-qtest-microblaze-y)
29531542 292
7a6c377f 293check-qtest-xtensaeb-y += $(check-qtest-xtensa-y)
d1aaf543 294
55e997a7
TH
295check-qtest-s390x-y = boot-serial-test
296check-qtest-s390x-$(CONFIG_SLIRP) += pxe-test
297check-qtest-s390x-$(CONFIG_SLIRP) += test-netfilter
298check-qtest-s390x-$(CONFIG_POSIX) += test-filter-mirror
299check-qtest-s390x-$(CONFIG_POSIX) += test-filter-redirector
300check-qtest-s390x-y += drive_del-test
301check-qtest-s390x-y += device-plug-test
302check-qtest-s390x-y += virtio-ccw-test
303check-qtest-s390x-y += cpu-plug-test
304check-qtest-s390x-y += migration-test
305
306check-qtest-generic-y += machine-none-test
307check-qtest-generic-y += qom-test
308check-qtest-generic-y += test-hmp
3687d532 309
46534309 310qapi-schema += alternate-any.json
1ffe818a
EB
311qapi-schema += alternate-array.json
312qapi-schema += alternate-base.json
ef91ab0d 313qapi-schema += alternate-branch-if-invalid.json
1ffe818a
EB
314qapi-schema += alternate-clash.json
315qapi-schema += alternate-conflict-dict.json
c0644771
MA
316qapi-schema += alternate-conflict-enum-bool.json
317qapi-schema += alternate-conflict-enum-int.json
1ffe818a 318qapi-schema += alternate-conflict-string.json
fda72ab4
EH
319qapi-schema += alternate-conflict-bool-string.json
320qapi-schema += alternate-conflict-num-string.json
8d25dd10 321qapi-schema += alternate-empty.json
87adbbff 322qapi-schema += alternate-invalid-dict.json
1ffe818a
EB
323qapi-schema += alternate-nested.json
324qapi-schema += alternate-unknown.json
325qapi-schema += args-alternate.json
326qapi-schema += args-any.json
327qapi-schema += args-array-empty.json
328qapi-schema += args-array-unknown.json
c818408e
EB
329qapi-schema += args-bad-boxed.json
330qapi-schema += args-boxed-anon.json
c818408e 331qapi-schema += args-boxed-string.json
1ffe818a
EB
332qapi-schema += args-int.json
333qapi-schema += args-invalid.json
334qapi-schema += args-member-array-bad.json
893e1f2c 335qapi-schema += args-member-case.json
1ffe818a 336qapi-schema += args-member-unknown.json
d220fbcd 337qapi-schema += args-name-clash.json
1ffe818a
EB
338qapi-schema += args-union.json
339qapi-schema += args-unknown.json
340qapi-schema += bad-base.json
341qapi-schema += bad-data.json
342qapi-schema += bad-ident.json
967c8851
MAL
343qapi-schema += bad-if.json
344qapi-schema += bad-if-empty.json
345qapi-schema += bad-if-empty-list.json
346qapi-schema += bad-if-list.json
1ffe818a
EB
347qapi-schema += bad-type-bool.json
348qapi-schema += bad-type-dict.json
349qapi-schema += bad-type-int.json
bac5429c
EB
350qapi-schema += base-cycle-direct.json
351qapi-schema += base-cycle-indirect.json
1ffe818a
EB
352qapi-schema += command-int.json
353qapi-schema += comments.json
f641d06a 354qapi-schema += doc-bad-alternate-member.json
717cfcfa 355qapi-schema += doc-bad-boxed-command-arg.json
bdc001ca 356qapi-schema += doc-bad-command-arg.json
f035b47e 357qapi-schema += doc-bad-enum-member.json
717cfcfa 358qapi-schema += doc-bad-event-arg.json
f035b47e 359qapi-schema += doc-bad-feature.json
cfa438ff 360qapi-schema += doc-bad-section.json
3313b612 361qapi-schema += doc-bad-symbol.json
f641d06a 362qapi-schema += doc-bad-union-member.json
2028be8e
MA
363qapi-schema += doc-before-include.json
364qapi-schema += doc-before-pragma.json
3313b612
MAL
365qapi-schema += doc-duplicated-arg.json
366qapi-schema += doc-duplicated-return.json
367qapi-schema += doc-duplicated-since.json
368qapi-schema += doc-empty-arg.json
369qapi-schema += doc-empty-section.json
370qapi-schema += doc-empty-symbol.json
80d1f2e4 371qapi-schema += doc-good.json
3313b612
MAL
372qapi-schema += doc-interleaved-section.json
373qapi-schema += doc-invalid-end.json
374qapi-schema += doc-invalid-end2.json
375qapi-schema += doc-invalid-return.json
376qapi-schema += doc-invalid-section.json
377qapi-schema += doc-invalid-start.json
378qapi-schema += doc-missing-colon.json
379qapi-schema += doc-missing-expr.json
380qapi-schema += doc-missing-space.json
cfa438ff 381qapi-schema += doc-missing.json
2028be8e 382qapi-schema += doc-no-symbol.json
f035b47e 383qapi-schema += doc-undoc-feature.json
1ffe818a
EB
384qapi-schema += double-type.json
385qapi-schema += duplicate-key.json
386qapi-schema += empty.json
ea738b21 387qapi-schema += enum-bad-member.json
1ffe818a
EB
388qapi-schema += enum-bad-name.json
389qapi-schema += enum-bad-prefix.json
390qapi-schema += enum-clash-member.json
ea738b21 391qapi-schema += enum-dict-member-unknown.json
6cc32b0e 392qapi-schema += enum-if-invalid.json
1ffe818a 393qapi-schema += enum-int-member.json
893e1f2c 394qapi-schema += enum-member-case.json
1ffe818a 395qapi-schema += enum-missing-data.json
1ffe818a 396qapi-schema += enum-wrong-data.json
c818408e 397qapi-schema += event-boxed-empty.json
1ffe818a 398qapi-schema += event-case.json
87adbbff 399qapi-schema += event-member-invalid-dict.json
1ffe818a 400qapi-schema += event-nest-struct.json
a00af404
KW
401qapi-schema += features-bad-type.json
402qapi-schema += features-duplicate-name.json
ef91ab0d 403qapi-schema += features-if-invalid.json
a00af404
KW
404qapi-schema += features-missing-name.json
405qapi-schema += features-name-bad-type.json
406qapi-schema += features-no-list.json
407qapi-schema += features-unknown-key.json
1ffe818a
EB
408qapi-schema += flat-union-array-branch.json
409qapi-schema += flat-union-bad-base.json
410qapi-schema += flat-union-bad-discriminator.json
411qapi-schema += flat-union-base-any.json
412qapi-schema += flat-union-base-union.json
d220fbcd 413qapi-schema += flat-union-clash-member.json
cd346bdc 414qapi-schema += flat-union-discriminator-bad-name.json
8d25dd10 415qapi-schema += flat-union-empty.json
1ffe818a 416qapi-schema += flat-union-inline.json
87adbbff 417qapi-schema += flat-union-inline-invalid-dict.json
1ffe818a
EB
418qapi-schema += flat-union-int-branch.json
419qapi-schema += flat-union-invalid-branch-key.json
420qapi-schema += flat-union-invalid-discriminator.json
ccadd6bc 421qapi-schema += flat-union-invalid-if-discriminator.json
1ffe818a
EB
422qapi-schema += flat-union-no-base.json
423qapi-schema += flat-union-optional-discriminator.json
1ffe818a
EB
424qapi-schema += flat-union-string-discriminator.json
425qapi-schema += funny-char.json
4d428155 426qapi-schema += funny-word.json
1ffe818a
EB
427qapi-schema += ident-with-escape.json
428qapi-schema += include-before-err.json
429qapi-schema += include-cycle.json
bc52d03f 430qapi-schema += include-extra-junk.json
1ffe818a
EB
431qapi-schema += include-nested-err.json
432qapi-schema += include-no-file.json
433qapi-schema += include-non-file.json
1ffe818a
EB
434qapi-schema += include-repetition.json
435qapi-schema += include-self-cycle.json
436qapi-schema += include-simple.json
437qapi-schema += indented-expr.json
438qapi-schema += leading-comma-list.json
439qapi-schema += leading-comma-object.json
440qapi-schema += missing-colon.json
441qapi-schema += missing-comma-list.json
442qapi-schema += missing-comma-object.json
443qapi-schema += missing-type.json
444qapi-schema += nested-struct-data.json
87adbbff 445qapi-schema += nested-struct-data-invalid-dict.json
1ffe818a 446qapi-schema += non-objects.json
1a1b11dc 447qapi-schema += oob-test.json
7b13f2c2 448qapi-schema += allow-preconfig-test.json
bc52d03f
MA
449qapi-schema += pragma-doc-required-crap.json
450qapi-schema += pragma-extra-junk.json
2cfbae3c 451qapi-schema += pragma-name-case-whitelist-crap.json
bc52d03f 452qapi-schema += pragma-non-dict.json
137cf6a9 453qapi-schema += pragma-unknown.json
1554a8fa 454qapi-schema += pragma-returns-whitelist-crap.json
1ffe818a
EB
455qapi-schema += qapi-schema-test.json
456qapi-schema += quoted-structural-chars.json
457qapi-schema += redefined-builtin.json
458qapi-schema += redefined-command.json
459qapi-schema += redefined-event.json
460qapi-schema += redefined-type.json
19767083 461qapi-schema += reserved-command-q.json
59a92fee 462qapi-schema += reserved-enum-q.json
19767083
EB
463qapi-schema += reserved-member-has.json
464qapi-schema += reserved-member-q.json
5e59baf9 465qapi-schema += reserved-member-u.json
59a92fee 466qapi-schema += reserved-member-underscore.json
19767083
EB
467qapi-schema += reserved-type-kind.json
468qapi-schema += reserved-type-list.json
1ffe818a
EB
469qapi-schema += returns-alternate.json
470qapi-schema += returns-array-bad.json
471qapi-schema += returns-dict.json
1ffe818a
EB
472qapi-schema += returns-unknown.json
473qapi-schema += returns-whitelist.json
56a8caff
MA
474qapi-schema += string-code-point-31.json
475qapi-schema += string-code-point-127.json
1ffe818a
EB
476qapi-schema += struct-base-clash-deep.json
477qapi-schema += struct-base-clash.json
478qapi-schema += struct-data-invalid.json
ef91ab0d 479qapi-schema += struct-member-if-invalid.json
87adbbff 480qapi-schema += struct-member-invalid-dict.json
1ffe818a
EB
481qapi-schema += struct-member-invalid.json
482qapi-schema += trailing-comma-list.json
483qapi-schema += trailing-comma-object.json
484qapi-schema += type-bypass-bad-gen.json
485qapi-schema += unclosed-list.json
486qapi-schema += unclosed-object.json
487qapi-schema += unclosed-string.json
707fb2d3 488qapi-schema += union-base-empty.json
1ffe818a 489qapi-schema += union-base-no-discriminator.json
893e1f2c 490qapi-schema += union-branch-case.json
ef91ab0d 491qapi-schema += union-branch-if-invalid.json
87adbbff 492qapi-schema += union-branch-invalid-dict.json
d220fbcd 493qapi-schema += union-clash-branches.json
8d25dd10 494qapi-schema += union-empty.json
1ffe818a 495qapi-schema += union-invalid-base.json
1ffe818a
EB
496qapi-schema += union-optional-branch.json
497qapi-schema += union-unknown.json
498qapi-schema += unknown-escape.json
499qapi-schema += unknown-expr-key.json
3313b612
MAL
500
501
1ffe818a 502check-qapi-schema-y := $(addprefix tests/qapi-schema/, $(qapi-schema))
98626572 503
3dff199c
LV
504generated-files-y += tests/test-qapi-types.h
505generated-files-y += tests/include/test-qapi-types-sub-module.h
506generated-files-y += tests/test-qapi-types-sub-sub-module.h
507generated-files-y += tests/test-qapi-visit.h
508generated-files-y += tests/include/test-qapi-visit-sub-module.h
509generated-files-y += tests/test-qapi-visit-sub-sub-module.h
510generated-files-y += tests/test-qapi-commands.h
511generated-files-y += tests/include/test-qapi-commands-sub-module.h
512generated-files-y += tests/test-qapi-commands-sub-sub-module.h
513generated-files-y += tests/test-qapi-events.h
514generated-files-y += tests/include/test-qapi-events-sub-module.h
515generated-files-y += tests/test-qapi-events-sub-sub-module.h
516generated-files-y += tests/test-qapi-introspect.h
b93b63f5 517
1e8a1fae 518QEMU_CFLAGS += -I$(SRC_PATH)/tests -I$(SRC_PATH)/tests/qtest
b93b63f5 519
b124533e
DB
520
521# Deps that are common to various different sets of tests below
ebedb37c 522test-util-obj-y = libqemuutil.a
0c7012e0 523test-qom-obj-y = $(qom-obj-y) $(test-util-obj-y)
709395f8
MA
524test-qapi-obj-y = tests/test-qapi-types.o \
525 tests/include/test-qapi-types-sub-module.o \
526 tests/test-qapi-types-sub-sub-module.o \
527 tests/test-qapi-visit.o \
528 tests/include/test-qapi-visit-sub-module.o \
529 tests/test-qapi-visit-sub-sub-module.o \
a9529100 530 tests/test-qapi-introspect.o \
b124533e 531 $(test-qom-obj-y)
29de2804
LV
532benchmark-crypto-obj-$(CONFIG_BLOCK) = $(authz-obj-y) $(crypto-obj-y) $(test-qom-obj-y)
533test-crypto-obj-$(CONFIG_BLOCK) = $(authz-obj-y) $(crypto-obj-y) $(test-qom-obj-y)
534test-io-obj-$(CONFIG_BLOCK) = $(io-obj-y) $(test-crypto-obj-y)
535test-authz-obj-$(CONFIG_BLOCK) = $(test-qom-obj-y) $(authz-obj-y)
536test-block-obj-$(CONFIG_BLOCK) = $(block-obj-y) $(test-io-obj-y) tests/iothread.o
b124533e 537
01b2ffce 538tests/check-qnum$(EXESUF): tests/check-qnum.o $(test-util-obj-y)
b124533e
DB
539tests/check-qstring$(EXESUF): tests/check-qstring.o $(test-util-obj-y)
540tests/check-qdict$(EXESUF): tests/check-qdict.o $(test-util-obj-y)
0bcc8e5b 541tests/check-block-qdict$(EXESUF): tests/check-block-qdict.o $(test-util-obj-y)
b124533e 542tests/check-qlist$(EXESUF): tests/check-qlist.o $(test-util-obj-y)
7d7a337e 543tests/check-qnull$(EXESUF): tests/check-qnull.o $(test-util-obj-y)
1b76e838 544tests/check-qobject$(EXESUF): tests/check-qobject.o $(test-util-obj-y)
b124533e 545tests/check-qjson$(EXESUF): tests/check-qjson.o $(test-util-obj-y)
382176b4 546tests/check-qlit$(EXESUF): tests/check-qlit.o $(test-util-obj-y)
b124533e
DB
547tests/check-qom-interface$(EXESUF): tests/check-qom-interface.o $(test-qom-obj-y)
548tests/check-qom-proplist$(EXESUF): tests/check-qom-proplist.o $(test-qom-obj-y)
ea3af47d 549
3db9f6a3 550tests/test-char$(EXESUF): tests/test-char.o $(test-util-obj-y) $(test-io-obj-y) $(chardev-obj-y) tests/socket-helpers.o
b124533e
DB
551tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(test-block-obj-y)
552tests/test-aio$(EXESUF): tests/test-aio.o $(test-block-obj-y)
0c330a73 553tests/test-aio-multithread$(EXESUF): tests/test-aio-multithread.o $(test-block-obj-y)
b124533e 554tests/test-throttle$(EXESUF): tests/test-throttle.o $(test-block-obj-y)
881cfd17 555tests/test-bdrv-drain$(EXESUF): tests/test-bdrv-drain.o $(test-block-obj-y) $(test-util-obj-y)
2dbfadf6 556tests/test-bdrv-graph-mod$(EXESUF): tests/test-bdrv-graph-mod.o $(test-block-obj-y) $(test-util-obj-y)
9ef8112a 557tests/test-blockjob$(EXESUF): tests/test-blockjob.o $(test-block-obj-y) $(test-util-obj-y)
6c6f312d 558tests/test-blockjob-txn$(EXESUF): tests/test-blockjob-txn.o $(test-block-obj-y) $(test-util-obj-y)
ad0df3e0 559tests/test-block-backend$(EXESUF): tests/test-block-backend.o $(test-block-obj-y) $(test-util-obj-y)
4720cbee 560tests/test-block-iothread$(EXESUF): tests/test-block-iothread.o $(test-block-obj-y) $(test-util-obj-y)
aef96d7d 561tests/test-image-locking$(EXESUF): tests/test-image-locking.o $(test-block-obj-y) $(test-util-obj-y)
b124533e
DB
562tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(test-block-obj-y)
563tests/test-iov$(EXESUF): tests/test-iov.o $(test-util-obj-y)
a3b52535 564tests/test-hbitmap$(EXESUF): tests/test-hbitmap.o $(test-util-obj-y) $(test-crypto-obj-y)
ad37f24d 565tests/test-bitmap$(EXESUF): tests/test-bitmap.o $(test-util-obj-y)
247c9de1 566tests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o
aa3544c3 567tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o migration/page_cache.o $(test-util-obj-y)
05cb8ed5 568tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o $(test-util-obj-y)
6046c620 569tests/test-int128$(EXESUF): tests/test-int128.o
b124533e
DB
570tests/rcutorture$(EXESUF): tests/rcutorture.o $(test-util-obj-y)
571tests/test-rcu-list$(EXESUF): tests/test-rcu-list.o $(test-util-obj-y)
90487e45 572tests/test-rcu-simpleq$(EXESUF): tests/test-rcu-simpleq.o $(test-util-obj-y)
dbf8862a 573tests/test-rcu-tailq$(EXESUF): tests/test-rcu-tailq.o $(test-util-obj-y)
ff9249b7 574tests/test-qdist$(EXESUF): tests/test-qdist.o $(test-util-obj-y)
1a95404f 575tests/test-qht$(EXESUF): tests/test-qht.o $(test-util-obj-y)
896a9ee9 576tests/test-qht-par$(EXESUF): tests/test-qht-par.o tests/qht-bench$(EXESUF) $(test-util-obj-y)
515864a0 577tests/qht-bench$(EXESUF): tests/qht-bench.o $(test-util-obj-y)
efad6682 578tests/test-bufferiszero$(EXESUF): tests/test-bufferiszero.o $(test-util-obj-y)
070e3edc 579tests/atomic_add-bench$(EXESUF): tests/atomic_add-bench.o $(test-util-obj-y)
82fdfcbe 580tests/atomic64-bench$(EXESUF): tests/atomic64-bench.o $(test-util-obj-y)
8fda74a5 581
3ac1f813
EC
582tests/fp/%:
583 $(MAKE) -C $(dir $@) $(notdir $@)
584
747b0cb4 585tests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o \
5e954943 586 hw/core/qdev.o hw/core/qdev-properties.o hw/core/hotplug.o\
a62c8911 587 hw/core/bus.o \
747b0cb4 588 hw/core/irq.o \
6b1566cb 589 hw/core/fw-path-provider.o \
2f7b92a0 590 hw/core/reset.o \
107b5969 591 hw/core/vmstate-if.o \
b124533e 592 $(test-qapi-obj-y)
2668b4bf 593tests/test-vmstate$(EXESUF): tests/test-vmstate.o \
576d1abc 594 migration/vmstate.o migration/vmstate-types.o migration/qemu-file.o \
8925839f
DB
595 migration/qemu-file-channel.o migration/qjson.o \
596 $(test-io-obj-y)
c2b38b27 597tests/test-timed-average$(EXESUF): tests/test-timed-average.o $(test-util-obj-y)
ebedb37c 598tests/test-base64$(EXESUF): tests/test-base64.o $(test-util-obj-y)
9ee24e98 599tests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o hw/core/ptimer.o
10ae5b30
TH
600tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o $(test-util-obj-y)
601tests/test-keyval$(EXESUF): tests/test-keyval.o $(test-util-obj-y) $(test-qapi-obj-y)
602tests/test-write-threshold$(EXESUF): tests/test-write-threshold.o $(test-block-obj-y)
603tests/test-uuid$(EXESUF): tests/test-uuid.o $(test-util-obj-y)
604tests/test-qapi-util$(EXESUF): tests/test-qapi-util.o $(test-util-obj-y)
b93b63f5 605
3514552e
AB
606tests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y)
607
b3110466
CX
608tests/test-replication$(EXESUF): tests/test-replication.o $(test-util-obj-y) \
609 $(test-block-obj-y)
610
fb0bc835 611tests/test-qapi-types.c tests/test-qapi-types.h \
709395f8
MA
612tests/include/test-qapi-types-sub-module.c \
613tests/include/test-qapi-types-sub-module.h \
614tests/test-qapi-types-sub-sub-module.c \
615tests/test-qapi-types-sub-sub-module.h \
fb0bc835 616tests/test-qapi-visit.c tests/test-qapi-visit.h \
709395f8
MA
617tests/include/test-qapi-visit-sub-module.c \
618tests/include/test-qapi-visit-sub-module.h \
619tests/test-qapi-visit-sub-sub-module.c \
620tests/test-qapi-visit-sub-sub-module.h \
eb815e24 621tests/test-qapi-commands.h tests/test-qapi-commands.c \
709395f8
MA
622tests/include/test-qapi-commands-sub-module.h \
623tests/include/test-qapi-commands-sub-module.c \
624tests/test-qapi-commands-sub-sub-module.h \
625tests/test-qapi-commands-sub-sub-module.c \
eb815e24 626tests/test-qapi-events.c tests/test-qapi-events.h \
709395f8
MA
627tests/include/test-qapi-events-sub-module.c \
628tests/include/test-qapi-events-sub-module.h \
629tests/test-qapi-events-sub-sub-module.c \
630tests/test-qapi-events-sub-sub-module.h \
eb815e24 631tests/test-qapi-introspect.c tests/test-qapi-introspect.h: \
fb0bc835 632tests/test-qapi-gen-timestamp ;
709395f8
MA
633tests/test-qapi-gen-timestamp: \
634 $(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json \
635 $(SRC_PATH)/tests/qapi-schema/include/sub-module.json \
636 $(SRC_PATH)/tests/qapi-schema/sub-sub-module.json \
637 $(qapi-py)
0d6b93de 638 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
fb0bc835
MA
639 -o tests -p "test-" $<, \
640 "GEN","$(@:%-timestamp=%)")
f3d4aa5a 641 @rm -f tests/test-qapi-doc.texi
fb0bc835
MA
642 @>$@
643
644tests/qapi-schema/doc-good.test.texi: $(SRC_PATH)/tests/qapi-schema/doc-good.json $(qapi-py)
0d6b93de 645 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
fb0bc835 646 -o tests/qapi-schema -p "doc-good-" $<, \
0bdb12c7 647 "GEN","$@")
fb0bc835
MA
648 @mv tests/qapi-schema/doc-good-qapi-doc.texi $@
649 @rm -f tests/qapi-schema/doc-good-qapi-*.[ch] tests/qapi-schema/doc-good-qmp-*.[ch]
80d1f2e4 650
1e8a1fae
TH
651tests/qtest/dbus-vmstate1.h tests/qtest/dbus-vmstate1.c: tests/qtest/dbus-vmstate1-gen-timestamp ;
652tests/qtest/dbus-vmstate1-gen-timestamp: $(SRC_PATH)/tests/qtest/dbus-vmstate1.xml
586ca6ba 653 $(call quiet-command,$(GDBUS_CODEGEN) $< \
1e8a1fae 654 --interface-prefix org.qemu --generate-c-code tests/qtest/dbus-vmstate1, \
586ca6ba
MAL
655 "GEN","$(@:%-timestamp=%)")
656 @>$@
657
1e8a1fae
TH
658tests/qtest/dbus-vmstate-test.o-cflags := -DSRCDIR="$(SRC_PATH)"
659tests/qtest/dbus-vmstate1.o-cflags := $(GIO_CFLAGS)
660tests/qtest/dbus-vmstate1.o-libs := $(GIO_LIBS)
586ca6ba 661
1e8a1fae 662tests/qtest/dbus-vmstate-test.o: tests/qtest/dbus-vmstate1.h
586ca6ba 663
b124533e
DB
664tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y)
665tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y)
a9529100 666tests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y) tests/test-qapi-events.o
b3db211f 667tests/test-qobject-output-visitor$(EXESUF): tests/test-qobject-output-visitor.o $(test-qapi-obj-y)
a15fcc3c 668tests/test-clone-visitor$(EXESUF): tests/test-clone-visitor.o $(test-qapi-obj-y)
b3db211f 669tests/test-qobject-input-visitor$(EXESUF): tests/test-qobject-input-visitor.o $(test-qapi-obj-y)
eb815e24 670tests/test-qmp-cmds$(EXESUF): tests/test-qmp-cmds.o tests/test-qapi-commands.o $(test-qapi-obj-y)
b124533e
DB
671tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y)
672tests/test-opts-visitor$(EXESUF): tests/test-opts-visitor.o $(test-qapi-obj-y)
2d7799f2 673
f539fbe3 674tests/test-shift128$(EXESUF): tests/test-shift128.o $(test-util-obj-y)
b124533e
DB
675tests/test-mul64$(EXESUF): tests/test-mul64.o $(test-util-obj-y)
676tests/test-bitops$(EXESUF): tests/test-bitops.o $(test-util-obj-y)
c3f8962f 677tests/test-bitcnt$(EXESUF): tests/test-bitcnt.o $(test-util-obj-y)
fb37726d 678tests/test-crypto-hash$(EXESUF): tests/test-crypto-hash.o $(test-crypto-obj-y)
0128cd29 679tests/benchmark-crypto-hash$(EXESUF): tests/benchmark-crypto-hash.o $(test-crypto-obj-y)
4fd460bf 680tests/test-crypto-hmac$(EXESUF): tests/test-crypto-hmac.o $(test-crypto-obj-y)
c7a9af4b 681tests/benchmark-crypto-hmac$(EXESUF): tests/benchmark-crypto-hmac.o $(test-crypto-obj-y)
fb37726d 682tests/test-crypto-cipher$(EXESUF): tests/test-crypto-cipher.o $(test-crypto-obj-y)
1efd9d5e 683tests/benchmark-crypto-cipher$(EXESUF): tests/benchmark-crypto-cipher.o $(test-crypto-obj-y)
ac1d8878 684tests/test-crypto-secret$(EXESUF): tests/test-crypto-secret.o $(test-crypto-obj-y)
84f7f180 685tests/test-crypto-xts$(EXESUF): tests/test-crypto-xts.o $(test-crypto-obj-y)
90246037
DB
686
687tests/crypto-tls-x509-helpers.o-cflags := $(TASN1_CFLAGS)
688tests/crypto-tls-x509-helpers.o-libs := $(TASN1_LIBS)
689tests/pkix_asn1_tab.o-cflags := $(TASN1_CFLAGS)
690
691tests/test-crypto-tlscredsx509.o-cflags := $(TASN1_CFLAGS)
9a2fd434
DB
692tests/test-crypto-tlscredsx509$(EXESUF): tests/test-crypto-tlscredsx509.o \
693 tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y)
90246037
DB
694
695tests/test-crypto-tlssession.o-cflags := $(TASN1_CFLAGS)
d321e1e5 696tests/test-crypto-tlssession$(EXESUF): tests/test-crypto-tlssession.o \
e1a6dc91
RJ
697 tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o \
698 tests/crypto-tls-psk-helpers.o \
699 $(test-crypto-obj-y)
90e33dfe
DB
700tests/test-util-filemonitor$(EXESUF): tests/test-util-filemonitor.o \
701 $(test-util-obj-y)
58dc31f1
DB
702tests/test-util-sockets$(EXESUF): tests/test-util-sockets.o \
703 tests/socket-helpers.o $(test-util-obj-y)
fb5c4ebc 704tests/test-authz-simple$(EXESUF): tests/test-authz-simple.o $(test-authz-obj-y)
c8c99887 705tests/test-authz-list$(EXESUF): tests/test-authz-list.o $(test-authz-obj-y)
55d86984 706tests/test-authz-listfile$(EXESUF): tests/test-authz-listfile.o $(test-authz-obj-y)
8953caf3 707tests/test-authz-pam$(EXESUF): tests/test-authz-pam.o $(test-authz-obj-y)
b02db2d9 708tests/test-io-task$(EXESUF): tests/test-io-task.o $(test-io-obj-y)
559607ea 709tests/test-io-channel-socket$(EXESUF): tests/test-io-channel-socket.o \
9b589ffb 710 tests/io-channel-helpers.o tests/socket-helpers.o $(test-io-obj-y)
1e8a1fae
TH
711tests/qtest/tpm-crb-swtpm-test$(EXESUF): tests/qtest/tpm-crb-swtpm-test.o tests/qtest/tpm-emu.o \
712 tests/qtest/tpm-util.o tests/qtest/tpm-tests.o $(test-io-obj-y)
713tests/qtest/tpm-crb-test$(EXESUF): tests/qtest/tpm-crb-test.o tests/qtest/tpm-emu.o $(test-io-obj-y)
714tests/qtest/tpm-tis-swtpm-test$(EXESUF): tests/qtest/tpm-tis-swtpm-test.o tests/qtest/tpm-emu.o \
715 tests/qtest/tpm-util.o tests/qtest/tpm-tests.o $(test-io-obj-y)
716tests/qtest/tpm-tis-test$(EXESUF): tests/qtest/tpm-tis-test.o tests/qtest/tpm-emu.o $(test-io-obj-y)
d6e48869
DB
717tests/test-io-channel-file$(EXESUF): tests/test-io-channel-file.o \
718 tests/io-channel-helpers.o $(test-io-obj-y)
ed8ee42c
DB
719tests/test-io-channel-tls$(EXESUF): tests/test-io-channel-tls.o \
720 tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o \
721 tests/io-channel-helpers.o $(test-io-obj-y)
195e14d0
DB
722tests/test-io-channel-command$(EXESUF): tests/test-io-channel-command.o \
723 tests/io-channel-helpers.o $(test-io-obj-y)
d98e4eb7
DB
724tests/test-io-channel-buffer$(EXESUF): tests/test-io-channel-buffer.o \
725 tests/io-channel-helpers.o $(test-io-obj-y)
37788f25 726tests/test-crypto-pbkdf$(EXESUF): tests/test-crypto-pbkdf.o $(test-crypto-obj-y)
cb730894 727tests/test-crypto-ivgen$(EXESUF): tests/test-crypto-ivgen.o $(test-crypto-obj-y)
5a95e0fc 728tests/test-crypto-afsplit$(EXESUF): tests/test-crypto-afsplit.o $(test-crypto-obj-y)
7d969014 729tests/test-crypto-block$(EXESUF): tests/test-crypto-block.o $(test-crypto-obj-y)
f4c0f986 730
fc281c80
EGE
731libqgraph-obj-y = tests/libqos/qgraph.o
732
733libqos-obj-y = $(libqgraph-obj-y) tests/libqos/pci.o tests/libqos/fw_cfg.o
5cb8f0db 734libqos-obj-y += tests/libqos/malloc.o
8130dbcb 735libqos-obj-y += tests/libqos/libqos.o
8d6ef7c9
LV
736libqos-spapr-obj-y = $(libqos-obj-y) tests/libqos/malloc-spapr.o
737libqos-spapr-obj-y += tests/libqos/libqos-spapr.o
eeddd59f 738libqos-spapr-obj-y += tests/libqos/rtas.o
cf716b31 739libqos-spapr-obj-y += tests/libqos/pci-spapr.o
26491a38 740libqos-pc-obj-y = $(libqos-obj-y) tests/libqos/pci-pc.o
90e5add6 741libqos-pc-obj-y += tests/libqos/malloc-pc.o tests/libqos/libqos-pc.o
9a75b0a0 742libqos-pc-obj-y += tests/libqos/ahci.o
aa9026fd 743libqos-usb-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/usb.o
fc281c80 744
85af0057 745# Devices
1e8a1fae 746qos-test-obj-y = tests/qtest/qos-test.o $(libqgraph-obj-y)
b8782d2a 747qos-test-obj-y += $(libqos-pc-obj-y) $(libqos-spapr-obj-y)
a4cc719b 748qos-test-obj-y += tests/libqos/e1000e.o
8130dbcb
PB
749qos-test-obj-y += tests/libqos/i2c.o
750qos-test-obj-y += tests/libqos/i2c-imx.o
93c3fe2a 751qos-test-obj-y += tests/libqos/i2c-omap.o
a0a9ba66 752qos-test-obj-y += tests/libqos/sdhci.o
0793a889 753qos-test-obj-y += tests/libqos/tpci200.o
19e3d979 754qos-test-obj-y += tests/libqos/virtio.o
9d447257 755qos-test-obj-$(CONFIG_VIRTFS) += tests/libqos/virtio-9p.o
29241067 756qos-test-obj-y += tests/libqos/virtio-balloon.o
a3713493 757qos-test-obj-y += tests/libqos/virtio-blk.o
19e3d979 758qos-test-obj-y += tests/libqos/virtio-mmio.o
583349d1 759qos-test-obj-y += tests/libqos/virtio-net.o
19e3d979 760qos-test-obj-y += tests/libqos/virtio-pci.o
d08f68b8 761qos-test-obj-y += tests/libqos/virtio-pci-modern.o
d3d400d3 762qos-test-obj-y += tests/libqos/virtio-rng.o
8f41a3a8 763qos-test-obj-y += tests/libqos/virtio-scsi.o
b3e7dc87 764qos-test-obj-y += tests/libqos/virtio-serial.o
85af0057 765
46113f88 766# Machines
555299cb 767qos-test-obj-y += tests/libqos/aarch64-xlnx-zcu102-machine.o
751a7a5d 768qos-test-obj-y += tests/libqos/arm-imx25-pdk-machine.o
48963982 769qos-test-obj-y += tests/libqos/arm-n800-machine.o
ad60d6d4 770qos-test-obj-y += tests/libqos/arm-raspi2-machine.o
aea9ac51 771qos-test-obj-y += tests/libqos/arm-sabrelite-machine.o
c9599c9a 772qos-test-obj-y += tests/libqos/arm-smdkc210-machine.o
d18d2b57 773qos-test-obj-y += tests/libqos/arm-virt-machine.o
2013199d 774qos-test-obj-y += tests/libqos/arm-xilinx-zynq-a9-machine.o
7985b582 775qos-test-obj-y += tests/libqos/ppc64_pseries-machine.o
46113f88
EGE
776qos-test-obj-y += tests/libqos/x86_64_pc-machine.o
777
757c6eac 778# Tests
1e8a1fae
TH
779qos-test-obj-y += tests/qtest/ac97-test.o
780qos-test-obj-y += tests/qtest/ds1338-test.o
781qos-test-obj-y += tests/qtest/e1000-test.o
782qos-test-obj-y += tests/qtest/e1000e-test.o
783qos-test-obj-y += tests/qtest/eepro100-test.o
784qos-test-obj-y += tests/qtest/es1370-test.o
785qos-test-obj-y += tests/qtest/ipoctal232-test.o
786qos-test-obj-y += tests/qtest/megasas-test.o
787qos-test-obj-y += tests/qtest/ne2000-test.o
788qos-test-obj-y += tests/qtest/nvme-test.o
789qos-test-obj-y += tests/qtest/pca9552-test.o
790qos-test-obj-y += tests/qtest/pci-test.o
791qos-test-obj-y += tests/qtest/pcnet-test.o
792qos-test-obj-y += tests/qtest/sdhci-test.o
793qos-test-obj-y += tests/qtest/spapr-phb-test.o
794qos-test-obj-y += tests/qtest/tmp105-test.o
795qos-test-obj-y += tests/qtest/usb-hcd-ohci-test.o $(libqos-usb-obj-y)
796qos-test-obj-$(CONFIG_VHOST_NET_USER) += tests/qtest/vhost-user-test.o $(chardev-obj-y) $(test-io-obj-y)
797qos-test-obj-y += tests/qtest/virtio-test.o
798qos-test-obj-$(CONFIG_VIRTFS) += tests/qtest/virtio-9p-test.o
799qos-test-obj-y += tests/qtest/virtio-blk-test.o
800qos-test-obj-y += tests/qtest/virtio-net-test.o
801qos-test-obj-y += tests/qtest/virtio-rng-test.o
802qos-test-obj-y += tests/qtest/virtio-scsi-test.o
803qos-test-obj-y += tests/qtest/virtio-serial-test.o
804qos-test-obj-y += tests/qtest/vmxnet3-test.o
757c6eac 805
fc281c80
EGE
806check-unit-y += tests/test-qgraph$(EXESUF)
807tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y)
808
55e997a7 809check-qtest-generic-y += qos-test
1e8a1fae
TH
810tests/qtest/qos-test$(EXESUF): $(qos-test-obj-y)
811
812tests/qtest/qmp-test$(EXESUF): tests/qtest/qmp-test.o
813tests/qtest/qmp-cmd-test$(EXESUF): tests/qtest/qmp-cmd-test.o
814tests/qtest/device-introspect-test$(EXESUF): tests/qtest/device-introspect-test.o
815tests/qtest/rtc-test$(EXESUF): tests/qtest/rtc-test.o
816tests/qtest/m48t59-test$(EXESUF): tests/qtest/m48t59-test.o
817tests/qtest/hexloader-test$(EXESUF): tests/qtest/hexloader-test.o
818tests/qtest/pflash-cfi02$(EXESUF): tests/qtest/pflash-cfi02-test.o
819tests/qtest/endianness-test$(EXESUF): tests/qtest/endianness-test.o
820tests/qtest/prom-env-test$(EXESUF): tests/qtest/prom-env-test.o $(libqos-obj-y)
821tests/qtest/rtas-test$(EXESUF): tests/qtest/rtas-test.o $(libqos-spapr-obj-y)
822tests/qtest/fdc-test$(EXESUF): tests/qtest/fdc-test.o
823tests/qtest/ide-test$(EXESUF): tests/qtest/ide-test.o $(libqos-pc-obj-y)
824tests/qtest/ahci-test$(EXESUF): tests/qtest/ahci-test.o $(libqos-pc-obj-y) qemu-img$(EXESUF)
825tests/qtest/ipmi-kcs-test$(EXESUF): tests/qtest/ipmi-kcs-test.o
826tests/qtest/ipmi-bt-test$(EXESUF): tests/qtest/ipmi-bt-test.o
827tests/qtest/hd-geo-test$(EXESUF): tests/qtest/hd-geo-test.o $(libqos-obj-y)
828tests/qtest/boot-order-test$(EXESUF): tests/qtest/boot-order-test.o $(libqos-obj-y)
829tests/qtest/boot-serial-test$(EXESUF): tests/qtest/boot-serial-test.o $(libqos-obj-y)
830tests/qtest/bios-tables-test$(EXESUF): tests/qtest/bios-tables-test.o \
831 tests/qtest/boot-sector.o tests/qtest/acpi-utils.o $(libqos-obj-y)
832tests/qtest/pxe-test$(EXESUF): tests/qtest/pxe-test.o tests/qtest/boot-sector.o $(libqos-obj-y)
833tests/qtest/microbit-test$(EXESUF): tests/qtest/microbit-test.o
834tests/qtest/m25p80-test$(EXESUF): tests/qtest/m25p80-test.o
835tests/qtest/i440fx-test$(EXESUF): tests/qtest/i440fx-test.o $(libqos-pc-obj-y)
836tests/qtest/q35-test$(EXESUF): tests/qtest/q35-test.o $(libqos-pc-obj-y)
837tests/qtest/fw_cfg-test$(EXESUF): tests/qtest/fw_cfg-test.o $(libqos-pc-obj-y)
838tests/qtest/rtl8139-test$(EXESUF): tests/qtest/rtl8139-test.o $(libqos-pc-obj-y)
839tests/qtest/pnv-xscom-test$(EXESUF): tests/qtest/pnv-xscom-test.o
840tests/qtest/wdt_ib700-test$(EXESUF): tests/qtest/wdt_ib700-test.o
841tests/qtest/tco-test$(EXESUF): tests/qtest/tco-test.o $(libqos-pc-obj-y)
842tests/qtest/virtio-ccw-test$(EXESUF): tests/qtest/virtio-ccw-test.o
843tests/qtest/display-vga-test$(EXESUF): tests/qtest/display-vga-test.o
844tests/qtest/qom-test$(EXESUF): tests/qtest/qom-test.o
845tests/qtest/test-hmp$(EXESUF): tests/qtest/test-hmp.o
846tests/qtest/machine-none-test$(EXESUF): tests/qtest/machine-none-test.o
847tests/qtest/device-plug-test$(EXESUF): tests/qtest/device-plug-test.o
848tests/qtest/drive_del-test$(EXESUF): tests/qtest/drive_del-test.o
849tests/qtest/pvpanic-test$(EXESUF): tests/qtest/pvpanic-test.o
850tests/qtest/i82801b11-test$(EXESUF): tests/qtest/i82801b11-test.o
851tests/qtest/intel-hda-test$(EXESUF): tests/qtest/intel-hda-test.o
852tests/qtest/ioh3420-test$(EXESUF): tests/qtest/ioh3420-test.o
853tests/qtest/usb-hcd-uhci-test$(EXESUF): tests/qtest/usb-hcd-uhci-test.o $(libqos-usb-obj-y)
854tests/qtest/usb-hcd-ehci-test$(EXESUF): tests/qtest/usb-hcd-ehci-test.o $(libqos-usb-obj-y)
855tests/qtest/usb-hcd-xhci-test$(EXESUF): tests/qtest/usb-hcd-xhci-test.o $(libqos-usb-obj-y)
856tests/qtest/cpu-plug-test$(EXESUF): tests/qtest/cpu-plug-test.o
857tests/qtest/migration-test$(EXESUF): tests/qtest/migration-test.o tests/qtest/migration-helpers.o
858tests/qtest/qemu-iotests/qtest/socket_scm_helper$(EXESUF): tests/qtest/qemu-iotests/qtest/socket_scm_helper.o
859tests/qtest/test-netfilter$(EXESUF): tests/qtest/test-netfilter.o $(qtest-obj-y)
860tests/qtest/test-filter-mirror$(EXESUF): tests/qtest/test-filter-mirror.o $(qtest-obj-y)
861tests/qtest/test-filter-redirector$(EXESUF): tests/qtest/test-filter-redirector.o $(qtest-obj-y)
862tests/qtest/test-x86-cpuid-compat$(EXESUF): tests/qtest/test-x86-cpuid-compat.o $(qtest-obj-y)
863tests/qtest/ivshmem-test$(EXESUF): tests/qtest/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y) $(libqos-spapr-obj-y)
864tests/qtest/dbus-vmstate-test$(EXESUF): tests/qtest/dbus-vmstate-test.o tests/qtest/migration-helpers.o tests/qtest/dbus-vmstate1.o $(libqos-pc-obj-y) $(libqos-spapr-obj-y)
865tests/qtest/vhost-user-bridge$(EXESUF): tests/qtest/vhost-user-bridge.o $(test-util-obj-y) libvhost-user.a
866tests/qtest/test-arm-mptimer$(EXESUF): tests/qtest/test-arm-mptimer.o
867tests/qtest/numa-test$(EXESUF): tests/qtest/numa-test.o
868tests/qtest/vmgenid-test$(EXESUF): tests/qtest/vmgenid-test.o tests/qtest/boot-sector.o tests/qtest/acpi-utils.o
869tests/qtest/cdrom-test$(EXESUF): tests/qtest/cdrom-test.o tests/qtest/boot-sector.o $(libqos-obj-y)
870tests/qtest/arm-cpu-features$(EXESUF): tests/qtest/arm-cpu-features.o
d2a16f74 871
409437e1 872tests/migration/stress$(EXESUF): tests/migration/stress.o
0bdb12c7 873 $(call quiet-command, $(LINKPROG) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"LINK","$(TARGET_DIR)$@")
409437e1
DB
874
875INITRD_WORK_DIR=tests/migration/initrd
876
877tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF)
878 mkdir -p $(INITRD_WORK_DIR)
879 cp $< $(INITRD_WORK_DIR)/init
880 (cd $(INITRD_WORK_DIR) && (find | cpio --quiet -o -H newc | gzip -9)) > $@
881 rm $(INITRD_WORK_DIR)/init
882 rmdir $(INITRD_WORK_DIR)
883
49ee3590
AL
884# QTest rules
885
2b1f35b9 886TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
5c4e24c1 887ifeq ($(CONFIG_POSIX),y)
e253c287 888QTEST_TARGETS = $(TARGETS)
1e8a1fae
TH
889check-qtest-y=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y:%=tests/qtest/%$(EXESUF)))
890check-qtest-y += $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF))
e253c287
MA
891else
892QTEST_TARGETS =
5c4e24c1 893endif
49ee3590 894
1e8a1fae 895qtest-obj-y = tests/qtest/libqtest.o $(test-util-obj-y)
49ee3590
AL
896$(check-qtest-y): $(qtest-obj-y)
897
4be75077
PMD
898tests/test-qga$(EXESUF): qemu-ga$(EXESUF)
899tests/test-qga$(EXESUF): tests/test-qga.o $(qtest-obj-y)
62c39b30 900
b93b63f5 901SPEED = quick
dbfe06c6 902
b93b63f5 903# gtester tests, possibly with verbose output
9df43317
PB
904# do_test_tap runs all tests, even if some of them fail, while do_test_human
905# stops at the first failure unless -k is given on the command line
906
907define do_test_human_k
908 $(quiet-@)rc=0; $(foreach COMMAND, $1, \
909 $(call quiet-command-run, \
910 export MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} $2; \
911 $(COMMAND) -m=$(SPEED) -k --tap < /dev/null \
912 | ./scripts/tap-driver.pl --test-name="$(notdir $(COMMAND))" $(if $(V),, --show-failures-only) \
913 || rc=$$?;, "TEST", "$@: $(COMMAND)")) exit $$rc
914endef
915define do_test_human_no_k
916 $(foreach COMMAND, $1, \
917 $(call quiet-command, \
918 MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} $2 \
919 $(COMMAND) -m=$(SPEED) -k --tap < /dev/null \
920 | ./scripts/tap-driver.pl --test-name="$(notdir $(COMMAND))" $(if $(V),, --show-failures-only), \
921 "TEST", "$@: $(COMMAND)")
922)
923endef
924do_test_human = \
925 $(if $(findstring k, $(MAKEFLAGS)), $(do_test_human_k), $(do_test_human_no_k))
926
927define do_test_tap
928 $(call quiet-command, \
929 { export MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} $2; \
930 $(foreach COMMAND, $1, \
931 $(COMMAND) -m=$(SPEED) -k --tap < /dev/null \
932 | sed "s/^[a-z][a-z]* [0-9]* /&$(notdir $(COMMAND)) /" || true; ) } \
933 | ./scripts/tap-merge.pl | tee "$@" \
934 | ./scripts/tap-driver.pl $(if $(V),, --show-failures-only), \
935 "TAP","$@")
936endef
dbfe06c6 937
49ee3590 938.PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS))
3b8593ee 939$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: %-softmmu/all $(check-qtest-y)
1e8a1fae 940 $(call do_test_human,$(check-qtest-$*-y:%=tests/qtest/%$(EXESUF)) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)), \
9df43317
PB
941 QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
942 QTEST_QEMU_IMG=qemu-img$(EXESUF))
49ee3590 943
9df43317
PB
944check-unit: $(check-unit-y)
945 $(call do_test_human, $^)
dbfe06c6 946
9df43317
PB
947check-speed: $(check-speed-y)
948 $(call do_test_human, $^)
8959449b 949
9df43317 950# gtester tests with TAP output
49ee3590 951
3b8593ee 952$(patsubst %, check-report-qtest-%.tap, $(QTEST_TARGETS)): check-report-qtest-%.tap: %-softmmu/all $(check-qtest-y)
1e8a1fae 953 $(call do_test_tap, $(check-qtest-$*-y:%=tests/qtest/%$(EXESUF)) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)), \
9df43317
PB
954 QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
955 QTEST_QEMU_IMG=qemu-img$(EXESUF))
b8c6f29e 956
9df43317
PB
957check-report-unit.tap: $(check-unit-y)
958 $(call do_test_tap,$^)
b8c6f29e 959
9df43317 960# Reports and overall runs
b8c6f29e 961
9df43317 962check-report.tap: $(patsubst %,check-report-qtest-%.tap, $(QTEST_TARGETS)) check-report-unit.tap
77b748a8 963 $(call quiet-command, cat $^ | scripts/tap-merge.pl >$@,"GEN","$@")
b93b63f5 964
2cade3d7
AB
965# FPU Emulation tests (aka softfloat)
966#
967# As we still have some places that need fixing the rules are a little
968# more complex than they need to be and have to override some of the
969# generic Makefile expansions. Once we are cleanly passing all
970# the tests we can simplify the make syntax.
971
972FP_TEST_BIN=$(BUILD_DIR)/tests/fp/fp-test
973
974# the build dir is created by configure
975.PHONY: $(FP_TEST_BIN)
3618e3a6 976$(FP_TEST_BIN): config-host.h $(test-util-obj-y)
2cade3d7
AB
977 $(call quiet-command, \
978 $(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" $(notdir $@), \
979 "BUILD", "$(notdir $@)")
980
981# The full test suite can take a bit of time, default to a quick run
4f575c08
AB
982# "-l 2 -r all" can take more than a day for some operations and is best
983# run manually
bf30e866 984FP_TL=-l 1 -r all
2cade3d7 985
bf30e866 986# $1 = tests, $2 = description, $3 = test flags
2cade3d7
AB
987test-softfloat = $(call quiet-command, \
988 cd $(BUILD_DIR)/tests/fp && \
bf30e866 989 ./fp-test -s $(if $3,$3,$(FP_TL)) $1 > $2.out 2>&1 || \
2cade3d7
AB
990 (cat $2.out && exit 1;), \
991 "FLOAT TEST", $2)
992
993# Conversion Routines:
994# FIXME: i32_to_extF80 (broken), i64_to_extF80 (broken)
dc3f8a9d 995# ui32_to_f128 (not implemented), extF80_roundToInt (broken)
2cade3d7
AB
996#
997check-softfloat-conv: $(FP_TEST_BIN)
998 $(call test-softfloat, \
999 i32_to_f16 i64_to_f16 \
1000 i32_to_f32 i64_to_f32 \
1001 i32_to_f64 i64_to_f64 \
1002 i32_to_f128 i64_to_f128, int-to-float)
1003 $(call test-softfloat, \
1004 ui32_to_f16 ui64_to_f16 \
1005 ui32_to_f32 ui64_to_f32 \
1006 ui32_to_f64 ui64_to_f64 \
1007 ui64_to_f128, uint-to-float)
1008 $(call test-softfloat, \
1009 f16_to_i32 f16_to_i32_r_minMag \
1010 f32_to_i32 f32_to_i32_r_minMag \
1011 f64_to_i32 f64_to_i32_r_minMag \
1012 extF80_to_i32 extF80_to_i32_r_minMag \
1013 f128_to_i32 f128_to_i32_r_minMag \
1014 f16_to_i64 f16_to_i64_r_minMag \
1015 f32_to_i64 f32_to_i64_r_minMag \
1016 f64_to_i64 f64_to_i64_r_minMag \
1017 extF80_to_i64 extF80_to_i64_r_minMag \
1018 f128_to_i64 f128_to_i64_r_minMag, \
1019 float-to-int)
1020 $(call test-softfloat, \
1021 f16_to_ui32 f16_to_ui32_r_minMag \
1022 f32_to_ui32 f32_to_ui32_r_minMag \
1023 f64_to_ui32 f64_to_ui32_r_minMag \
dc3f8a9d 1024 f128_to_ui32 f128_to_ui32_r_minMag \
2cade3d7
AB
1025 f16_to_ui64 f16_to_ui64_r_minMag \
1026 f32_to_ui64 f32_to_ui64_r_minMag \
dc3f8a9d
AB
1027 f64_to_ui64 f64_to_ui64_r_minMag \
1028 f128_to_ui64 f128_to_ui64_r_minMag, \
2cade3d7
AB
1029 float-to-uint)
1030 $(call test-softfloat, \
1031 f16_roundToInt f32_roundToInt \
1032 f64_roundToInt f128_roundToInt, \
1033 round-to-integer)
1034
1035# Generic rule for all float operations
1036#
1037# Some patterns are overidden due to broken or missing tests.
1038# Hopefully these can be removed over time.
1039
1040check-softfloat-%: $(FP_TEST_BIN)
1041 $(call test-softfloat, f16_$* f32_$* f64_$* extF80_$* f128_$*, $*)
1042
1043# Float Compare routines
1044SF_COMPARE_OPS=eq eq_signaling le le_quiet lt_quiet
1045SF_COMPARE_RULES=$(patsubst %,check-softfloat-%, $(SF_COMPARE_OPS))
1046
1047# FIXME: extF80_le_quiet (broken)
1048check-softfloat-le_quiet: $(FP_TEST_BIN)
1049 $(call test-softfloat, \
1050 f16_le_quiet f32_le_quiet f64_le_quiet \
1051 f128_le_quiet, \
1052 le_quiet)
1053
1054# FIXME: extF80_lt_quiet (broken)
1055check-softfloat-lt_quiet: $(FP_TEST_BIN)
1056 $(call test-softfloat, \
1057 f16_lt_quiet f32_lt_quiet f64_lt_quiet \
1058 f128_lt_quiet, \
1059 lt_quiet)
1060
1061.PHONY: check-softfloat-compare
1062check-softfloat-compare: $(SF_COMPARE_RULES)
1063
1064# Math Operations
1065
1066# FIXME: extF80_mulAdd (missing)
1067check-softfloat-mulAdd: $(FP_TEST_BIN)
1068 $(call test-softfloat, \
1069 f16_mulAdd f32_mulAdd f64_mulAdd f128_mulAdd, \
bf30e866 1070 mulAdd,-l 1)
2cade3d7
AB
1071
1072# FIXME: extF80_rem (broken)
1073check-softfloat-rem: $(FP_TEST_BIN)
1074 $(call test-softfloat, \
1075 f16_rem f32_rem f64_rem f128_rem, \
1076 rem)
1077
1078SF_MATH_OPS=add sub mul mulAdd div rem sqrt
1079SF_MATH_RULES=$(patsubst %,check-softfloat-%, $(SF_MATH_OPS))
1080
1081.PHONY: check-softfloat-ops
1082check-softfloat-ops: $(SF_MATH_RULES)
1083
76170102
AB
1084# Finally a generic rule to test all of softfoat. If TCG isnt't
1085# enabled we define a null operation which skips the tests.
1086
1087.PHONY: check-softfloat
1088ifeq ($(CONFIG_TCG),y)
1089check-softfloat: check-softfloat-conv check-softfloat-compare check-softfloat-ops
1090else
1091check-softfloat:
1092 $(call quiet-command, /bin/true, "FLOAT TEST", \
1093 "SKIPPED for non-TCG builds")
1094endif
1095
3089e74e
AB
1096# Plugins
1097ifeq ($(CONFIG_PLUGIN),y)
1098.PHONY: plugins
1099plugins:
1100 $(call quiet-command,\
1101 $(MAKE) $(SUBDIR_MAKEFLAGS) -C tests/plugin V="$(V)", \
1102 "BUILD", "plugins")
1103endif
1104
8ba0a820
AB
1105# Per guest TCG tests
1106
e24e66f0
AB
1107BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS))
1108CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TARGET_DIRS))
1109RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TARGET_DIRS))
8ba0a820 1110
1a7fab92 1111# Probe for the Docker Builds needed for each build
2b1f35b9 1112$(foreach PROBE_TARGET,$(TARGET_DIRS), \
fc76c56d 1113 $(eval -include $(SRC_PATH)/tests/tcg/Makefile.prereqs))
1a7fab92 1114
3089e74e 1115build-tcg-tests-%: $(if $(CONFIG_PLUGIN),plugins)
fc76c56d
PB
1116 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
1117 -f $(SRC_PATH)/tests/tcg/Makefile.qemu \
1118 SRC_PATH=$(SRC_PATH) \
2038f8c8 1119 V="$(V)" TARGET="$*" guest-tests, \
cff54773 1120 "BUILD", "TCG tests for $*")
8ba0a820 1121
fc76c56d
PB
1122run-tcg-tests-%: build-tcg-tests-% %/all
1123 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
1124 -f $(SRC_PATH)/tests/tcg/Makefile.qemu \
1125 SRC_PATH=$(SRC_PATH) SPEED="$(SPEED)" \
2038f8c8 1126 V="$(V)" TARGET="$*" run-guest-tests, \
cff54773 1127 "RUN", "TCG tests for $*")
8ba0a820
AB
1128
1129clean-tcg-tests-%:
fc76c56d
PB
1130 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
1131 -f $(SRC_PATH)/tests/tcg/Makefile.qemu \
2038f8c8 1132 SRC_PATH=$(SRC_PATH) TARGET="$*" clean-guest-tests, \
dda60da3 1133 "CLEAN", "TCG tests for $*")
8ba0a820
AB
1134
1135.PHONY: build-tcg
1136build-tcg: $(BUILD_TCG_TARGET_RULES)
1137
1138.PHONY: check-tcg
df2bb38e 1139check-tcg: $(RUN_TCG_TARGET_RULES)
8ba0a820
AB
1140
1141.PHONY: clean-tcg
1142clean-tcg: $(CLEAN_TCG_TARGET_RULES)
b93b63f5
PB
1143
1144# Other tests
1145
206d1b9c 1146QEMU_IOTESTS_HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = tests/qemu-iotests/socket_scm_helper$(EXESUF)
22ee5a55 1147
bdd95e47
TH
1148.PHONY: check-tests/check-block.sh
1149check-tests/check-block.sh: tests/check-block.sh qemu-img$(EXESUF) \
1150 qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) \
1151 $(patsubst %,%/all,$(filter %-softmmu,$(TARGET_DIRS)))
3fb643c3 1152 @$<
b93b63f5 1153
f01338cc
MA
1154.PHONY: check-tests/qapi-schema/frontend
1155check-tests/qapi-schema/frontend: $(addprefix $(SRC_PATH)/, $(check-qapi-schema-y))
0a607749 1156 $(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts \
f01338cc
MA
1157 PYTHONIOENCODING=utf-8 $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py $^, \
1158 TEST, check-qapi-schema)
98626572 1159
80d1f2e4
MA
1160.PHONY: check-tests/qapi-schema/doc-good.texi
1161check-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi
02e3092d 1162 @diff -u $(SRC_PATH)/tests/qapi-schema/doc-good.texi $<
80d1f2e4 1163
568ae7ef
RH
1164.PHONY: check-decodetree
1165check-decodetree:
1166 $(call quiet-command, \
1167 cd $(SRC_PATH)/tests/decode && \
1168 ./check.sh "$(PYTHON)" "$(SRC_PATH)/scripts/decodetree.py", \
1169 TEST, decodetree.py)
1170
21313721
CR
1171# Python venv for running tests
1172
a56931ee 1173.PHONY: check-venv check-acceptance
21313721
CR
1174
1175TESTS_VENV_DIR=$(BUILD_DIR)/tests/venv
1176TESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt
a56931ee
CR
1177TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
1178# Controls the output generated by Avocado when running tests.
1179# Any number of command separated loggers are accepted. For more
1180# information please refer to "avocado --help".
59692a12 1181AVOCADO_SHOW=app
b194713f 1182AVOCADO_TAGS=$(patsubst %-softmmu,-t arch:%, $(filter %-softmmu,$(TARGET_DIRS)))
21313721 1183
21313721
CR
1184$(TESTS_VENV_DIR): $(TESTS_VENV_REQ)
1185 $(call quiet-command, \
1186 $(PYTHON) -m venv --system-site-packages $@, \
1187 VENV, $@)
1188 $(call quiet-command, \
1189 $(TESTS_VENV_DIR)/bin/python -m pip -q install -r $(TESTS_VENV_REQ), \
1190 PIP, $(TESTS_VENV_REQ))
1191 $(call quiet-command, touch $@)
21313721 1192
a56931ee
CR
1193$(TESTS_RESULTS_DIR):
1194 $(call quiet-command, mkdir -p $@, \
1195 MKDIR, $@)
1196
21313721
CR
1197check-venv: $(TESTS_VENV_DIR)
1198
a56931ee
CR
1199check-acceptance: check-venv $(TESTS_RESULTS_DIR)
1200 $(call quiet-command, \
1201 $(TESTS_VENV_DIR)/bin/python -m avocado \
1202 --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
b194713f
CR
1203 --filter-by-tags-include-empty --filter-by-tags-include-empty-key \
1204 $(AVOCADO_TAGS) \
2d320ad1 1205 --failfast=on tests/acceptance, \
a56931ee
CR
1206 "AVOCADO", "tests/acceptance")
1207
b93b63f5
PB
1208# Consolidated targets
1209
3e20c81e 1210.PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean
f01338cc 1211check-qapi-schema: check-tests/qapi-schema/frontend check-tests/qapi-schema/doc-good.texi
49ee3590 1212check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
ee6fe053 1213ifeq ($(CONFIG_TOOLS),y)
b93b63f5 1214check-block: $(patsubst %,check-%, $(check-block-y))
ee6fe053 1215endif
bdd95e47 1216check: check-block check-qapi-schema check-unit check-softfloat check-qtest check-decodetree
2cdfb123 1217check-clean:
1e8a1fae
TH
1218 rm -rf $(check-unit-y) tests/*.o tests/*/*.o $(QEMU_IOTESTS_HELPERS-y)
1219 rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y:%=tests/qtest/%$(EXESUF))) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)))
fb0bc835 1220 rm -f tests/test-qapi-gen-timestamp
1e8a1fae 1221 rm -f tests/qtest/dbus-vmstate1-gen-timestamp
a56931ee 1222 rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR)
2cdfb123
WX
1223
1224clean: check-clean
14117c7b 1225
22ee5a55
WX
1226# Build the help program automatically
1227
1228all: $(QEMU_IOTESTS_HELPERS-y)
1229
14117c7b 1230-include $(wildcard tests/*.d)
1e8a1fae 1231-include $(wildcard tests/qtest/*.d)
db2b5500 1232-include $(wildcard tests/libqos/*.d)
e45eaef9
FZ
1233
1234endif