xref: /openbmc/qemu/tests/Makefile.include (revision 7a2334f7)
146e7b706SFam Zhengexport SRC_PATH
246e7b706SFam Zheng
346e7b706SFam Zhengqapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
446e7b706SFam Zheng
546e7b706SFam Zheng# Get the list of all supported sysemu targets
646e7b706SFam ZhengSYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
746e7b706SFam Zheng   $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak)))
846e7b706SFam Zheng
946e7b706SFam Zhengcheck-unit-y = tests/check-qdict$(EXESUF)
1046e7b706SFam Zhenggcov-files-check-qdict-y = qobject/qdict.c
1146e7b706SFam Zhengcheck-unit-y += tests/check-qfloat$(EXESUF)
1246e7b706SFam Zhenggcov-files-check-qfloat-y = qobject/qfloat.c
1346e7b706SFam Zhengcheck-unit-y += tests/check-qint$(EXESUF)
1446e7b706SFam Zhenggcov-files-check-qint-y = qobject/qint.c
1546e7b706SFam Zhengcheck-unit-y += tests/check-qstring$(EXESUF)
1646e7b706SFam Zhenggcov-files-check-qstring-y = qobject/qstring.c
1746e7b706SFam Zhengcheck-unit-y += tests/check-qlist$(EXESUF)
1846e7b706SFam Zhenggcov-files-check-qlist-y = qobject/qlist.c
1946e7b706SFam Zhengcheck-unit-y += tests/check-qnull$(EXESUF)
2046e7b706SFam Zhenggcov-files-check-qnull-y = qobject/qnull.c
2146e7b706SFam Zhengcheck-unit-y += tests/check-qjson$(EXESUF)
2246e7b706SFam Zhenggcov-files-check-qjson-y = qobject/qjson.c
2346e7b706SFam Zhengcheck-unit-y += tests/test-qmp-output-visitor$(EXESUF)
2446e7b706SFam Zhenggcov-files-test-qmp-output-visitor-y = qapi/qmp-output-visitor.c
25a15fcc3cSEric Blakecheck-unit-y += tests/test-clone-visitor$(EXESUF)
26a15fcc3cSEric Blakegcov-files-test-clone-visitor-y = qapi/qapi-clone-visitor.c
2746e7b706SFam Zhengcheck-unit-y += tests/test-qmp-input-visitor$(EXESUF)
2846e7b706SFam Zhenggcov-files-test-qmp-input-visitor-y = qapi/qmp-input-visitor.c
2946e7b706SFam Zhengcheck-unit-y += tests/test-qmp-input-strict$(EXESUF)
3046e7b706SFam Zhengcheck-unit-y += tests/test-qmp-commands$(EXESUF)
3146e7b706SFam Zhenggcov-files-test-qmp-commands-y = qapi/qmp-dispatch.c
3246e7b706SFam Zhengcheck-unit-y += tests/test-string-input-visitor$(EXESUF)
3346e7b706SFam Zhenggcov-files-test-string-input-visitor-y = qapi/string-input-visitor.c
3446e7b706SFam Zhengcheck-unit-y += tests/test-string-output-visitor$(EXESUF)
3546e7b706SFam Zhenggcov-files-test-string-output-visitor-y = qapi/string-output-visitor.c
3646e7b706SFam Zhengcheck-unit-y += tests/test-qmp-event$(EXESUF)
3746e7b706SFam Zhenggcov-files-test-qmp-event-y += qapi/qmp-event.c
3846e7b706SFam Zhengcheck-unit-y += tests/test-opts-visitor$(EXESUF)
3946e7b706SFam Zhenggcov-files-test-opts-visitor-y = qapi/opts-visitor.c
4046e7b706SFam Zhengcheck-unit-y += tests/test-coroutine$(EXESUF)
4146e7b706SFam Zhenggcov-files-test-coroutine-y = coroutine-$(CONFIG_COROUTINE_BACKEND).c
4246e7b706SFam Zhengcheck-unit-y += tests/test-visitor-serialization$(EXESUF)
4346e7b706SFam Zhengcheck-unit-y += tests/test-iov$(EXESUF)
4446e7b706SFam Zhenggcov-files-test-iov-y = util/iov.c
4546e7b706SFam Zhengcheck-unit-y += tests/test-aio$(EXESUF)
4646e7b706SFam Zhengcheck-unit-$(CONFIG_POSIX) += tests/test-rfifolock$(EXESUF)
4746e7b706SFam Zhengcheck-unit-y += tests/test-throttle$(EXESUF)
4846e7b706SFam Zhenggcov-files-test-aio-$(CONFIG_WIN32) = aio-win32.c
4946e7b706SFam Zhenggcov-files-test-aio-$(CONFIG_POSIX) = aio-posix.c
5046e7b706SFam Zhengcheck-unit-y += tests/test-thread-pool$(EXESUF)
5146e7b706SFam Zhenggcov-files-test-thread-pool-y = thread-pool.c
5246e7b706SFam Zhenggcov-files-test-hbitmap-y = util/hbitmap.c
5346e7b706SFam Zhengcheck-unit-y += tests/test-hbitmap$(EXESUF)
5446e7b706SFam Zhenggcov-files-test-hbitmap-y = blockjob.c
559ef8112aSAlberto Garciacheck-unit-y += tests/test-blockjob$(EXESUF)
5646e7b706SFam Zhengcheck-unit-y += tests/test-blockjob-txn$(EXESUF)
5746e7b706SFam Zhengcheck-unit-y += tests/test-x86-cpuid$(EXESUF)
5846e7b706SFam Zheng# all code tested by test-x86-cpuid is inside topology.h
5946e7b706SFam Zhenggcov-files-test-x86-cpuid-y =
6046e7b706SFam Zhengifeq ($(CONFIG_SOFTMMU),y)
6146e7b706SFam Zhengcheck-unit-y += tests/test-xbzrle$(EXESUF)
6246e7b706SFam Zhenggcov-files-test-xbzrle-y = migration/xbzrle.c
6346e7b706SFam Zhengcheck-unit-$(CONFIG_POSIX) += tests/test-vmstate$(EXESUF)
6446e7b706SFam Zhengendif
6546e7b706SFam Zhengcheck-unit-y += tests/test-cutils$(EXESUF)
6646e7b706SFam Zhenggcov-files-test-cutils-y += util/cutils.c
6746e7b706SFam Zhengcheck-unit-y += tests/test-mul64$(EXESUF)
6846e7b706SFam Zhenggcov-files-test-mul64-y = util/host-utils.c
6946e7b706SFam Zhengcheck-unit-y += tests/test-int128$(EXESUF)
7046e7b706SFam Zheng# all code tested by test-int128 is inside int128.h
7146e7b706SFam Zhenggcov-files-test-int128-y =
7246e7b706SFam Zhengcheck-unit-y += tests/rcutorture$(EXESUF)
7346e7b706SFam Zhenggcov-files-rcutorture-y = util/rcu.c
7446e7b706SFam Zhengcheck-unit-y += tests/test-rcu-list$(EXESUF)
7546e7b706SFam Zhenggcov-files-test-rcu-list-y = util/rcu.c
76ff9249b7SEmilio G. Cotacheck-unit-y += tests/test-qdist$(EXESUF)
77ff9249b7SEmilio G. Cotagcov-files-test-qdist-y = util/qdist.c
781a95404fSEmilio G. Cotacheck-unit-y += tests/test-qht$(EXESUF)
791a95404fSEmilio G. Cotagcov-files-test-qht-y = util/qht.c
80896a9ee9SEmilio G. Cotacheck-unit-y += tests/test-qht-par$(EXESUF)
81896a9ee9SEmilio G. Cotagcov-files-test-qht-par-y = util/qht.c
8246e7b706SFam Zhengcheck-unit-y += tests/test-bitops$(EXESUF)
8346e7b706SFam Zhengcheck-unit-$(CONFIG_HAS_GLIB_SUBPROCESS_TESTS) += tests/test-qdev-global-props$(EXESUF)
8446e7b706SFam Zhengcheck-unit-y += tests/check-qom-interface$(EXESUF)
8546e7b706SFam Zhenggcov-files-check-qom-interface-y = qom/object.c
8646e7b706SFam Zhengcheck-unit-y += tests/check-qom-proplist$(EXESUF)
8746e7b706SFam Zhenggcov-files-check-qom-proplist-y = qom/object.c
8846e7b706SFam Zhengcheck-unit-y += tests/test-qemu-opts$(EXESUF)
8946e7b706SFam Zhenggcov-files-test-qemu-opts-y = qom/test-qemu-opts.c
9046e7b706SFam Zhengcheck-unit-y += tests/test-write-threshold$(EXESUF)
9146e7b706SFam Zhenggcov-files-test-write-threshold-y = block/write-threshold.c
920c16c056SDaniel P. Berrangecheck-unit-y += tests/test-crypto-hash$(EXESUF)
9346e7b706SFam Zhengcheck-unit-y += tests/test-crypto-cipher$(EXESUF)
9446e7b706SFam Zhengcheck-unit-y += tests/test-crypto-secret$(EXESUF)
9546e7b706SFam Zhengcheck-unit-$(CONFIG_GNUTLS) += tests/test-crypto-tlscredsx509$(EXESUF)
9646e7b706SFam Zhengcheck-unit-$(CONFIG_GNUTLS) += tests/test-crypto-tlssession$(EXESUF)
9746e7b706SFam Zhengifneq (,$(findstring qemu-ga,$(TOOLS)))
9846e7b706SFam Zhengcheck-unit-$(CONFIG_LINUX) += tests/test-qga$(EXESUF)
9946e7b706SFam Zhengendif
10046e7b706SFam Zhengcheck-unit-y += tests/test-timed-average$(EXESUF)
10146e7b706SFam Zhengcheck-unit-y += tests/test-io-task$(EXESUF)
10246e7b706SFam Zhengcheck-unit-y += tests/test-io-channel-socket$(EXESUF)
10346e7b706SFam Zhengcheck-unit-y += tests/test-io-channel-file$(EXESUF)
10446e7b706SFam Zhengcheck-unit-$(CONFIG_GNUTLS) += tests/test-io-channel-tls$(EXESUF)
10546e7b706SFam Zhengcheck-unit-y += tests/test-io-channel-command$(EXESUF)
10646e7b706SFam Zhengcheck-unit-y += tests/test-io-channel-buffer$(EXESUF)
10746e7b706SFam Zhengcheck-unit-y += tests/test-base64$(EXESUF)
10846e7b706SFam Zhengcheck-unit-$(if $(CONFIG_NETTLE_KDF),y,$(CONFIG_GCRYPT_KDF)) += tests/test-crypto-pbkdf$(EXESUF)
10946e7b706SFam Zhengcheck-unit-y += tests/test-crypto-ivgen$(EXESUF)
11046e7b706SFam Zhengcheck-unit-y += tests/test-crypto-afsplit$(EXESUF)
11146e7b706SFam Zhengcheck-unit-y += tests/test-crypto-xts$(EXESUF)
11246e7b706SFam Zhengcheck-unit-y += tests/test-crypto-block$(EXESUF)
11346e7b706SFam Zhenggcov-files-test-logging-y = tests/test-logging.c
11446e7b706SFam Zhengcheck-unit-y += tests/test-logging$(EXESUF)
115b3110466SChanglong Xiecheck-unit-$(CONFIG_REPLICATION) += tests/test-replication$(EXESUF)
116efad6682SRichard Hendersoncheck-unit-y += tests/test-bufferiszero$(EXESUF)
117efad6682SRichard Hendersongcov-files-check-bufferiszero-y = util/bufferiszero.c
118c739cdddSFam Zhengcheck-unit-y += tests/test-uuid$(EXESUF)
11946e7b706SFam Zheng
12046e7b706SFam Zhengcheck-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
12146e7b706SFam Zheng
12246e7b706SFam Zheng# All QTests for now are POSIX-only, but the dependencies are
12346e7b706SFam Zheng# really in libqtest, not in the testcases themselves.
12446e7b706SFam Zheng
12546e7b706SFam Zhengcheck-qtest-generic-y = tests/device-introspect-test$(EXESUF)
12646e7b706SFam Zhenggcov-files-generic-y = qdev-monitor.c qmp.c
12746e7b706SFam Zheng
12846e7b706SFam Zhenggcov-files-ipack-y += hw/ipack/ipack.c
12946e7b706SFam Zhengcheck-qtest-ipack-y += tests/ipoctal232-test$(EXESUF)
13046e7b706SFam Zhenggcov-files-ipack-y += hw/char/ipoctal232.c
13146e7b706SFam Zheng
13246e7b706SFam Zhengcheck-qtest-virtioserial-y += tests/virtio-console-test$(EXESUF)
13346e7b706SFam Zhenggcov-files-virtioserial-y += hw/char/virtio-console.c
13446e7b706SFam Zheng
13546e7b706SFam Zhenggcov-files-virtio-y += i386-softmmu/hw/virtio/virtio.c
13646e7b706SFam Zhengcheck-qtest-virtio-y += tests/virtio-net-test$(EXESUF)
13746e7b706SFam Zhenggcov-files-virtio-y += i386-softmmu/hw/net/virtio-net.c
13846e7b706SFam Zhengcheck-qtest-virtio-y += tests/virtio-balloon-test$(EXESUF)
13946e7b706SFam Zhenggcov-files-virtio-y += i386-softmmu/hw/virtio/virtio-balloon.c
14046e7b706SFam Zhengcheck-qtest-virtio-y += tests/virtio-blk-test$(EXESUF)
14146e7b706SFam Zhenggcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c
14246e7b706SFam Zhengcheck-qtest-virtio-y += tests/virtio-rng-test$(EXESUF)
14346e7b706SFam Zhenggcov-files-virtio-y += hw/virtio/virtio-rng.c
14446e7b706SFam Zhengcheck-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF)
14546e7b706SFam Zhenggcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c
14646e7b706SFam Zhengifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
14746e7b706SFam Zhengcheck-qtest-virtio-y += tests/virtio-9p-test$(EXESUF)
14846e7b706SFam Zhenggcov-files-virtio-y += hw/9pfs/virtio-9p.c
14946e7b706SFam Zhenggcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c
15046e7b706SFam Zhengendif
15146e7b706SFam Zhengcheck-qtest-virtio-y += tests/virtio-serial-test$(EXESUF)
15246e7b706SFam Zhenggcov-files-virtio-y += i386-softmmu/hw/char/virtio-serial-bus.c
15346e7b706SFam Zhengcheck-qtest-virtio-y += $(check-qtest-virtioserial-y)
15446e7b706SFam Zhenggcov-files-virtio-y += $(gcov-files-virtioserial-y)
15546e7b706SFam Zheng
15646e7b706SFam Zhengcheck-qtest-pci-y += tests/e1000-test$(EXESUF)
15746e7b706SFam Zhenggcov-files-pci-y += hw/net/e1000.c
15846e7b706SFam Zhengcheck-qtest-pci-y += tests/e1000e-test$(EXESUF)
15946e7b706SFam Zhenggcov-files-pci-y += hw/net/e1000e.c hw/net/e1000e_core.c
16046e7b706SFam Zhengcheck-qtest-pci-y += tests/rtl8139-test$(EXESUF)
16146e7b706SFam Zhenggcov-files-pci-y += hw/net/rtl8139.c
16246e7b706SFam Zhengcheck-qtest-pci-y += tests/pcnet-test$(EXESUF)
16346e7b706SFam Zhenggcov-files-pci-y += hw/net/pcnet.c
16446e7b706SFam Zhenggcov-files-pci-y += hw/net/pcnet-pci.c
16546e7b706SFam Zhengcheck-qtest-pci-y += tests/eepro100-test$(EXESUF)
16646e7b706SFam Zhenggcov-files-pci-y += hw/net/eepro100.c
16746e7b706SFam Zhengcheck-qtest-pci-y += tests/ne2000-test$(EXESUF)
16846e7b706SFam Zhenggcov-files-pci-y += hw/net/ne2000.c
16946e7b706SFam Zhengcheck-qtest-pci-y += tests/nvme-test$(EXESUF)
17046e7b706SFam Zhenggcov-files-pci-y += hw/block/nvme.c
17146e7b706SFam Zhengcheck-qtest-pci-y += tests/ac97-test$(EXESUF)
17246e7b706SFam Zhenggcov-files-pci-y += hw/audio/ac97.c
17346e7b706SFam Zhengcheck-qtest-pci-y += tests/es1370-test$(EXESUF)
17446e7b706SFam Zhenggcov-files-pci-y += hw/audio/es1370.c
17546e7b706SFam Zhengcheck-qtest-pci-y += $(check-qtest-virtio-y)
17646e7b706SFam Zhenggcov-files-pci-y += $(gcov-files-virtio-y) hw/virtio/virtio-pci.c
17746e7b706SFam Zhengcheck-qtest-pci-y += tests/tpci200-test$(EXESUF)
17846e7b706SFam Zhenggcov-files-pci-y += hw/ipack/tpci200.c
17946e7b706SFam Zhengcheck-qtest-pci-y += $(check-qtest-ipack-y)
18046e7b706SFam Zhenggcov-files-pci-y += $(gcov-files-ipack-y)
18146e7b706SFam Zhengcheck-qtest-pci-y += tests/display-vga-test$(EXESUF)
18246e7b706SFam Zhenggcov-files-pci-y += hw/display/vga.c
18346e7b706SFam Zhenggcov-files-pci-y += hw/display/cirrus_vga.c
18446e7b706SFam Zhenggcov-files-pci-y += hw/display/vga-pci.c
18546e7b706SFam Zhenggcov-files-pci-y += hw/display/virtio-gpu.c
18646e7b706SFam Zhenggcov-files-pci-y += hw/display/virtio-gpu-pci.c
18746e7b706SFam Zhenggcov-files-pci-$(CONFIG_VIRTIO_VGA) += hw/display/virtio-vga.c
18846e7b706SFam Zhengcheck-qtest-pci-y += tests/intel-hda-test$(EXESUF)
18946e7b706SFam Zhenggcov-files-pci-y += hw/audio/intel-hda.c hw/audio/hda-codec.c
19046e7b706SFam Zhengcheck-qtest-pci-$(CONFIG_EVENTFD) += tests/ivshmem-test$(EXESUF)
19146e7b706SFam Zhenggcov-files-pci-y += hw/misc/ivshmem.c
19246e7b706SFam Zheng
19346e7b706SFam Zhengcheck-qtest-i386-y = tests/endianness-test$(EXESUF)
19446e7b706SFam Zhengcheck-qtest-i386-y += tests/fdc-test$(EXESUF)
19546e7b706SFam Zhenggcov-files-i386-y = hw/block/fdc.c
19646e7b706SFam Zhengcheck-qtest-i386-y += tests/ide-test$(EXESUF)
19746e7b706SFam Zhengcheck-qtest-i386-y += tests/ahci-test$(EXESUF)
19846e7b706SFam Zhengcheck-qtest-i386-y += tests/hd-geo-test$(EXESUF)
19946e7b706SFam Zhenggcov-files-i386-y += hw/block/hd-geometry.c
20046e7b706SFam Zhengcheck-qtest-i386-y += tests/boot-order-test$(EXESUF)
20146e7b706SFam Zhengcheck-qtest-i386-y += tests/bios-tables-test$(EXESUF)
202d2ab58ffSThomas Huthcheck-qtest-i386-y += tests/boot-serial-test$(EXESUF)
20346e7b706SFam Zhengcheck-qtest-i386-y += tests/pxe-test$(EXESUF)
20446e7b706SFam Zhengcheck-qtest-i386-y += tests/rtc-test$(EXESUF)
20546e7b706SFam Zhengcheck-qtest-i386-y += tests/ipmi-kcs-test$(EXESUF)
20646e7b706SFam Zhengcheck-qtest-i386-y += tests/ipmi-bt-test$(EXESUF)
20746e7b706SFam Zhengcheck-qtest-i386-y += tests/i440fx-test$(EXESUF)
20846e7b706SFam Zhengcheck-qtest-i386-y += tests/fw_cfg-test$(EXESUF)
20946e7b706SFam Zhengcheck-qtest-i386-y += tests/drive_del-test$(EXESUF)
21046e7b706SFam Zhengcheck-qtest-i386-y += tests/wdt_ib700-test$(EXESUF)
21146e7b706SFam Zhengcheck-qtest-i386-y += tests/tco-test$(EXESUF)
21246e7b706SFam Zhenggcov-files-i386-y += hw/watchdog/watchdog.c hw/watchdog/wdt_ib700.c
21346e7b706SFam Zhengcheck-qtest-i386-y += $(check-qtest-pci-y)
21446e7b706SFam Zhenggcov-files-i386-y += $(gcov-files-pci-y)
21546e7b706SFam Zhengcheck-qtest-i386-y += tests/vmxnet3-test$(EXESUF)
21646e7b706SFam Zhenggcov-files-i386-y += hw/net/vmxnet3.c
21746e7b706SFam Zhenggcov-files-i386-y += hw/net/net_rx_pkt.c
21846e7b706SFam Zhenggcov-files-i386-y += hw/net/net_tx_pkt.c
21946e7b706SFam Zhengcheck-qtest-i386-y += tests/pvpanic-test$(EXESUF)
22046e7b706SFam Zhenggcov-files-i386-y += i386-softmmu/hw/misc/pvpanic.c
22146e7b706SFam Zhengcheck-qtest-i386-y += tests/i82801b11-test$(EXESUF)
22246e7b706SFam Zhenggcov-files-i386-y += hw/pci-bridge/i82801b11.c
22346e7b706SFam Zhengcheck-qtest-i386-y += tests/ioh3420-test$(EXESUF)
22446e7b706SFam Zhenggcov-files-i386-y += hw/pci-bridge/ioh3420.c
22546e7b706SFam Zhengcheck-qtest-i386-y += tests/usb-hcd-ohci-test$(EXESUF)
22646e7b706SFam Zhenggcov-files-i386-y += hw/usb/hcd-ohci.c
22746e7b706SFam Zhengcheck-qtest-i386-y += tests/usb-hcd-uhci-test$(EXESUF)
22846e7b706SFam Zhenggcov-files-i386-y += hw/usb/hcd-uhci.c
22946e7b706SFam Zhengcheck-qtest-i386-y += tests/usb-hcd-ehci-test$(EXESUF)
23046e7b706SFam Zhenggcov-files-i386-y += hw/usb/hcd-ehci.c
23146e7b706SFam Zhenggcov-files-i386-y += hw/usb/dev-hid.c
23246e7b706SFam Zhenggcov-files-i386-y += hw/usb/dev-storage.c
23346e7b706SFam Zhengcheck-qtest-i386-y += tests/usb-hcd-xhci-test$(EXESUF)
23446e7b706SFam Zhenggcov-files-i386-y += hw/usb/hcd-xhci.c
23546e7b706SFam Zhengcheck-qtest-i386-y += tests/pc-cpu-test$(EXESUF)
23646e7b706SFam Zhengcheck-qtest-i386-y += tests/q35-test$(EXESUF)
23746e7b706SFam Zhenggcov-files-i386-y += hw/pci-host/q35.c
23846e7b706SFam Zhengcheck-qtest-i386-$(CONFIG_VHOST_NET_TEST_i386) += tests/vhost-user-test$(EXESUF)
23946e7b706SFam Zhengifeq ($(CONFIG_VHOST_NET_TEST_i386),)
24046e7b706SFam Zhengcheck-qtest-x86_64-$(CONFIG_VHOST_NET_TEST_x86_64) += tests/vhost-user-test$(EXESUF)
24146e7b706SFam Zhengendif
24246e7b706SFam Zhengcheck-qtest-i386-y += tests/test-netfilter$(EXESUF)
24346e7b706SFam Zhengcheck-qtest-i386-y += tests/test-filter-mirror$(EXESUF)
24446e7b706SFam Zhengcheck-qtest-i386-y += tests/test-filter-redirector$(EXESUF)
245ea0c6d62SDr. David Alan Gilbertcheck-qtest-i386-y += tests/postcopy-test$(EXESUF)
2466efef58eSEduardo Habkostcheck-qtest-i386-y += tests/test-x86-cpuid-compat$(EXESUF)
2470ee2e9daSMarc-André Lureaucheck-qtest-x86_64-y += $(check-qtest-i386-y)
24846e7b706SFam Zhenggcov-files-i386-y += i386-softmmu/hw/timer/mc146818rtc.c
24946e7b706SFam Zhenggcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
25029531542SThomas Huth
251d2ab58ffSThomas Huthcheck-qtest-alpha-y = tests/boot-serial-test$(EXESUF)
252d2ab58ffSThomas Huth
25346e7b706SFam Zhengcheck-qtest-mips-y = tests/endianness-test$(EXESUF)
25429531542SThomas Huth
25546e7b706SFam Zhengcheck-qtest-mips64-y = tests/endianness-test$(EXESUF)
25629531542SThomas Huth
25746e7b706SFam Zhengcheck-qtest-mips64el-y = tests/endianness-test$(EXESUF)
25829531542SThomas Huth
25946e7b706SFam Zhengcheck-qtest-ppc-y = tests/endianness-test$(EXESUF)
26029531542SThomas Huthcheck-qtest-ppc-y += tests/boot-order-test$(EXESUF)
26129531542SThomas Huthcheck-qtest-ppc-y += tests/prom-env-test$(EXESUF)
26229531542SThomas Huthcheck-qtest-ppc-y += tests/drive_del-test$(EXESUF)
263d2ab58ffSThomas Huthcheck-qtest-ppc-y += tests/boot-serial-test$(EXESUF)
26429531542SThomas Huth
26529531542SThomas Huthcheck-qtest-ppc64-y = tests/spapr-phb-test$(EXESUF)
26629531542SThomas Huthgcov-files-ppc64-y = ppc64-softmmu/hw/ppc/spapr_pci.c
26729531542SThomas Huthcheck-qtest-ppc64-y += tests/endianness-test$(EXESUF)
26829531542SThomas Huthcheck-qtest-ppc64-y += tests/boot-order-test$(EXESUF)
26929531542SThomas Huthcheck-qtest-ppc64-y += tests/prom-env-test$(EXESUF)
27029531542SThomas Huthcheck-qtest-ppc64-y += tests/drive_del-test$(EXESUF)
27129531542SThomas Huthcheck-qtest-ppc64-y += tests/postcopy-test$(EXESUF)
272d2ab58ffSThomas Huthcheck-qtest-ppc64-y += tests/boot-serial-test$(EXESUF)
273eeddd59fSLaurent Viviercheck-qtest-ppc64-y += tests/rtas-test$(EXESUF)
2741485ef1cSThomas Huthcheck-qtest-ppc64-y += tests/pxe-test$(EXESUF)
275aa9026fdSLaurent Viviercheck-qtest-ppc64-y += tests/usb-hcd-ohci-test$(EXESUF)
276aa9026fdSLaurent Viviergcov-files-ppc64-y += hw/usb/hcd-ohci.c
277aa9026fdSLaurent Viviercheck-qtest-ppc64-y += tests/usb-hcd-uhci-test$(EXESUF)
278aa9026fdSLaurent Viviergcov-files-ppc64-y += hw/usb/hcd-uhci.c
279aa9026fdSLaurent Viviercheck-qtest-ppc64-y += tests/usb-hcd-xhci-test$(EXESUF)
280aa9026fdSLaurent Viviergcov-files-ppc64-y += hw/usb/hcd-xhci.c
28129531542SThomas Huth
28246e7b706SFam Zhengcheck-qtest-sh4-y = tests/endianness-test$(EXESUF)
28329531542SThomas Huth
28446e7b706SFam Zhengcheck-qtest-sh4eb-y = tests/endianness-test$(EXESUF)
28529531542SThomas Huth
28629531542SThomas Huthcheck-qtest-sparc-y = tests/prom-env-test$(EXESUF)
28729531542SThomas Huth#check-qtest-sparc-y += tests/m48t59-test$(EXESUF)
28829531542SThomas Huth#gcov-files-sparc-y = hw/timer/m48t59.c
28929531542SThomas Huth
29046e7b706SFam Zhengcheck-qtest-sparc64-y = tests/endianness-test$(EXESUF)
29146e7b706SFam Zheng#check-qtest-sparc64-y += tests/m48t59-test$(EXESUF)
29229531542SThomas Huth#gcov-files-sparc64-y += hw/timer/m48t59.c
29329531542SThomas Huth#Disabled for now, triggers a TCG bug on 32-bit hosts
29429531542SThomas Huth#check-qtest-sparc64-y += tests/prom-env-test$(EXESUF)
29529531542SThomas Huth
29646e7b706SFam Zhengcheck-qtest-arm-y = tests/tmp105-test$(EXESUF)
2971f5c1cfbSThomas Huthcheck-qtest-arm-y += tests/ds1338-test$(EXESUF)
298*7a2334f7SCédric Le Goatercheck-qtest-arm-y += tests/m25p80-test$(EXESUF)
29946e7b706SFam Zhenggcov-files-arm-y += hw/misc/tmp105.c
30046e7b706SFam Zhengcheck-qtest-arm-y += tests/virtio-blk-test$(EXESUF)
30146e7b706SFam Zhenggcov-files-arm-y += arm-softmmu/hw/block/virtio-blk.c
30229531542SThomas Huth
30346e7b706SFam Zhengcheck-qtest-microblazeel-y = $(check-qtest-microblaze-y)
30429531542SThomas Huth
30546e7b706SFam Zhengcheck-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
30646e7b706SFam Zheng
307d2ab58ffSThomas Huthcheck-qtest-s390x-y = tests/boot-serial-test$(EXESUF)
308d2ab58ffSThomas Huth
30946e7b706SFam Zhengcheck-qtest-generic-y += tests/qom-test$(EXESUF)
3105b262bb6SDmitry Osipenkocheck-qtest-generic-y += tests/ptimer-test$(EXESUF)
31146e7b706SFam Zheng
31246e7b706SFam Zhengqapi-schema += alternate-any.json
31346e7b706SFam Zhengqapi-schema += alternate-array.json
31446e7b706SFam Zhengqapi-schema += alternate-base.json
31546e7b706SFam Zhengqapi-schema += alternate-clash.json
31646e7b706SFam Zhengqapi-schema += alternate-conflict-dict.json
31746e7b706SFam Zhengqapi-schema += alternate-conflict-string.json
31846e7b706SFam Zhengqapi-schema += alternate-empty.json
31946e7b706SFam Zhengqapi-schema += alternate-nested.json
32046e7b706SFam Zhengqapi-schema += alternate-unknown.json
32146e7b706SFam Zhengqapi-schema += args-alternate.json
32246e7b706SFam Zhengqapi-schema += args-any.json
32346e7b706SFam Zhengqapi-schema += args-array-empty.json
32446e7b706SFam Zhengqapi-schema += args-array-unknown.json
325c818408eSEric Blakeqapi-schema += args-bad-boxed.json
326c818408eSEric Blakeqapi-schema += args-boxed-anon.json
327c818408eSEric Blakeqapi-schema += args-boxed-empty.json
328c818408eSEric Blakeqapi-schema += args-boxed-string.json
32946e7b706SFam Zhengqapi-schema += args-int.json
33046e7b706SFam Zhengqapi-schema += args-invalid.json
33146e7b706SFam Zhengqapi-schema += args-member-array-bad.json
33246e7b706SFam Zhengqapi-schema += args-member-case.json
33346e7b706SFam Zhengqapi-schema += args-member-unknown.json
33446e7b706SFam Zhengqapi-schema += args-name-clash.json
33546e7b706SFam Zhengqapi-schema += args-union.json
33646e7b706SFam Zhengqapi-schema += args-unknown.json
33746e7b706SFam Zhengqapi-schema += bad-base.json
33846e7b706SFam Zhengqapi-schema += bad-data.json
33946e7b706SFam Zhengqapi-schema += bad-ident.json
34046e7b706SFam Zhengqapi-schema += bad-type-bool.json
34146e7b706SFam Zhengqapi-schema += bad-type-dict.json
34246e7b706SFam Zhengqapi-schema += bad-type-int.json
34346e7b706SFam Zhengqapi-schema += base-cycle-direct.json
34446e7b706SFam Zhengqapi-schema += base-cycle-indirect.json
34546e7b706SFam Zhengqapi-schema += command-int.json
34646e7b706SFam Zhengqapi-schema += comments.json
34746e7b706SFam Zhengqapi-schema += double-data.json
34846e7b706SFam Zhengqapi-schema += double-type.json
34946e7b706SFam Zhengqapi-schema += duplicate-key.json
35046e7b706SFam Zhengqapi-schema += empty.json
35146e7b706SFam Zhengqapi-schema += enum-bad-name.json
35246e7b706SFam Zhengqapi-schema += enum-bad-prefix.json
35346e7b706SFam Zhengqapi-schema += enum-clash-member.json
35446e7b706SFam Zhengqapi-schema += enum-dict-member.json
35546e7b706SFam Zhengqapi-schema += enum-int-member.json
35646e7b706SFam Zhengqapi-schema += enum-member-case.json
35746e7b706SFam Zhengqapi-schema += enum-missing-data.json
35846e7b706SFam Zhengqapi-schema += enum-wrong-data.json
35946e7b706SFam Zhengqapi-schema += escape-outside-string.json
36046e7b706SFam Zhengqapi-schema += escape-too-big.json
36146e7b706SFam Zhengqapi-schema += escape-too-short.json
362c818408eSEric Blakeqapi-schema += event-boxed-empty.json
36346e7b706SFam Zhengqapi-schema += event-case.json
36446e7b706SFam Zhengqapi-schema += event-nest-struct.json
36546e7b706SFam Zhengqapi-schema += flat-union-array-branch.json
36646e7b706SFam Zhengqapi-schema += flat-union-bad-base.json
36746e7b706SFam Zhengqapi-schema += flat-union-bad-discriminator.json
36846e7b706SFam Zhengqapi-schema += flat-union-base-any.json
36946e7b706SFam Zhengqapi-schema += flat-union-base-union.json
37046e7b706SFam Zhengqapi-schema += flat-union-clash-member.json
37146e7b706SFam Zhengqapi-schema += flat-union-empty.json
372d0b18239SEric Blakeqapi-schema += flat-union-incomplete-branch.json
37346e7b706SFam Zhengqapi-schema += flat-union-inline.json
37446e7b706SFam Zhengqapi-schema += flat-union-int-branch.json
37546e7b706SFam Zhengqapi-schema += flat-union-invalid-branch-key.json
37646e7b706SFam Zhengqapi-schema += flat-union-invalid-discriminator.json
37746e7b706SFam Zhengqapi-schema += flat-union-no-base.json
37846e7b706SFam Zhengqapi-schema += flat-union-optional-discriminator.json
37946e7b706SFam Zhengqapi-schema += flat-union-string-discriminator.json
38046e7b706SFam Zhengqapi-schema += funny-char.json
38146e7b706SFam Zhengqapi-schema += ident-with-escape.json
38246e7b706SFam Zhengqapi-schema += include-before-err.json
38346e7b706SFam Zhengqapi-schema += include-cycle.json
38446e7b706SFam Zhengqapi-schema += include-format-err.json
38546e7b706SFam Zhengqapi-schema += include-nested-err.json
38646e7b706SFam Zhengqapi-schema += include-no-file.json
38746e7b706SFam Zhengqapi-schema += include-non-file.json
38846e7b706SFam Zhengqapi-schema += include-relpath.json
38946e7b706SFam Zhengqapi-schema += include-repetition.json
39046e7b706SFam Zhengqapi-schema += include-self-cycle.json
39146e7b706SFam Zhengqapi-schema += include-simple.json
39246e7b706SFam Zhengqapi-schema += indented-expr.json
39346e7b706SFam Zhengqapi-schema += leading-comma-list.json
39446e7b706SFam Zhengqapi-schema += leading-comma-object.json
39546e7b706SFam Zhengqapi-schema += missing-colon.json
39646e7b706SFam Zhengqapi-schema += missing-comma-list.json
39746e7b706SFam Zhengqapi-schema += missing-comma-object.json
39846e7b706SFam Zhengqapi-schema += missing-type.json
39946e7b706SFam Zhengqapi-schema += nested-struct-data.json
40046e7b706SFam Zhengqapi-schema += non-objects.json
40146e7b706SFam Zhengqapi-schema += qapi-schema-test.json
40246e7b706SFam Zhengqapi-schema += quoted-structural-chars.json
40346e7b706SFam Zhengqapi-schema += redefined-builtin.json
40446e7b706SFam Zhengqapi-schema += redefined-command.json
40546e7b706SFam Zhengqapi-schema += redefined-event.json
40646e7b706SFam Zhengqapi-schema += redefined-type.json
40746e7b706SFam Zhengqapi-schema += reserved-command-q.json
40846e7b706SFam Zhengqapi-schema += reserved-enum-q.json
40946e7b706SFam Zhengqapi-schema += reserved-member-has.json
41046e7b706SFam Zhengqapi-schema += reserved-member-q.json
41146e7b706SFam Zhengqapi-schema += reserved-member-u.json
41246e7b706SFam Zhengqapi-schema += reserved-member-underscore.json
41346e7b706SFam Zhengqapi-schema += reserved-type-kind.json
41446e7b706SFam Zhengqapi-schema += reserved-type-list.json
41546e7b706SFam Zhengqapi-schema += returns-alternate.json
41646e7b706SFam Zhengqapi-schema += returns-array-bad.json
41746e7b706SFam Zhengqapi-schema += returns-dict.json
41846e7b706SFam Zhengqapi-schema += returns-unknown.json
41946e7b706SFam Zhengqapi-schema += returns-whitelist.json
42046e7b706SFam Zhengqapi-schema += struct-base-clash-deep.json
42146e7b706SFam Zhengqapi-schema += struct-base-clash.json
42246e7b706SFam Zhengqapi-schema += struct-data-invalid.json
42346e7b706SFam Zhengqapi-schema += struct-member-invalid.json
42446e7b706SFam Zhengqapi-schema += trailing-comma-list.json
42546e7b706SFam Zhengqapi-schema += trailing-comma-object.json
42646e7b706SFam Zhengqapi-schema += type-bypass-bad-gen.json
42746e7b706SFam Zhengqapi-schema += unclosed-list.json
42846e7b706SFam Zhengqapi-schema += unclosed-object.json
42946e7b706SFam Zhengqapi-schema += unclosed-string.json
43046e7b706SFam Zhengqapi-schema += unicode-str.json
43146e7b706SFam Zhengqapi-schema += union-base-no-discriminator.json
43246e7b706SFam Zhengqapi-schema += union-branch-case.json
43346e7b706SFam Zhengqapi-schema += union-clash-branches.json
43446e7b706SFam Zhengqapi-schema += union-empty.json
43546e7b706SFam Zhengqapi-schema += union-invalid-base.json
43646e7b706SFam Zhengqapi-schema += union-optional-branch.json
43746e7b706SFam Zhengqapi-schema += union-unknown.json
43846e7b706SFam Zhengqapi-schema += unknown-escape.json
43946e7b706SFam Zhengqapi-schema += unknown-expr-key.json
44046e7b706SFam Zhengcheck-qapi-schema-y := $(addprefix tests/qapi-schema/, $(qapi-schema))
44146e7b706SFam Zheng
44246e7b706SFam ZhengGENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h \
44346e7b706SFam Zheng	tests/test-qmp-commands.h tests/test-qapi-event.h \
44446e7b706SFam Zheng	tests/test-qmp-introspect.h
44546e7b706SFam Zheng
44646e7b706SFam Zhengtest-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \
44746e7b706SFam Zheng	tests/check-qlist.o tests/check-qfloat.o tests/check-qnull.o \
44846e7b706SFam Zheng	tests/check-qjson.o \
44946e7b706SFam Zheng	tests/test-coroutine.o tests/test-string-output-visitor.o \
45046e7b706SFam Zheng	tests/test-string-input-visitor.o tests/test-qmp-output-visitor.o \
451a15fcc3cSEric Blake	tests/test-clone-visitor.o \
45246e7b706SFam Zheng	tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \
45346e7b706SFam Zheng	tests/test-qmp-commands.o tests/test-visitor-serialization.o \
45446e7b706SFam Zheng	tests/test-x86-cpuid.o tests/test-mul64.o tests/test-int128.o \
45546e7b706SFam Zheng	tests/test-opts-visitor.o tests/test-qmp-event.o \
456ff9249b7SEmilio G. Cota	tests/rcutorture.o tests/test-rcu-list.o \
4571a95404fSEmilio G. Cota	tests/test-qdist.o \
458896a9ee9SEmilio G. Cota	tests/test-qht.o tests/qht-bench.o tests/test-qht-par.o
45946e7b706SFam Zheng
46046e7b706SFam Zheng$(test-obj-y): QEMU_INCLUDES += -Itests
46146e7b706SFam ZhengQEMU_CFLAGS += -I$(SRC_PATH)/tests
46246e7b706SFam Zheng
46346e7b706SFam Zheng
46446e7b706SFam Zheng# Deps that are common to various different sets of tests below
46546e7b706SFam Zhengtest-util-obj-y = libqemuutil.a libqemustub.a
46646e7b706SFam Zhengtest-qom-obj-y = $(qom-obj-y) $(test-util-obj-y)
46746e7b706SFam Zhengtest-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o \
46846e7b706SFam Zheng	tests/test-qapi-event.o tests/test-qmp-introspect.o \
46946e7b706SFam Zheng	$(test-qom-obj-y)
47046e7b706SFam Zhengtest-crypto-obj-y = $(crypto-obj-y) $(test-qom-obj-y)
47146e7b706SFam Zhengtest-io-obj-y = $(io-obj-y) $(test-crypto-obj-y)
47246e7b706SFam Zhengtest-block-obj-y = $(block-obj-y) $(test-io-obj-y)
47346e7b706SFam Zheng
47446e7b706SFam Zhengtests/check-qint$(EXESUF): tests/check-qint.o $(test-util-obj-y)
47546e7b706SFam Zhengtests/check-qstring$(EXESUF): tests/check-qstring.o $(test-util-obj-y)
47646e7b706SFam Zhengtests/check-qdict$(EXESUF): tests/check-qdict.o $(test-util-obj-y)
47746e7b706SFam Zhengtests/check-qlist$(EXESUF): tests/check-qlist.o $(test-util-obj-y)
47846e7b706SFam Zhengtests/check-qfloat$(EXESUF): tests/check-qfloat.o $(test-util-obj-y)
47946e7b706SFam Zhengtests/check-qnull$(EXESUF): tests/check-qnull.o $(test-util-obj-y)
48046e7b706SFam Zhengtests/check-qjson$(EXESUF): tests/check-qjson.o $(test-util-obj-y)
48146e7b706SFam Zhengtests/check-qom-interface$(EXESUF): tests/check-qom-interface.o $(test-qom-obj-y)
48246e7b706SFam Zhengtests/check-qom-proplist$(EXESUF): tests/check-qom-proplist.o $(test-qom-obj-y)
48346e7b706SFam Zhengtests/test-coroutine$(EXESUF): tests/test-coroutine.o $(test-block-obj-y)
48446e7b706SFam Zhengtests/test-aio$(EXESUF): tests/test-aio.o $(test-block-obj-y)
48546e7b706SFam Zhengtests/test-rfifolock$(EXESUF): tests/test-rfifolock.o $(test-util-obj-y)
48646e7b706SFam Zhengtests/test-throttle$(EXESUF): tests/test-throttle.o $(test-block-obj-y)
4879ef8112aSAlberto Garciatests/test-blockjob$(EXESUF): tests/test-blockjob.o $(test-block-obj-y) $(test-util-obj-y)
48846e7b706SFam Zhengtests/test-blockjob-txn$(EXESUF): tests/test-blockjob-txn.o $(test-block-obj-y) $(test-util-obj-y)
48946e7b706SFam Zhengtests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(test-block-obj-y)
49046e7b706SFam Zhengtests/test-iov$(EXESUF): tests/test-iov.o $(test-util-obj-y)
49146e7b706SFam Zhengtests/test-hbitmap$(EXESUF): tests/test-hbitmap.o $(test-util-obj-y)
49246e7b706SFam Zhengtests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o
49346e7b706SFam Zhengtests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o page_cache.o $(test-util-obj-y)
49446e7b706SFam Zhengtests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o
49546e7b706SFam Zhengtests/test-int128$(EXESUF): tests/test-int128.o
49646e7b706SFam Zhengtests/rcutorture$(EXESUF): tests/rcutorture.o $(test-util-obj-y)
49746e7b706SFam Zhengtests/test-rcu-list$(EXESUF): tests/test-rcu-list.o $(test-util-obj-y)
498ff9249b7SEmilio G. Cotatests/test-qdist$(EXESUF): tests/test-qdist.o $(test-util-obj-y)
4991a95404fSEmilio G. Cotatests/test-qht$(EXESUF): tests/test-qht.o $(test-util-obj-y)
500896a9ee9SEmilio G. Cotatests/test-qht-par$(EXESUF): tests/test-qht-par.o tests/qht-bench$(EXESUF) $(test-util-obj-y)
501515864a0SEmilio G. Cotatests/qht-bench$(EXESUF): tests/qht-bench.o $(test-util-obj-y)
502efad6682SRichard Hendersontests/test-bufferiszero$(EXESUF): tests/test-bufferiszero.o $(test-util-obj-y)
50346e7b706SFam Zheng
50446e7b706SFam Zhengtests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o \
50546e7b706SFam Zheng	hw/core/qdev.o hw/core/qdev-properties.o hw/core/hotplug.o\
50646e7b706SFam Zheng	hw/core/bus.o \
50746e7b706SFam Zheng	hw/core/irq.o \
50846e7b706SFam Zheng	hw/core/fw-path-provider.o \
50946e7b706SFam Zheng	$(test-qapi-obj-y)
51046e7b706SFam Zhengtests/test-vmstate$(EXESUF): tests/test-vmstate.o \
51146e7b706SFam Zheng	migration/vmstate.o migration/qemu-file.o \
51246e7b706SFam Zheng        migration/qemu-file-channel.o migration/qjson.o \
51346e7b706SFam Zheng	$(test-io-obj-y)
51446e7b706SFam Zhengtests/test-timed-average$(EXESUF): tests/test-timed-average.o qemu-timer.o \
51546e7b706SFam Zheng	$(test-util-obj-y)
51646e7b706SFam Zhengtests/test-base64$(EXESUF): tests/test-base64.o \
51746e7b706SFam Zheng	libqemuutil.a libqemustub.a
51846e7b706SFam Zheng
51946e7b706SFam Zhengtests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y)
52046e7b706SFam Zheng
521b3110466SChanglong Xietests/test-replication$(EXESUF): tests/test-replication.o $(test-util-obj-y) \
522b3110466SChanglong Xie	$(test-block-obj-y)
523b3110466SChanglong Xie
52446e7b706SFam Zhengtests/test-qapi-types.c tests/test-qapi-types.h :\
52546e7b706SFam Zheng$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
52646e7b706SFam Zheng	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
52746e7b706SFam Zheng		$(gen-out-type) -o tests -p "test-" $<, \
5280bdb12c7SPeter Maydell		"GEN","$@")
52946e7b706SFam Zhengtests/test-qapi-visit.c tests/test-qapi-visit.h :\
53046e7b706SFam Zheng$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
53146e7b706SFam Zheng	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
53246e7b706SFam Zheng		$(gen-out-type) -o tests -p "test-" $<, \
5330bdb12c7SPeter Maydell		"GEN","$@")
53446e7b706SFam Zhengtests/test-qmp-commands.h tests/test-qmp-marshal.c :\
53546e7b706SFam Zheng$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
53646e7b706SFam Zheng	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
53746e7b706SFam Zheng		$(gen-out-type) -o tests -p "test-" $<, \
5380bdb12c7SPeter Maydell		"GEN","$@")
53946e7b706SFam Zhengtests/test-qapi-event.c tests/test-qapi-event.h :\
54046e7b706SFam Zheng$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
54146e7b706SFam Zheng	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
54246e7b706SFam Zheng		$(gen-out-type) -o tests -p "test-" $<, \
5430bdb12c7SPeter Maydell		"GEN","$@")
54446e7b706SFam Zhengtests/test-qmp-introspect.c tests/test-qmp-introspect.h :\
54546e7b706SFam Zheng$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
54646e7b706SFam Zheng	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \
54746e7b706SFam Zheng		$(gen-out-type) -o tests -p "test-" $<, \
5480bdb12c7SPeter Maydell		"GEN","$@")
54946e7b706SFam Zheng
55046e7b706SFam Zhengtests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y)
55146e7b706SFam Zhengtests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y)
55246e7b706SFam Zhengtests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y)
55346e7b706SFam Zhengtests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y)
554a15fcc3cSEric Blaketests/test-clone-visitor$(EXESUF): tests/test-clone-visitor.o $(test-qapi-obj-y)
55546e7b706SFam Zhengtests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y)
55646e7b706SFam Zhengtests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y)
55746e7b706SFam Zhengtests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y)
55846e7b706SFam Zhengtests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y)
55946e7b706SFam Zhengtests/test-opts-visitor$(EXESUF): tests/test-opts-visitor.o $(test-qapi-obj-y)
56046e7b706SFam Zheng
56146e7b706SFam Zhengtests/test-mul64$(EXESUF): tests/test-mul64.o $(test-util-obj-y)
56246e7b706SFam Zhengtests/test-bitops$(EXESUF): tests/test-bitops.o $(test-util-obj-y)
56346e7b706SFam Zhengtests/test-crypto-hash$(EXESUF): tests/test-crypto-hash.o $(test-crypto-obj-y)
56446e7b706SFam Zhengtests/test-crypto-cipher$(EXESUF): tests/test-crypto-cipher.o $(test-crypto-obj-y)
56546e7b706SFam Zhengtests/test-crypto-secret$(EXESUF): tests/test-crypto-secret.o $(test-crypto-obj-y)
56646e7b706SFam Zhengtests/test-crypto-xts$(EXESUF): tests/test-crypto-xts.o $(test-crypto-obj-y)
56746e7b706SFam Zheng
56846e7b706SFam Zhengtests/crypto-tls-x509-helpers.o-cflags := $(TASN1_CFLAGS)
56946e7b706SFam Zhengtests/crypto-tls-x509-helpers.o-libs := $(TASN1_LIBS)
57046e7b706SFam Zhengtests/pkix_asn1_tab.o-cflags := $(TASN1_CFLAGS)
57146e7b706SFam Zheng
57246e7b706SFam Zhengtests/test-crypto-tlscredsx509.o-cflags := $(TASN1_CFLAGS)
57346e7b706SFam Zhengtests/test-crypto-tlscredsx509$(EXESUF): tests/test-crypto-tlscredsx509.o \
57446e7b706SFam Zheng	tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y)
57546e7b706SFam Zheng
57646e7b706SFam Zhengtests/test-crypto-tlssession.o-cflags := $(TASN1_CFLAGS)
57746e7b706SFam Zhengtests/test-crypto-tlssession$(EXESUF): tests/test-crypto-tlssession.o \
57846e7b706SFam Zheng	tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y)
57946e7b706SFam Zhengtests/test-io-task$(EXESUF): tests/test-io-task.o $(test-io-obj-y)
58046e7b706SFam Zhengtests/test-io-channel-socket$(EXESUF): tests/test-io-channel-socket.o \
58146e7b706SFam Zheng        tests/io-channel-helpers.o $(test-io-obj-y)
58246e7b706SFam Zhengtests/test-io-channel-file$(EXESUF): tests/test-io-channel-file.o \
58346e7b706SFam Zheng        tests/io-channel-helpers.o $(test-io-obj-y)
58446e7b706SFam Zhengtests/test-io-channel-tls$(EXESUF): tests/test-io-channel-tls.o \
58546e7b706SFam Zheng	tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o \
58646e7b706SFam Zheng	tests/io-channel-helpers.o $(test-io-obj-y)
58746e7b706SFam Zhengtests/test-io-channel-command$(EXESUF): tests/test-io-channel-command.o \
58846e7b706SFam Zheng        tests/io-channel-helpers.o $(test-io-obj-y)
58946e7b706SFam Zhengtests/test-io-channel-buffer$(EXESUF): tests/test-io-channel-buffer.o \
59046e7b706SFam Zheng        tests/io-channel-helpers.o $(test-io-obj-y)
59146e7b706SFam Zhengtests/test-crypto-pbkdf$(EXESUF): tests/test-crypto-pbkdf.o $(test-crypto-obj-y)
59246e7b706SFam Zhengtests/test-crypto-ivgen$(EXESUF): tests/test-crypto-ivgen.o $(test-crypto-obj-y)
59346e7b706SFam Zhengtests/test-crypto-afsplit$(EXESUF): tests/test-crypto-afsplit.o $(test-crypto-obj-y)
59446e7b706SFam Zhengtests/test-crypto-block$(EXESUF): tests/test-crypto-block.o $(test-crypto-obj-y)
59546e7b706SFam Zheng
59646e7b706SFam Zhenglibqos-obj-y = tests/libqos/pci.o tests/libqos/fw_cfg.o tests/libqos/malloc.o
59746e7b706SFam Zhenglibqos-obj-y += tests/libqos/i2c.o tests/libqos/libqos.o
5988d6ef7c9SLaurent Vivierlibqos-spapr-obj-y = $(libqos-obj-y) tests/libqos/malloc-spapr.o
5998d6ef7c9SLaurent Vivierlibqos-spapr-obj-y += tests/libqos/libqos-spapr.o
600eeddd59fSLaurent Vivierlibqos-spapr-obj-y += tests/libqos/rtas.o
601cf716b31SLaurent Vivierlibqos-spapr-obj-y += tests/libqos/pci-spapr.o
60246e7b706SFam Zhenglibqos-pc-obj-y = $(libqos-obj-y) tests/libqos/pci-pc.o
60346e7b706SFam Zhenglibqos-pc-obj-y += tests/libqos/malloc-pc.o tests/libqos/libqos-pc.o
60446e7b706SFam Zhenglibqos-pc-obj-y += tests/libqos/ahci.o
60546e7b706SFam Zhenglibqos-omap-obj-y = $(libqos-obj-y) tests/libqos/i2c-omap.o
60646e7b706SFam Zhenglibqos-imx-obj-y = $(libqos-obj-y) tests/libqos/i2c-imx.o
607aa9026fdSLaurent Vivierlibqos-usb-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/usb.o
60846e7b706SFam Zhenglibqos-virtio-obj-y = $(libqos-pc-obj-y) tests/libqos/virtio.o tests/libqos/virtio-pci.o tests/libqos/virtio-mmio.o tests/libqos/malloc-generic.o
60946e7b706SFam Zheng
61046e7b706SFam Zhengtests/device-introspect-test$(EXESUF): tests/device-introspect-test.o
61146e7b706SFam Zhengtests/rtc-test$(EXESUF): tests/rtc-test.o
61246e7b706SFam Zhengtests/m48t59-test$(EXESUF): tests/m48t59-test.o
61346e7b706SFam Zhengtests/endianness-test$(EXESUF): tests/endianness-test.o
61446e7b706SFam Zhengtests/spapr-phb-test$(EXESUF): tests/spapr-phb-test.o $(libqos-obj-y)
615fcbf4a3cSThomas Huthtests/prom-env-test$(EXESUF): tests/prom-env-test.o $(libqos-obj-y)
616eeddd59fSLaurent Viviertests/rtas-test$(EXESUF): tests/rtas-test.o $(libqos-spapr-obj-y)
61746e7b706SFam Zhengtests/fdc-test$(EXESUF): tests/fdc-test.o
61846e7b706SFam Zhengtests/ide-test$(EXESUF): tests/ide-test.o $(libqos-pc-obj-y)
61946e7b706SFam Zhengtests/ahci-test$(EXESUF): tests/ahci-test.o $(libqos-pc-obj-y)
62046e7b706SFam Zhengtests/ipmi-kcs-test$(EXESUF): tests/ipmi-kcs-test.o
62146e7b706SFam Zhengtests/ipmi-bt-test$(EXESUF): tests/ipmi-bt-test.o
62246e7b706SFam Zhengtests/hd-geo-test$(EXESUF): tests/hd-geo-test.o
62346e7b706SFam Zhengtests/boot-order-test$(EXESUF): tests/boot-order-test.o $(libqos-obj-y)
624d2ab58ffSThomas Huthtests/boot-serial-test$(EXESUF): tests/boot-serial-test.o $(libqos-obj-y)
62546e7b706SFam Zhengtests/bios-tables-test$(EXESUF): tests/bios-tables-test.o \
62646e7b706SFam Zheng	tests/boot-sector.o $(libqos-obj-y)
62746e7b706SFam Zhengtests/pxe-test$(EXESUF): tests/pxe-test.o tests/boot-sector.o $(libqos-obj-y)
62846e7b706SFam Zhengtests/tmp105-test$(EXESUF): tests/tmp105-test.o $(libqos-omap-obj-y)
62946e7b706SFam Zhengtests/ds1338-test$(EXESUF): tests/ds1338-test.o $(libqos-imx-obj-y)
630*7a2334f7SCédric Le Goatertests/m25p80-test$(EXESUF): tests/m25p80-test.o
63146e7b706SFam Zhengtests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y)
63246e7b706SFam Zhengtests/q35-test$(EXESUF): tests/q35-test.o $(libqos-pc-obj-y)
63346e7b706SFam Zhengtests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y)
63446e7b706SFam Zhengtests/e1000-test$(EXESUF): tests/e1000-test.o
63546e7b706SFam Zhengtests/e1000e-test$(EXESUF): tests/e1000e-test.o $(libqos-pc-obj-y)
63646e7b706SFam Zhengtests/rtl8139-test$(EXESUF): tests/rtl8139-test.o $(libqos-pc-obj-y)
63746e7b706SFam Zhengtests/pcnet-test$(EXESUF): tests/pcnet-test.o
63846e7b706SFam Zhengtests/eepro100-test$(EXESUF): tests/eepro100-test.o
63946e7b706SFam Zhengtests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o
64046e7b706SFam Zhengtests/ne2000-test$(EXESUF): tests/ne2000-test.o
64146e7b706SFam Zhengtests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o
64246e7b706SFam Zhengtests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y)
64346e7b706SFam Zhengtests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o
64446e7b706SFam Zhengtests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o $(libqos-virtio-obj-y)
64546e7b706SFam Zhengtests/virtio-net-test$(EXESUF): tests/virtio-net-test.o $(libqos-pc-obj-y) $(libqos-virtio-obj-y)
64646e7b706SFam Zhengtests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o $(libqos-pc-obj-y)
64746e7b706SFam Zhengtests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o $(libqos-virtio-obj-y)
648557a4cc0SGreg Kurztests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o $(libqos-virtio-obj-y)
64946e7b706SFam Zhengtests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o
65046e7b706SFam Zhengtests/virtio-console-test$(EXESUF): tests/virtio-console-test.o
65146e7b706SFam Zhengtests/tpci200-test$(EXESUF): tests/tpci200-test.o
65246e7b706SFam Zhengtests/display-vga-test$(EXESUF): tests/display-vga-test.o
65346e7b706SFam Zhengtests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
65446e7b706SFam Zhengtests/qom-test$(EXESUF): tests/qom-test.o
65546e7b706SFam Zhengtests/drive_del-test$(EXESUF): tests/drive_del-test.o $(libqos-pc-obj-y)
65646e7b706SFam Zhengtests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y)
65746e7b706SFam Zhengtests/nvme-test$(EXESUF): tests/nvme-test.o
65846e7b706SFam Zhengtests/pvpanic-test$(EXESUF): tests/pvpanic-test.o
65946e7b706SFam Zhengtests/i82801b11-test$(EXESUF): tests/i82801b11-test.o
66046e7b706SFam Zhengtests/ac97-test$(EXESUF): tests/ac97-test.o
66146e7b706SFam Zhengtests/es1370-test$(EXESUF): tests/es1370-test.o
66246e7b706SFam Zhengtests/intel-hda-test$(EXESUF): tests/intel-hda-test.o
66346e7b706SFam Zhengtests/ioh3420-test$(EXESUF): tests/ioh3420-test.o
66446e7b706SFam Zhengtests/usb-hcd-ohci-test$(EXESUF): tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y)
66546e7b706SFam Zhengtests/usb-hcd-uhci-test$(EXESUF): tests/usb-hcd-uhci-test.o $(libqos-usb-obj-y)
66646e7b706SFam Zhengtests/usb-hcd-ehci-test$(EXESUF): tests/usb-hcd-ehci-test.o $(libqos-usb-obj-y)
66746e7b706SFam Zhengtests/usb-hcd-xhci-test$(EXESUF): tests/usb-hcd-xhci-test.o $(libqos-usb-obj-y)
66846e7b706SFam Zhengtests/pc-cpu-test$(EXESUF): tests/pc-cpu-test.o
669ea0c6d62SDr. David Alan Gilberttests/postcopy-test$(EXESUF): tests/postcopy-test.o
670ed0a8d92SMarc-André Lureautests/vhost-user-test$(EXESUF): tests/vhost-user-test.o qemu-char.o qemu-timer.o $(qtest-obj-y) $(test-io-obj-y) $(libqos-virtio-obj-y) $(libqos-pc-obj-y)
67146e7b706SFam Zhengtests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o
67246e7b706SFam Zhengtests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o $(test-util-obj-y)
67346e7b706SFam Zhengtests/test-write-threshold$(EXESUF): tests/test-write-threshold.o $(test-block-obj-y)
67446e7b706SFam Zhengtests/test-netfilter$(EXESUF): tests/test-netfilter.o $(qtest-obj-y)
67546e7b706SFam Zhengtests/test-filter-mirror$(EXESUF): tests/test-filter-mirror.o $(qtest-obj-y)
67646e7b706SFam Zhengtests/test-filter-redirector$(EXESUF): tests/test-filter-redirector.o $(qtest-obj-y)
6776efef58eSEduardo Habkosttests/test-x86-cpuid-compat$(EXESUF): tests/test-x86-cpuid-compat.o $(qtest-obj-y)
67846e7b706SFam Zhengtests/ivshmem-test$(EXESUF): tests/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y)
67946e7b706SFam Zhengtests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o
6805b262bb6SDmitry Osipenkotests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o hw/core/ptimer.o
681c739cdddSFam Zhengtests/test-uuid$(EXESUF): tests/test-uuid.o $(test-util-obj-y)
68246e7b706SFam Zheng
683409437e1SDaniel P. Berrangetests/migration/stress$(EXESUF): tests/migration/stress.o
6840bdb12c7SPeter Maydell	$(call quiet-command, $(LINKPROG) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"LINK","$(TARGET_DIR)$@")
685409437e1SDaniel P. Berrange
686409437e1SDaniel P. BerrangeINITRD_WORK_DIR=tests/migration/initrd
687409437e1SDaniel P. Berrange
688409437e1SDaniel P. Berrangetests/migration/initrd-stress.img: tests/migration/stress$(EXESUF)
689409437e1SDaniel P. Berrange	mkdir -p $(INITRD_WORK_DIR)
690409437e1SDaniel P. Berrange	cp $< $(INITRD_WORK_DIR)/init
691409437e1SDaniel P. Berrange	(cd $(INITRD_WORK_DIR) && (find | cpio --quiet -o -H newc | gzip -9)) > $@
692409437e1SDaniel P. Berrange	rm $(INITRD_WORK_DIR)/init
693409437e1SDaniel P. Berrange	rmdir $(INITRD_WORK_DIR)
694409437e1SDaniel P. Berrange
69546e7b706SFam Zhengifeq ($(CONFIG_POSIX),y)
69646e7b706SFam ZhengLIBS += -lutil
69746e7b706SFam Zhengendif
69846e7b706SFam Zheng
69946e7b706SFam Zheng# QTest rules
70046e7b706SFam Zheng
70146e7b706SFam ZhengTARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
70246e7b706SFam Zhengifeq ($(CONFIG_POSIX),y)
70346e7b706SFam ZhengQTEST_TARGETS = $(TARGETS)
70446e7b706SFam Zhengcheck-qtest-y=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))
70546e7b706SFam Zhengcheck-qtest-y += $(check-qtest-generic-y)
70646e7b706SFam Zhengelse
70746e7b706SFam ZhengQTEST_TARGETS =
70846e7b706SFam Zhengendif
70946e7b706SFam Zheng
71046e7b706SFam Zhengqtest-obj-y = tests/libqtest.o $(test-util-obj-y)
71146e7b706SFam Zheng$(check-qtest-y): $(qtest-obj-y)
71246e7b706SFam Zheng
71346e7b706SFam Zhengtests/test-qga: tests/test-qga.o $(qtest-obj-y)
71446e7b706SFam Zheng
71546e7b706SFam Zheng.PHONY: check-help
71646e7b706SFam Zhengcheck-help:
71746e7b706SFam Zheng	@echo "Regression testing targets:"
71846e7b706SFam Zheng	@echo
71946e7b706SFam Zheng	@echo " make check                Run all tests"
72046e7b706SFam Zheng	@echo " make check-qtest-TARGET   Run qtest tests for given target"
72146e7b706SFam Zheng	@echo " make check-qtest          Run qtest tests"
72246e7b706SFam Zheng	@echo " make check-unit           Run qobject tests"
72346e7b706SFam Zheng	@echo " make check-qapi-schema    Run QAPI schema tests"
72446e7b706SFam Zheng	@echo " make check-block          Run block tests"
72546e7b706SFam Zheng	@echo " make check-report.html    Generates an HTML test report"
72646e7b706SFam Zheng	@echo " make check-clean          Clean the tests"
72746e7b706SFam Zheng	@echo
72846e7b706SFam Zheng	@echo "Please note that HTML reports do not regenerate if the unit tests"
72946e7b706SFam Zheng	@echo "has not changed."
73046e7b706SFam Zheng	@echo
73146e7b706SFam Zheng	@echo "The variable SPEED can be set to control the gtester speed setting."
73246e7b706SFam Zheng	@echo "Default options are -k and (for make V=1) --verbose; they can be"
73346e7b706SFam Zheng	@echo "changed with variable GTESTER_OPTIONS."
73446e7b706SFam Zheng
73546e7b706SFam ZhengSPEED = quick
73646e7b706SFam ZhengGTESTER_OPTIONS = -k $(if $(V),--verbose,-q)
73746e7b706SFam ZhengGCOV_OPTIONS = -n $(if $(V),-f,)
73846e7b706SFam Zheng
73946e7b706SFam Zheng# gtester tests, possibly with verbose output
74046e7b706SFam Zheng
74146e7b706SFam Zheng.PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS))
74246e7b706SFam Zheng$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: $(check-qtest-y)
74346e7b706SFam Zheng	$(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,)
74446e7b706SFam Zheng	$(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
74546e7b706SFam Zheng		QTEST_QEMU_IMG=qemu-img$(EXESUF) \
74646e7b706SFam Zheng		MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$((RANDOM % 255 + 1))} \
7470bdb12c7SPeter Maydell		gtester $(GTESTER_OPTIONS) -m=$(SPEED) $(check-qtest-$*-y) $(check-qtest-generic-y),"GTESTER","$@")
74846e7b706SFam Zheng	$(if $(CONFIG_GCOV),@for f in $(gcov-files-$*-y) $(gcov-files-generic-y); do \
74946e7b706SFam Zheng	  echo Gcov report for $$f:;\
75046e7b706SFam Zheng	  $(GCOV) $(GCOV_OPTIONS) $$f -o `dirname $$f`; \
75146e7b706SFam Zheng	done,)
75246e7b706SFam Zheng
75346e7b706SFam Zheng.PHONY: $(patsubst %, check-%, $(check-unit-y))
75446e7b706SFam Zheng$(patsubst %, check-%, $(check-unit-y)): check-%: %
75546e7b706SFam Zheng	$(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,)
75646e7b706SFam Zheng	$(call quiet-command, \
75746e7b706SFam Zheng		MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$((RANDOM % 255 + 1))} \
7580bdb12c7SPeter Maydell		gtester $(GTESTER_OPTIONS) -m=$(SPEED) $*,"GTESTER","$*")
75946e7b706SFam Zheng	$(if $(CONFIG_GCOV),@for f in $(gcov-files-$(subst tests/,,$*)-y) $(gcov-files-generic-y); do \
76046e7b706SFam Zheng	  echo Gcov report for $$f:;\
76146e7b706SFam Zheng	  $(GCOV) $(GCOV_OPTIONS) $$f -o `dirname $$f`; \
76246e7b706SFam Zheng	done,)
76346e7b706SFam Zheng
76446e7b706SFam Zheng# gtester tests with XML output
76546e7b706SFam Zheng
76646e7b706SFam Zheng$(patsubst %, check-report-qtest-%.xml, $(QTEST_TARGETS)): check-report-qtest-%.xml: $(check-qtest-y)
76746e7b706SFam Zheng	$(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
76846e7b706SFam Zheng		QTEST_QEMU_IMG=qemu-img$(EXESUF) \
7690bdb12c7SPeter Maydell	  gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $(check-qtest-$*-y) $(check-qtest-generic-y),"GTESTER","$@")
77046e7b706SFam Zheng
77146e7b706SFam Zhengcheck-report-unit.xml: $(check-unit-y)
7720bdb12c7SPeter Maydell	$(call quiet-command,gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $^,"GTESTER","$@")
77346e7b706SFam Zheng
77446e7b706SFam Zheng# Reports and overall runs
77546e7b706SFam Zheng
77646e7b706SFam Zhengcheck-report.xml: $(patsubst %,check-report-qtest-%.xml, $(QTEST_TARGETS)) check-report-unit.xml
7770bdb12c7SPeter Maydell	$(call quiet-command,$(SRC_PATH)/scripts/gtester-cat $^ > $@,"GEN","$@")
77846e7b706SFam Zheng
77946e7b706SFam Zhengcheck-report.html: check-report.xml
7800bdb12c7SPeter Maydell	$(call quiet-command,gtester-report $< > $@,"GEN","$@")
78146e7b706SFam Zheng
78246e7b706SFam Zheng
78346e7b706SFam Zheng# Other tests
78446e7b706SFam Zheng
78546e7b706SFam ZhengQEMU_IOTESTS_HELPERS-$(CONFIG_LINUX) = tests/qemu-iotests/socket_scm_helper$(EXESUF)
78646e7b706SFam Zheng
78746e7b706SFam Zheng.PHONY: check-tests/qemu-iotests-quick.sh
78846e7b706SFam Zhengcheck-tests/qemu-iotests-quick.sh: tests/qemu-iotests-quick.sh qemu-img$(EXESUF) qemu-io$(EXESUF) $(QEMU_IOTESTS_HELPERS-y)
78946e7b706SFam Zheng	$<
79046e7b706SFam Zheng
79146e7b706SFam Zheng.PHONY: check-tests/test-qapi.py
79246e7b706SFam Zhengcheck-tests/test-qapi.py: tests/test-qapi.py
79346e7b706SFam Zheng
79446e7b706SFam Zheng.PHONY: $(patsubst %, check-%, $(check-qapi-schema-y))
79546e7b706SFam Zheng$(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
79646e7b706SFam Zheng	$(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts \
79746e7b706SFam Zheng		$(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py \
79846e7b706SFam Zheng		$^ >$*.test.out 2>$*.test.err; \
79946e7b706SFam Zheng		echo $$? >$*.test.exit, \
8000bdb12c7SPeter Maydell		"TEST","$*.out")
80146e7b706SFam Zheng	@diff -q $(SRC_PATH)/$*.out $*.test.out
80246e7b706SFam Zheng	@# Sanitize error messages (make them independent of build directory)
80346e7b706SFam Zheng	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q $(SRC_PATH)/$*.err -
80446e7b706SFam Zheng	@diff -q $(SRC_PATH)/$*.exit $*.test.exit
80546e7b706SFam Zheng
80646e7b706SFam Zheng# Consolidated targets
80746e7b706SFam Zheng
80846e7b706SFam Zheng.PHONY: check-qapi-schema check-qtest check-unit check check-clean
80946e7b706SFam Zhengcheck-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y))
81046e7b706SFam Zhengcheck-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
81146e7b706SFam Zhengcheck-unit: $(patsubst %,check-%, $(check-unit-y))
81246e7b706SFam Zhengcheck-block: $(patsubst %,check-%, $(check-block-y))
81346e7b706SFam Zhengcheck: check-qapi-schema check-unit check-qtest
81446e7b706SFam Zhengcheck-clean:
81546e7b706SFam Zheng	$(MAKE) -C tests/tcg clean
81646e7b706SFam Zheng	rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
81746e7b706SFam Zheng	rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y)) $(check-qtest-generic-y))
81846e7b706SFam Zheng
81946e7b706SFam Zhengclean: check-clean
82046e7b706SFam Zheng
82146e7b706SFam Zheng# Build the help program automatically
82246e7b706SFam Zheng
82346e7b706SFam Zhengall: $(QEMU_IOTESTS_HELPERS-y)
82446e7b706SFam Zheng
82546e7b706SFam Zheng-include $(wildcard tests/*.d)
82646e7b706SFam Zheng-include $(wildcard tests/libqos/*.d)
827