blob: 666aee2ac368ed2f515b78db555b2540f26b1ac8 [file] [log] [blame]
Kevin Wolf89594492012-03-08 12:29:00 +01001export SRC_PATH
2
Peter Maydell3687d532014-01-23 16:22:59 +00003# Get the list of all supported sysemu targets
4SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
5 $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak)))
6
Paolo Bonzinib93b63f2012-03-28 15:42:01 +02007check-unit-y = tests/check-qdict$(EXESUF)
Paolo Bonzini5f7a74a2013-01-15 09:49:35 +01008gcov-files-check-qdict-y = qobject/qdict.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +02009check-unit-y += tests/check-qfloat$(EXESUF)
Paolo Bonzini5f7a74a2013-01-15 09:49:35 +010010gcov-files-check-qfloat-y = qobject/qfloat.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020011check-unit-y += tests/check-qint$(EXESUF)
Paolo Bonzini5f7a74a2013-01-15 09:49:35 +010012gcov-files-check-qint-y = qobject/qint.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020013check-unit-y += tests/check-qstring$(EXESUF)
Paolo Bonzini5f7a74a2013-01-15 09:49:35 +010014gcov-files-check-qstring-y = qobject/qstring.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020015check-unit-y += tests/check-qlist$(EXESUF)
Paolo Bonzini5f7a74a2013-01-15 09:49:35 +010016gcov-files-check-qlist-y = qobject/qlist.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020017check-unit-y += tests/check-qjson$(EXESUF)
Paolo Bonzini5f7a74a2013-01-15 09:49:35 +010018gcov-files-check-qjson-y = qobject/qjson.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020019check-unit-y += tests/test-qmp-output-visitor$(EXESUF)
Blue Swirl1d728c32012-05-01 18:45:39 +000020gcov-files-test-qmp-output-visitor-y = qapi/qmp-output-visitor.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020021check-unit-y += tests/test-qmp-input-visitor$(EXESUF)
Blue Swirl1d728c32012-05-01 18:45:39 +000022gcov-files-test-qmp-input-visitor-y = qapi/qmp-input-visitor.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020023check-unit-y += tests/test-qmp-input-strict$(EXESUF)
24check-unit-y += tests/test-qmp-commands$(EXESUF)
Blue Swirl1d728c32012-05-01 18:45:39 +000025gcov-files-test-qmp-commands-y = qapi/qmp-dispatch.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020026check-unit-y += tests/test-string-input-visitor$(EXESUF)
Blue Swirl1d728c32012-05-01 18:45:39 +000027gcov-files-test-string-input-visitor-y = qapi/string-input-visitor.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020028check-unit-y += tests/test-string-output-visitor$(EXESUF)
Blue Swirl1d728c32012-05-01 18:45:39 +000029gcov-files-test-string-output-visitor-y = qapi/string-output-visitor.c
Wenchao Xiaf6dadb02014-06-18 08:43:29 +020030check-unit-y += tests/test-qmp-event$(EXESUF)
31gcov-files-test-qmp-event-y += qapi/qmp-event.c
Laszlo Ersek3953e3a2013-08-20 00:35:40 +020032check-unit-y += tests/test-opts-visitor$(EXESUF)
33gcov-files-test-opts-visitor-y = qapi/opts-visitor.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020034check-unit-y += tests/test-coroutine$(EXESUF)
Peter Maydell7c2acc72013-04-08 12:11:27 +010035gcov-files-test-coroutine-y = coroutine-$(CONFIG_COROUTINE_BACKEND).c
Michael Roth2d496102012-02-21 21:05:07 -060036check-unit-y += tests/test-visitor-serialization$(EXESUF)
Michael Tokarev2278a692012-06-07 20:08:19 +040037check-unit-y += tests/test-iov$(EXESUF)
Paolo Bonzini5f7a74a2013-01-15 09:49:35 +010038gcov-files-test-iov-y = util/iov.c
Paolo Bonzinib2ea25d2012-11-23 16:13:23 +010039check-unit-y += tests/test-aio$(EXESUF)
Stefan Hajnoczid597a322014-03-28 10:55:53 +010040check-unit-$(CONFIG_POSIX) += tests/test-rfifolock$(EXESUF)
Benoît Canetf17cfe82013-09-02 14:14:38 +020041check-unit-y += tests/test-throttle$(EXESUF)
Blue Swirl1d728c32012-05-01 18:45:39 +000042gcov-files-test-aio-$(CONFIG_WIN32) = aio-win32.c
43gcov-files-test-aio-$(CONFIG_POSIX) = aio-posix.c
Paolo Bonzini74c856e2012-11-23 16:13:24 +010044check-unit-y += tests/test-thread-pool$(EXESUF)
Blue Swirl1d728c32012-05-01 18:45:39 +000045gcov-files-test-thread-pool-y = thread-pool.c
Paolo Bonzinie7c033c2013-01-21 17:09:40 +010046gcov-files-test-hbitmap-y = util/hbitmap.c
47check-unit-y += tests/test-hbitmap$(EXESUF)
Eduardo Habkost247c9de2013-01-23 15:58:27 -020048check-unit-y += tests/test-x86-cpuid$(EXESUF)
49# all code tested by test-x86-cpuid is inside topology.h
50gcov-files-test-x86-cpuid-y =
Dr. David Alan Gilbert60fe6372014-12-12 11:13:38 +000051ifeq ($(CONFIG_SOFTMMU),y)
Orit Wasserman21e3cd22013-01-31 09:12:16 +020052check-unit-y += tests/test-xbzrle$(EXESUF)
Dr. David Alan Gilbert60fe6372014-12-12 11:13:38 +000053gcov-files-test-xbzrle-y = migration/xbzrle.c
54check-unit-$(CONFIG_POSIX) += tests/test-vmstate$(EXESUF)
55endif
Eduardo Habkoste3f9fe22013-02-04 16:27:45 -020056check-unit-y += tests/test-cutils$(EXESUF)
57gcov-files-test-cutils-y += util/cutils.c
Richard Hendersonf4c0f982013-02-16 12:47:01 -080058check-unit-y += tests/test-mul64$(EXESUF)
59gcov-files-test-mul64-y = util/host-utils.c
Paolo Bonzini6046c622013-06-20 16:19:32 +020060check-unit-y += tests/test-int128$(EXESUF)
61# all code tested by test-int128 is inside int128.h
62gcov-files-test-int128-y =
Paolo Bonzini8fda74a2013-06-21 09:09:34 +020063check-unit-y += tests/rcutorture$(EXESUF)
64gcov-files-rcutorture-y = util/rcu.c
Mike Day341774f2013-08-27 11:38:45 -040065check-unit-y += tests/test-rcu-list$(EXESUF)
66gcov-files-test-rcu-list-y = util/rcu.c
Peter Maydell34647002013-06-28 12:40:32 +010067check-unit-y += tests/test-bitops$(EXESUF)
Michael S. Tsirkin9d414012014-09-18 20:46:45 +030068check-unit-$(CONFIG_HAS_GLIB_SUBPROCESS_TESTS) += tests/test-qdev-global-props$(EXESUF)
Igor Mammedov14389db2013-12-20 22:14:40 +010069check-unit-y += tests/check-qom-interface$(EXESUF)
70gcov-files-check-qom-interface-y = qom/object.c
Leandro Dorileo4ba6fab2014-05-19 18:53:55 -030071check-unit-y += tests/test-qemu-opts$(EXESUF)
72gcov-files-test-qemu-opts-y = qom/test-qemu-opts.c
Francesco Romanie2462112015-01-12 14:11:13 +010073check-unit-y += tests/test-write-threshold$(EXESUF)
74gcov-files-test-write-threshold-y = block/write-threshold.c
Anthony Liguoriad65aa82012-01-10 13:10:51 -060075
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020076check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
Anthony Liguoridbfe06c2012-01-10 13:10:43 -060077
Anthony Liguorid1aaf542012-03-28 15:42:07 +020078# All QTests for now are POSIX-only, but the dependencies are
79# really in libqtest, not in the testcases themselves.
Andreas Färbera21baf72013-11-07 18:25:10 +010080
Andreas Färber1f9c4cf2013-08-02 00:48:40 +020081gcov-files-ipack-y += hw/ipack/ipack.c
Andreas Färber37146822014-02-09 12:24:15 +010082check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF)
83gcov-files-ipack-y += hw/char/ipoctal232.c
84
Andreas Färber6e8114a2014-02-21 17:49:12 +010085check-qtest-virtioserial-y += tests/virtio-console-test$(EXESUF)
86gcov-files-virtioserial-y += hw/char/virtio-console.c
87
Andreas Färberb815ec52014-02-09 04:13:37 +010088gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio.c
89check-qtest-virtio-y += tests/virtio-net-test$(EXESUF)
90gcov-files-virtio-y += i386-softmmu/hw/net/virtio-net.c
Andreas Färber02063aa2014-02-09 04:39:47 +010091check-qtest-virtio-y += tests/virtio-balloon-test$(EXESUF)
92gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio-balloon.c
Andreas Färberc7a59be2014-02-09 04:32:55 +010093check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF)
94gcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c
Andreas Färberb6f46f02014-02-09 04:43:10 +010095check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF)
96gcov-files-virtio-y += hw/virtio/virtio-rng.c
Andreas Färber26c9a012014-02-21 16:42:15 +010097check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF)
98gcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c
Andreas Färber2d888c02014-02-21 17:15:21 +010099ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
100check-qtest-virtio-y += tests/virtio-9p-test$(EXESUF)
101gcov-files-virtio-y += hw/9pfs/virtio-9p.c
102gcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c
103endif
Andreas Färberaa974052014-02-21 17:36:57 +0100104check-qtest-virtio-y += tests/virtio-serial-test$(EXESUF)
105gcov-files-virtio-y += i386-softmmu/hw/char/virtio-serial-bus.c
Andreas Färber6e8114a2014-02-21 17:49:12 +0100106check-qtest-virtio-y += $(check-qtest-virtioserial-y)
107gcov-files-virtio-y += $(gcov-files-virtioserial-y)
Andreas Färberb815ec52014-02-09 04:13:37 +0100108
Andreas Färbera21baf72013-11-07 18:25:10 +0100109check-qtest-pci-y += tests/e1000-test$(EXESUF)
110gcov-files-pci-y += hw/net/e1000.c
Andreas Färber74769fe2013-11-07 18:43:09 +0100111check-qtest-pci-y += tests/rtl8139-test$(EXESUF)
112gcov-files-pci-y += hw/net/rtl8139.c
Andreas Färber85f68d52013-11-07 18:53:28 +0100113check-qtest-pci-y += tests/pcnet-test$(EXESUF)
114gcov-files-pci-y += hw/net/pcnet.c
115gcov-files-pci-y += hw/net/pcnet-pci.c
Andreas Färber92838a12013-11-07 19:18:46 +0100116check-qtest-pci-y += tests/eepro100-test$(EXESUF)
117gcov-files-pci-y += hw/net/eepro100.c
Andreas Färber5297ea62014-02-09 04:01:37 +0100118check-qtest-pci-y += tests/ne2000-test$(EXESUF)
119gcov-files-pci-y += hw/net/ne2000.c
Andreas Färberfc967792014-02-21 22:19:43 +0100120check-qtest-pci-y += tests/nvme-test$(EXESUF)
121gcov-files-pci-y += hw/block/nvme.c
Andreas Färberd7b50c02014-03-30 19:00:05 +0200122check-qtest-pci-y += tests/ac97-test$(EXESUF)
123gcov-files-pci-y += hw/audio/ac97.c
Andreas Färber8fa74c92014-03-30 19:05:20 +0200124check-qtest-pci-y += tests/es1370-test$(EXESUF)
125gcov-files-pci-y += hw/audio/es1370.c
Andreas Färberb815ec52014-02-09 04:13:37 +0100126check-qtest-pci-y += $(check-qtest-virtio-y)
127gcov-files-pci-y += $(gcov-files-virtio-y) hw/virtio/virtio-pci.c
Andreas Färber76491072014-02-09 03:48:44 +0100128check-qtest-pci-y += tests/tpci200-test$(EXESUF)
Andreas Färber83bb0b22014-02-21 16:29:17 +0100129gcov-files-pci-y += hw/ipack/tpci200.c
Andreas Färber37146822014-02-09 12:24:15 +0100130check-qtest-pci-y += $(check-qtest-ipack-y)
Andreas Färber83bb0b22014-02-21 16:29:17 +0100131gcov-files-pci-y += $(gcov-files-ipack-y)
Gerd Hoffmann0850fd52014-04-28 11:01:13 +0200132check-qtest-pci-y += tests/display-vga-test$(EXESUF)
133gcov-files-pci-y += hw/display/vga.c
134gcov-files-pci-y += hw/display/cirrus_vga.c
135gcov-files-pci-y += hw/display/vga-pci.c
Andreas Färberfbaf4452014-03-30 19:22:48 +0200136check-qtest-pci-y += tests/intel-hda-test$(EXESUF)
137gcov-files-pci-y += hw/audio/intel-hda.c hw/audio/hda-codec.c
Andreas Färbera21baf72013-11-07 18:25:10 +0100138
Paolo Bonzini8fefa312013-07-22 15:54:34 +0200139check-qtest-i386-y = tests/endianness-test$(EXESUF)
140check-qtest-i386-y += tests/fdc-test$(EXESUF)
Andreas Färber5ec889b2014-02-14 15:09:28 +0100141gcov-files-i386-y = hw/block/fdc.c
Kevin Wolfacbe4802013-05-08 11:18:41 +0200142check-qtest-i386-y += tests/ide-test$(EXESUF)
John Snow1cd10312014-08-21 13:44:32 -0400143check-qtest-i386-y += tests/ahci-test$(EXESUF)
Markus Armbruster0e8a8c82012-07-10 11:12:30 +0200144check-qtest-i386-y += tests/hd-geo-test$(EXESUF)
Andreas Färber5ec889b2014-02-14 15:09:28 +0100145gcov-files-i386-y += hw/block/hd-geometry.c
Markus Armbrusteredbd7902013-06-26 15:52:13 +0200146check-qtest-i386-y += tests/boot-order-test$(EXESUF)
Gabriel L. Somlo501f28c2014-05-27 15:03:14 -0400147check-qtest-i386-y += tests/bios-tables-test$(EXESUF)
Stefan Weilfba0c402012-05-15 18:19:45 +0200148check-qtest-i386-y += tests/rtc-test$(EXESUF)
Anthony Liguori9bda4132013-04-16 09:45:19 -0500149check-qtest-i386-y += tests/i440fx-test$(EXESUF)
Anthony Liguoribf2a38d2013-04-16 09:45:21 -0500150check-qtest-i386-y += tests/fw_cfg-test$(EXESUF)
Markus Armbrustere2f3f222014-10-02 16:51:31 +0200151check-qtest-i386-y += tests/drive_del-test$(EXESUF)
Paolo Bonzinif52b7682014-07-15 14:57:06 +0200152check-qtest-i386-y += tests/wdt_ib700-test$(EXESUF)
153gcov-files-i386-y += hw/watchdog/watchdog.c hw/watchdog/wdt_ib700.c
Andreas Färbera21baf72013-11-07 18:25:10 +0100154check-qtest-i386-y += $(check-qtest-pci-y)
155gcov-files-i386-y += $(gcov-files-pci-y)
Andreas Färber4a053e72013-11-07 18:37:34 +0100156check-qtest-i386-y += tests/vmxnet3-test$(EXESUF)
157gcov-files-i386-y += hw/net/vmxnet3.c
158gcov-files-i386-y += hw/net/vmxnet_rx_pkt.c
159gcov-files-i386-y += hw/net/vmxnet_tx_pkt.c
Andreas Färberabc53732014-02-21 20:38:48 +0100160check-qtest-i386-y += tests/pvpanic-test$(EXESUF)
161gcov-files-i386-y += i386-softmmu/hw/misc/pvpanic.c
Andreas Färbere683eb92014-02-21 22:43:43 +0100162check-qtest-i386-y += tests/i82801b11-test$(EXESUF)
163gcov-files-i386-y += hw/pci-bridge/i82801b11.c
Andreas Färberefbf5df2014-03-30 20:02:00 +0200164check-qtest-i386-y += tests/ioh3420-test$(EXESUF)
165gcov-files-i386-y += hw/pci-bridge/ioh3420.c
Gonglei28edfce2014-06-23 19:53:51 +0800166check-qtest-i386-y += tests/usb-hcd-ohci-test$(EXESUF)
167gcov-files-i386-y += hw/usb/hcd-ohci.c
Gonglei44ced582014-06-23 19:53:52 +0800168check-qtest-i386-y += tests/usb-hcd-uhci-test$(EXESUF)
169gcov-files-i386-y += hw/usb/hcd-uhci.c
Andreas Färbercc900d32014-03-30 20:25:38 +0200170check-qtest-i386-y += tests/usb-hcd-ehci-test$(EXESUF)
171gcov-files-i386-y += hw/usb/hcd-ehci.c
Gerd Hoffmannd81d4102014-05-07 16:39:11 +0200172gcov-files-i386-y += hw/usb/dev-hid.c
173gcov-files-i386-y += hw/usb/dev-storage.c
Gonglei25e89ec2014-06-23 19:53:53 +0800174check-qtest-i386-y += tests/usb-hcd-xhci-test$(EXESUF)
175gcov-files-i386-y += hw/usb/hcd-xhci.c
Andreas Färber7fe55c32015-03-13 17:21:11 +0100176check-qtest-i386-y += tests/pc-cpu-test$(EXESUF)
Peter Maydell82172b72014-07-15 18:30:41 +0100177check-qtest-i386-$(CONFIG_LINUX) += tests/vhost-user-test$(EXESUF)
Anthony Liguorid1aaf542012-03-28 15:42:07 +0200178check-qtest-x86_64-y = $(check-qtest-i386-y)
Andreas Färber5ec889b2014-02-14 15:09:28 +0100179gcov-files-i386-y += i386-softmmu/hw/timer/mc146818rtc.c
Andreas Färberc5cd02b2013-01-26 12:45:14 +0100180gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
Paolo Bonzini8fefa312013-07-22 15:54:34 +0200181check-qtest-mips-y = tests/endianness-test$(EXESUF)
182check-qtest-mips64-y = tests/endianness-test$(EXESUF)
183check-qtest-mips64el-y = tests/endianness-test$(EXESUF)
184check-qtest-ppc-y = tests/endianness-test$(EXESUF)
185check-qtest-ppc64-y = tests/endianness-test$(EXESUF)
186check-qtest-sh4-y = tests/endianness-test$(EXESUF)
187check-qtest-sh4eb-y = tests/endianness-test$(EXESUF)
188check-qtest-sparc64-y = tests/endianness-test$(EXESUF)
Anthony Liguoribaeddde2013-01-29 15:42:45 -0600189#check-qtest-sparc-y = tests/m48t59-test$(EXESUF)
Paolo Bonzini8fefa312013-07-22 15:54:34 +0200190#check-qtest-sparc64-y += tests/m48t59-test$(EXESUF)
Andreas Färber5ec889b2014-02-14 15:09:28 +0100191gcov-files-sparc-y += hw/timer/m48t59.c
192gcov-files-sparc64-y += hw/timer/m48t59.c
Andreas Färber6e998902013-01-16 01:57:57 +0100193check-qtest-arm-y = tests/tmp105-test$(EXESUF)
Andreas Färber5ec889b2014-02-14 15:09:28 +0100194gcov-files-arm-y += hw/misc/tmp105.c
Marc Marí0a6ed702015-02-24 22:21:55 +0100195check-qtest-arm-y += tests/virtio-blk-test$(EXESUF)
196gcov-files-arm-y += arm-softmmu/hw/block/virtio-blk.c
Andreas Färber530a7e42013-06-26 15:52:16 +0200197check-qtest-ppc-y += tests/boot-order-test$(EXESUF)
198check-qtest-ppc64-y += tests/boot-order-test$(EXESUF)
Alexey Kardashevskiy04e9a202014-02-10 14:52:56 +1100199check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF)
200gcov-files-ppc64-y += ppc64-softmmu/hw/ppc/spapr_pci.c
Andreas Färber7c41f212013-07-29 05:44:47 +0200201check-qtest-microblazeel-y = $(check-qtest-microblaze-y)
Andreas Färber7c41f212013-07-29 05:44:47 +0200202check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
Anthony Liguorid1aaf542012-03-28 15:42:07 +0200203
Peter Maydell3687d532014-01-23 16:22:59 +0000204# qom-test works for all sysemu architectures:
205$(foreach target,$(SYSEMU_TARGET_LIST), \
Michael Roth2b8419c2014-09-18 17:59:33 -0500206 $(if $(findstring tests/qom-test$(EXESUF), $(check-qtest-$(target)-y)),, \
207 $(eval check-qtest-$(target)-y += tests/qom-test$(EXESUF))))
Peter Maydell3687d532014-01-23 16:22:59 +0000208
Markus Armbruster98626572013-07-27 17:41:53 +0200209check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
Eric Blakead11dbb2015-05-04 09:05:03 -0600210 comments.json empty.json enum-empty.json enum-missing-data.json \
211 enum-wrong-data.json enum-int-member.json enum-dict-member.json \
212 enum-clash-member.json enum-max-member.json enum-union-clash.json \
Eric Blake9050c652015-05-04 09:05:14 -0600213 enum-bad-name.json funny-char.json indented-expr.json \
214 missing-type.json bad-ident.json ident-with-escape.json \
Eric Blakea7f59662015-05-04 09:05:36 -0600215 escape-outside-string.json unknown-escape.json \
216 escape-too-short.json escape-too-big.json unicode-str.json \
Eric Blake9050c652015-05-04 09:05:14 -0600217 double-type.json bad-base.json bad-type-bool.json bad-type-int.json \
218 bad-type-dict.json double-data.json unknown-expr-key.json \
Eric Blakecfdd5bc2015-05-04 09:05:16 -0600219 redefined-type.json redefined-command.json redefined-builtin.json \
Eric Blake0d8b9fb2015-05-04 09:05:20 -0600220 redefined-event.json command-int.json bad-data.json event-max.json \
Eric Blaked708cdb2015-05-04 09:05:19 -0600221 type-bypass.json type-bypass-no-gen.json type-bypass-bad-gen.json \
Eric Blake0d8b9fb2015-05-04 09:05:20 -0600222 data-array-empty.json data-array-unknown.json data-int.json \
223 data-unknown.json data-member-unknown.json data-member-array.json \
224 data-member-array-bad.json returns-array-bad.json returns-int.json \
225 returns-unknown.json returns-alternate.json returns-whitelist.json \
226 missing-colon.json missing-comma-list.json missing-comma-object.json \
227 nested-struct-data.json nested-struct-returns.json non-objects.json \
Eric Blake04404c22014-09-26 09:20:31 -0600228 qapi-schema-test.json quoted-structural-chars.json \
229 trailing-comma-list.json trailing-comma-object.json \
230 unclosed-list.json unclosed-object.json unclosed-string.json \
Eric Blake3d0c4822015-05-04 09:05:05 -0600231 duplicate-key.json union-invalid-base.json union-bad-branch.json \
232 union-optional-branch.json union-unknown.json union-max.json \
233 flat-union-optional-discriminator.json flat-union-no-base.json \
234 flat-union-invalid-discriminator.json flat-union-inline.json \
Eric Blake04404c22014-09-26 09:20:31 -0600235 flat-union-invalid-branch-key.json flat-union-reverse-define.json \
Eric Blake3d0c4822015-05-04 09:05:05 -0600236 flat-union-string-discriminator.json union-base-no-discriminator.json \
237 flat-union-bad-discriminator.json flat-union-bad-base.json \
238 flat-union-base-star.json flat-union-int-branch.json \
239 flat-union-base-union.json flat-union-branch-clash.json \
240 alternate-nested.json alternate-unknown.json alternate-clash.json \
241 alternate-good.json alternate-base.json alternate-array.json \
242 alternate-conflict-string.json alternate-conflict-dict.json \
Eric Blake04404c22014-09-26 09:20:31 -0600243 include-simple.json include-relpath.json include-format-err.json \
244 include-non-file.json include-no-file.json include-before-err.json \
245 include-nested-err.json include-self-cycle.json include-cycle.json \
Eric Blakeff55d722015-05-04 09:05:37 -0600246 include-repetition.json event-nest-struct.json event-case.json \
247 struct-base-clash.json struct-base-clash-deep.json )
Markus Armbruster98626572013-07-27 17:41:53 +0200248
Wenchao Xiaf6dadb02014-06-18 08:43:29 +0200249GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h \
Eric Blake04404c22014-09-26 09:20:31 -0600250 tests/test-qmp-commands.h tests/test-qapi-event.h
Anthony Liguoridbfe06c2012-01-10 13:10:43 -0600251
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200252test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \
253 tests/check-qlist.o tests/check-qfloat.o tests/check-qjson.o \
254 tests/test-coroutine.o tests/test-string-output-visitor.o \
255 tests/test-string-input-visitor.o tests/test-qmp-output-visitor.o \
256 tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \
Eduardo Habkost247c9de2013-01-23 15:58:27 -0200257 tests/test-qmp-commands.o tests/test-visitor-serialization.o \
Laszlo Ersek3953e3a2013-08-20 00:35:40 +0200258 tests/test-x86-cpuid.o tests/test-mul64.o tests/test-int128.o \
Paolo Bonzini8fda74a2013-06-21 09:09:34 +0200259 tests/test-opts-visitor.o tests/test-qmp-event.o \
Mike Day341774f2013-08-27 11:38:45 -0400260 tests/rcutorture.o tests/test-rcu-list.o
Anthony Liguoridbfe06c2012-01-10 13:10:43 -0600261
Wenchao Xiaf6dadb02014-06-18 08:43:29 +0200262test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o \
Eric Blake04404c22014-09-26 09:20:31 -0600263 tests/test-qapi-event.o
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200264
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200265$(test-obj-y): QEMU_INCLUDES += -Itests
Anthony Liguoric4efe1c2013-04-16 09:45:16 -0500266QEMU_CFLAGS += -I$(SRC_PATH)/tests
Igor Mammedov14389db2013-12-20 22:14:40 +0100267qom-core-obj = qom/object.o qom/qom-qobject.o qom/container.o
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200268
Paolo Bonzinia3728232012-12-20 16:10:26 +0100269tests/check-qint$(EXESUF): tests/check-qint.o libqemuutil.a
270tests/check-qstring$(EXESUF): tests/check-qstring.o libqemuutil.a
271tests/check-qdict$(EXESUF): tests/check-qdict.o libqemuutil.a
272tests/check-qlist$(EXESUF): tests/check-qlist.o libqemuutil.a
273tests/check-qfloat$(EXESUF): tests/check-qfloat.o libqemuutil.a
274tests/check-qjson$(EXESUF): tests/check-qjson.o libqemuutil.a libqemustub.a
Peter Crosthwaite3dbe85b2014-01-15 03:05:36 -0800275tests/check-qom-interface$(EXESUF): tests/check-qom-interface.o $(qom-core-obj) libqemuutil.a libqemustub.a
Paolo Bonzinif157ebb2012-12-20 16:09:36 +0100276tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(block-obj-y) libqemuutil.a libqemustub.a
277tests/test-aio$(EXESUF): tests/test-aio.o $(block-obj-y) libqemuutil.a libqemustub.a
Stefan Hajnoczi2da61b62014-03-03 11:30:03 +0100278tests/test-rfifolock$(EXESUF): tests/test-rfifolock.o libqemuutil.a libqemustub.a
Benoît Canetf17cfe82013-09-02 14:14:38 +0200279tests/test-throttle$(EXESUF): tests/test-throttle.o $(block-obj-y) libqemuutil.a libqemustub.a
Paolo Bonzinif157ebb2012-12-20 16:09:36 +0100280tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(block-obj-y) libqemuutil.a libqemustub.a
281tests/test-iov$(EXESUF): tests/test-iov.o libqemuutil.a
Paolo Bonzinie7c033c2013-01-21 17:09:40 +0100282tests/test-hbitmap$(EXESUF): tests/test-hbitmap.o libqemuutil.a libqemustub.a
Eduardo Habkost247c9de2013-01-23 15:58:27 -0200283tests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o
Dr. David Alan Gilbert60fe6372014-12-12 11:13:38 +0000284tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o page_cache.o libqemuutil.a
Eduardo Habkoste3f9fe22013-02-04 16:27:45 -0200285tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o
Paolo Bonzini6046c622013-06-20 16:19:32 +0200286tests/test-int128$(EXESUF): tests/test-int128.o
Paolo Bonzinia4649822015-02-11 17:15:18 +0100287tests/rcutorture$(EXESUF): tests/rcutorture.o libqemuutil.a libqemustub.a
Mike Day341774f2013-08-27 11:38:45 -0400288tests/test-rcu-list$(EXESUF): tests/test-rcu-list.o libqemuutil.a libqemustub.a
Paolo Bonzini8fda74a2013-06-21 09:09:34 +0200289
Eduardo Habkost747b0cb2013-07-10 17:08:40 -0300290tests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o \
Igor Mammedov5e954942014-02-05 16:36:52 +0100291 hw/core/qdev.o hw/core/qdev-properties.o hw/core/hotplug.o\
Eduardo Habkost747b0cb2013-07-10 17:08:40 -0300292 hw/core/irq.o \
Paolo Bonzini6b1566c2014-03-17 13:40:23 +1100293 hw/core/fw-path-provider.o \
Igor Mammedov14389db2013-12-20 22:14:40 +0100294 $(qom-core-obj) \
Eduardo Habkost747b0cb2013-07-10 17:08:40 -0300295 $(test-qapi-obj-y) \
296 libqemuutil.a libqemustub.a
Eduardo Habkost2668b4b2013-11-28 12:01:18 -0200297tests/test-vmstate$(EXESUF): tests/test-vmstate.o \
Dr. David Alan Gilbert977184d2014-12-12 11:13:41 +0000298 migration/vmstate.o migration/qemu-file.o migration/qemu-file-buf.o \
Alexander Graf8118f092015-01-22 15:01:39 +0100299 migration/qemu-file-unix.o qjson.o \
300 $(qom-core-obj) \
Dr. David Alan Gilbert9935bac2014-10-10 12:39:05 +0100301 libqemuutil.a libqemustub.a
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200302
303tests/test-qapi-types.c tests/test-qapi-types.h :\
Markus Armbruster4f193e32013-07-27 17:41:54 +0200304$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
Lluís Vilanova0a607742014-05-02 15:52:24 +0200305 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
Lluís Vilanova33aaad52014-05-02 15:52:35 +0200306 $(gen-out-type) -o tests -p "test-" -i $<, \
Lluís Vilanova0a607742014-05-02 15:52:24 +0200307 " GEN $@")
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200308tests/test-qapi-visit.c tests/test-qapi-visit.h :\
Markus Armbruster4f193e32013-07-27 17:41:54 +0200309$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
Lluís Vilanova0a607742014-05-02 15:52:24 +0200310 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
Lluís Vilanova33aaad52014-05-02 15:52:35 +0200311 $(gen-out-type) -o tests -p "test-" -i $<, \
Lluís Vilanova0a607742014-05-02 15:52:24 +0200312 " GEN $@")
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200313tests/test-qmp-commands.h tests/test-qmp-marshal.c :\
Markus Armbruster4f193e32013-07-27 17:41:54 +0200314$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
Lluís Vilanova0a607742014-05-02 15:52:24 +0200315 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
Lluís Vilanova33aaad52014-05-02 15:52:35 +0200316 $(gen-out-type) -o tests -p "test-" -i $<, \
Lluís Vilanova0a607742014-05-02 15:52:24 +0200317 " GEN $@")
Wenchao Xiaf6dadb02014-06-18 08:43:29 +0200318tests/test-qapi-event.c tests/test-qapi-event.h :\
319$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-event.py
320 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
321 $(gen-out-type) -o tests -p "test-" -i $<, \
322 " GEN $@")
Anthony Liguoridbfe06c2012-01-10 13:10:43 -0600323
Paolo Bonzini8a090702012-12-20 15:40:20 +0100324tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
325tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
Wenchao Xiaf6dadb02014-06-18 08:43:29 +0200326tests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
Paolo Bonzini8a090702012-12-20 15:40:20 +0100327tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
328tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
329tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
Fam Zheng169a24a2014-08-07 10:34:41 +0800330tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
Paolo Bonzini8a090702012-12-20 15:40:20 +0100331tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
Laszlo Ersek3953e3a2013-08-20 00:35:40 +0200332tests/test-opts-visitor$(EXESUF): tests/test-opts-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
Paolo Bonzini2d7799f2012-02-09 11:21:03 +0100333
Richard Hendersonf4c0f982013-02-16 12:47:01 -0800334tests/test-mul64$(EXESUF): tests/test-mul64.o libqemuutil.a
Peter Maydell34647002013-06-28 12:40:32 +0100335tests/test-bitops$(EXESUF): tests/test-bitops.o libqemuutil.a
Richard Hendersonf4c0f982013-02-16 12:47:01 -0800336
Marc Marí292be092014-10-23 10:12:42 +0200337libqos-obj-y = tests/libqos/pci.o tests/libqos/fw_cfg.o tests/libqos/malloc.o
John Snow90e5add2015-01-19 15:15:55 -0500338libqos-obj-y += tests/libqos/i2c.o tests/libqos/libqos.o
Markus Armbruster26491a32013-06-26 15:52:22 +0200339libqos-pc-obj-y = $(libqos-obj-y) tests/libqos/pci-pc.o
John Snow90e5add2015-01-19 15:15:55 -0500340libqos-pc-obj-y += tests/libqos/malloc-pc.o tests/libqos/libqos-pc.o
John Snow9a75b0a2015-01-19 15:16:03 -0500341libqos-pc-obj-y += tests/libqos/ahci.o
Andreas Färbercc9936a2013-05-02 15:56:26 +0200342libqos-omap-obj-y = $(libqos-obj-y) tests/libqos/i2c-omap.o
Igor Mammedovb0354ec2014-09-26 09:28:12 +0000343libqos-usb-obj-y = $(libqos-pc-obj-y) tests/libqos/usb.o
Marc Marí0a6ed702015-02-24 22:21:55 +0100344libqos-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
Anthony Liguoric4efe1c2013-04-16 09:45:16 -0500345
Paolo Bonziniff667e22012-12-21 09:45:20 +0100346tests/rtc-test$(EXESUF): tests/rtc-test.o
347tests/m48t59-test$(EXESUF): tests/m48t59-test.o
Paolo Bonzini8fefa312013-07-22 15:54:34 +0200348tests/endianness-test$(EXESUF): tests/endianness-test.o
Alexey Kardashevskiy04e9a202014-02-10 14:52:56 +1100349tests/spapr-phb-test$(EXESUF): tests/spapr-phb-test.o $(libqos-obj-y)
Paolo Bonziniff667e22012-12-21 09:45:20 +0100350tests/fdc-test$(EXESUF): tests/fdc-test.o
Kevin Wolfacbe4802013-05-08 11:18:41 +0200351tests/ide-test$(EXESUF): tests/ide-test.o $(libqos-pc-obj-y)
John Snow90e5add2015-01-19 15:15:55 -0500352tests/ahci-test$(EXESUF): tests/ahci-test.o $(libqos-pc-obj-y)
Paolo Bonziniff667e22012-12-21 09:45:20 +0100353tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o
Andreas Färber530a7e42013-06-26 15:52:16 +0200354tests/boot-order-test$(EXESUF): tests/boot-order-test.o $(libqos-obj-y)
Gabriel L. Somlo501f28c2014-05-27 15:03:14 -0400355tests/bios-tables-test$(EXESUF): tests/bios-tables-test.o $(libqos-obj-y)
Andreas Färbercc9936a2013-05-02 15:56:26 +0200356tests/tmp105-test$(EXESUF): tests/tmp105-test.o $(libqos-omap-obj-y)
Anthony Liguori9bda4132013-04-16 09:45:19 -0500357tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y)
Anthony Liguoribf2a38d2013-04-16 09:45:21 -0500358tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y)
Andreas Färbera21baf72013-11-07 18:25:10 +0100359tests/e1000-test$(EXESUF): tests/e1000-test.o
Frediano Ziglio069bb582015-01-08 18:38:23 +0000360tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o $(libqos-pc-obj-y)
Andreas Färber85f68d52013-11-07 18:53:28 +0100361tests/pcnet-test$(EXESUF): tests/pcnet-test.o
Andreas Färber92838a12013-11-07 19:18:46 +0100362tests/eepro100-test$(EXESUF): tests/eepro100-test.o
Andreas Färber4a053e72013-11-07 18:37:34 +0100363tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o
Andreas Färber5297ea62014-02-09 04:01:37 +0100364tests/ne2000-test$(EXESUF): tests/ne2000-test.o
Paolo Bonzinif52b7682014-07-15 14:57:06 +0200365tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o
Andreas Färber02063aa2014-02-09 04:39:47 +0100366tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o
Marc Marí311e6662014-09-01 12:07:54 +0200367tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o $(libqos-virtio-obj-y)
Igor Mammedov92247092014-09-26 09:28:10 +0000368tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o $(libqos-pc-obj-y)
Igor Mammedovd1f3fc22014-09-26 09:28:09 +0000369tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o $(libqos-pc-obj-y)
Andreas Färber26c9a012014-02-21 16:42:15 +0100370tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o
Andreas Färber2d888c02014-02-21 17:15:21 +0100371tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o
Andreas Färberaa974052014-02-21 17:36:57 +0100372tests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o
Andreas Färber6e8114a2014-02-21 17:49:12 +0100373tests/virtio-console-test$(EXESUF): tests/virtio-console-test.o
Andreas Färber76491072014-02-09 03:48:44 +0100374tests/tpci200-test$(EXESUF): tests/tpci200-test.o
Gerd Hoffmann0850fd52014-04-28 11:01:13 +0200375tests/display-vga-test$(EXESUF): tests/display-vga-test.o
Andreas Färber37146822014-02-09 12:24:15 +0100376tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
Andreas Färber7c41f212013-07-29 05:44:47 +0200377tests/qom-test$(EXESUF): tests/qom-test.o
Markus Armbrustere2f3f222014-10-02 16:51:31 +0200378tests/drive_del-test$(EXESUF): tests/drive_del-test.o $(libqos-pc-obj-y)
Stefan Hajnoczi43cd2092013-10-30 14:54:35 +0100379tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y)
Andreas Färberfc967792014-02-21 22:19:43 +0100380tests/nvme-test$(EXESUF): tests/nvme-test.o
Andreas Färberabc53732014-02-21 20:38:48 +0100381tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o
Andreas Färbere683eb92014-02-21 22:43:43 +0100382tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o
Andreas Färberd7b50c02014-03-30 19:00:05 +0200383tests/ac97-test$(EXESUF): tests/ac97-test.o
Andreas Färber8fa74c92014-03-30 19:05:20 +0200384tests/es1370-test$(EXESUF): tests/es1370-test.o
Andreas Färberfbaf4452014-03-30 19:22:48 +0200385tests/intel-hda-test$(EXESUF): tests/intel-hda-test.o
Andreas Färberefbf5df2014-03-30 20:02:00 +0200386tests/ioh3420-test$(EXESUF): tests/ioh3420-test.o
Igor Mammedovb3937682014-09-26 09:28:14 +0000387tests/usb-hcd-ohci-test$(EXESUF): tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y)
Igor Mammedovfbd942c2014-09-26 09:28:13 +0000388tests/usb-hcd-uhci-test$(EXESUF): tests/usb-hcd-uhci-test.o $(libqos-usb-obj-y)
Igor Mammedovb0354ec2014-09-26 09:28:12 +0000389tests/usb-hcd-ehci-test$(EXESUF): tests/usb-hcd-ehci-test.o $(libqos-usb-obj-y)
Igor Mammedovb3937682014-09-26 09:28:14 +0000390tests/usb-hcd-xhci-test$(EXESUF): tests/usb-hcd-xhci-test.o $(libqos-usb-obj-y)
Andreas Färber7fe55c32015-03-13 17:21:11 +0100391tests/pc-cpu-test$(EXESUF): tests/pc-cpu-test.o
Nikolay Nikolaeve06cbc32014-06-19 20:35:42 +0300392tests/vhost-user-test$(EXESUF): tests/vhost-user-test.o qemu-char.o qemu-timer.o $(qtest-obj-y)
Wenchao Xiaf93296e2013-09-06 11:24:32 +0800393tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o
Leandro Dorileo4ba6fab2014-05-19 18:53:55 -0300394tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o libqemuutil.a libqemustub.a
Francesco Romanie2462112015-01-12 14:11:13 +0100395tests/test-write-threshold$(EXESUF): tests/test-write-threshold.o $(block-obj-y) libqemuutil.a libqemustub.a
Blue Swirld2a16f72012-03-30 17:39:33 +0000396
Nikolay Nikolaeve06cbc32014-06-19 20:35:42 +0300397ifeq ($(CONFIG_POSIX),y)
398LIBS += -lutil
399endif
Nikolay Nikolaeva77e6b12014-06-10 13:03:23 +0300400
Anthony Liguori49ee3592012-03-28 15:42:05 +0200401# QTest rules
402
403TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
Stefan Hajnoczi5c4e24c2014-03-28 10:55:54 +0100404ifeq ($(CONFIG_POSIX),y)
Anthony Liguori49ee3592012-03-28 15:42:05 +0200405QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),))
Stefan Hajnoczi5c4e24c2014-03-28 10:55:54 +0100406check-qtest-y=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))
407endif
Anthony Liguori49ee3592012-03-28 15:42:05 +0200408
Paolo Bonzini8a090702012-12-20 15:40:20 +0100409qtest-obj-y = tests/libqtest.o libqemuutil.a libqemustub.a
Anthony Liguori49ee3592012-03-28 15:42:05 +0200410$(check-qtest-y): $(qtest-obj-y)
411
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200412.PHONY: check-help
413check-help:
414 @echo "Regression testing targets:"
415 @echo
416 @echo " make check Run all tests"
Anthony Liguori49ee3592012-03-28 15:42:05 +0200417 @echo " make check-qtest-TARGET Run qtest tests for given target"
418 @echo " make check-qtest Run qtest tests"
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200419 @echo " make check-unit Run qobject tests"
Markus Armbruster98626572013-07-27 17:41:53 +0200420 @echo " make check-qapi-schema Run QAPI schema tests"
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200421 @echo " make check-block Run block tests"
422 @echo " make check-report.html Generates an HTML test report"
Wenchao Xia2cdfb122013-09-26 08:42:56 +0800423 @echo " make check-clean Clean the tests"
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200424 @echo
425 @echo "Please note that HTML reports do not regenerate if the unit tests"
426 @echo "has not changed."
427 @echo
428 @echo "The variable SPEED can be set to control the gtester speed setting."
429 @echo "Default options are -k and (for make V=1) --verbose; they can be"
430 @echo "changed with variable GTESTER_OPTIONS."
Paolo Bonzini2d7799f2012-02-09 11:21:03 +0100431
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200432SPEED = quick
433GTESTER_OPTIONS = -k $(if $(V),--verbose,-q)
Blue Swirl1d728c32012-05-01 18:45:39 +0000434GCOV_OPTIONS = -n $(if $(V),-f,)
Anthony Liguoridbfe06c2012-01-10 13:10:43 -0600435
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200436# gtester tests, possibly with verbose output
Anthony Liguoridbfe06c2012-01-10 13:10:43 -0600437
Anthony Liguori49ee3592012-03-28 15:42:05 +0200438.PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS))
439$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: $(check-qtest-y)
Blue Swirl1d728c32012-05-01 18:45:39 +0000440 $(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,)
Anthony Liguori49ee3592012-03-28 15:42:05 +0200441 $(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
John Snow122fdf22015-04-28 15:27:51 -0400442 QTEST_QEMU_IMG=qemu-img$(EXESUF) \
Stefan Hajnoczi04129602013-05-27 15:28:51 +0200443 MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$((RANDOM % 255 + 1))} \
Anthony Liguori49ee3592012-03-28 15:42:05 +0200444 gtester $(GTESTER_OPTIONS) -m=$(SPEED) $(check-qtest-$*-y),"GTESTER $@")
Blue Swirl1d728c32012-05-01 18:45:39 +0000445 $(if $(CONFIG_GCOV),@for f in $(gcov-files-$*-y); do \
446 echo Gcov report for $$f:;\
447 $(GCOV) $(GCOV_OPTIONS) $$f -o `dirname $$f`; \
448 done,)
Anthony Liguori49ee3592012-03-28 15:42:05 +0200449
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200450.PHONY: $(patsubst %, check-%, $(check-unit-y))
451$(patsubst %, check-%, $(check-unit-y)): check-%: %
Blue Swirl1d728c32012-05-01 18:45:39 +0000452 $(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,)
Stefan Hajnoczi04129602013-05-27 15:28:51 +0200453 $(call quiet-command, \
454 MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$((RANDOM % 255 + 1))} \
455 gtester $(GTESTER_OPTIONS) -m=$(SPEED) $*,"GTESTER $*")
Blue Swirl1d728c32012-05-01 18:45:39 +0000456 $(if $(CONFIG_GCOV),@for f in $(gcov-files-$(subst tests/,,$*)-y); do \
457 echo Gcov report for $$f:;\
458 $(GCOV) $(GCOV_OPTIONS) $$f -o `dirname $$f`; \
459 done,)
Anthony Liguoridbfe06c2012-01-10 13:10:43 -0600460
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200461# gtester tests with XML output
462
Anthony Liguori49ee3592012-03-28 15:42:05 +0200463$(patsubst %, check-report-qtest-%.xml, $(QTEST_TARGETS)): check-report-qtest-%.xml: $(check-qtest-y)
464 $(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
465 gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $(check-qtest-$*-y),"GTESTER $@")
466
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200467check-report-unit.xml: $(check-unit-y)
468 $(call quiet-command,gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $^, "GTESTER $@")
469
470# Reports and overall runs
471
Anthony Liguori49ee3592012-03-28 15:42:05 +0200472check-report.xml: $(patsubst %,check-report-qtest-%.xml, $(QTEST_TARGETS)) check-report-unit.xml
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200473 $(call quiet-command,$(SRC_PATH)/scripts/gtester-cat $^ > $@, " GEN $@")
474
475check-report.html: check-report.xml
476 $(call quiet-command,gtester-report $< > $@, " GEN $@")
Kevin Wolf89594492012-03-08 12:29:00 +0100477
Kevin Wolfb8c6f292012-03-09 13:37:40 +0100478
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200479# Other tests
Kevin Wolfb8c6f292012-03-09 13:37:40 +0100480
Wenchao Xia22ee5a52013-09-26 08:42:55 +0800481QEMU_IOTESTS_HELPERS-$(CONFIG_LINUX) = tests/qemu-iotests/socket_scm_helper$(EXESUF)
482
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200483.PHONY: check-tests/qemu-iotests-quick.sh
Wenchao Xia22ee5a52013-09-26 08:42:55 +0800484check-tests/qemu-iotests-quick.sh: tests/qemu-iotests-quick.sh qemu-img$(EXESUF) qemu-io$(EXESUF) $(QEMU_IOTESTS_HELPERS-y)
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200485 $<
Kevin Wolfb8c6f292012-03-09 13:37:40 +0100486
Markus Armbruster98626572013-07-27 17:41:53 +0200487.PHONY: check-tests/test-qapi.py
488check-tests/test-qapi.py: tests/test-qapi.py
489
490.PHONY: $(patsubst %, check-%, $(check-qapi-schema-y))
491$(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
Lluís Vilanova0a607742014-05-02 15:52:24 +0200492 $(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts \
493 $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py \
Lluís Vilanova33aaad52014-05-02 15:52:35 +0200494 $^ >$*.test.out 2>$*.test.err; \
Lluís Vilanova0a607742014-05-02 15:52:24 +0200495 echo $$? >$*.test.exit, \
496 " TEST $*.out")
Markus Armbrusterd8039e52013-09-24 09:43:39 +0200497 @diff -q $(SRC_PATH)/$*.out $*.test.out
Lluís Vilanova33aaad52014-05-02 15:52:35 +0200498 @# Sanitize error messages (make them independent of build directory)
499 @perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q $(SRC_PATH)/$*.err -
Markus Armbrusterd8039e52013-09-24 09:43:39 +0200500 @diff -q $(SRC_PATH)/$*.exit $*.test.exit
Markus Armbruster98626572013-07-27 17:41:53 +0200501
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200502# Consolidated targets
503
Wenchao Xia2cdfb122013-09-26 08:42:56 +0800504.PHONY: check-qapi-schema check-qtest check-unit check check-clean
Markus Armbruster98626572013-07-27 17:41:53 +0200505check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y))
Anthony Liguori49ee3592012-03-28 15:42:05 +0200506check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200507check-unit: $(patsubst %,check-%, $(check-unit-y))
508check-block: $(patsubst %,check-%, $(check-block-y))
Markus Armbruster98626572013-07-27 17:41:53 +0200509check: check-qapi-schema check-unit check-qtest
Wenchao Xia2cdfb122013-09-26 08:42:56 +0800510check-clean:
511 $(MAKE) -C tests/tcg clean
Andreas Färberf85e3452014-04-07 18:33:22 +0200512 rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
513 rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y)))
Wenchao Xia2cdfb122013-09-26 08:42:56 +0800514
515clean: check-clean
Eduardo Habkost14117c72012-07-18 14:22:27 -0300516
Wenchao Xia22ee5a52013-09-26 08:42:55 +0800517# Build the help program automatically
518
519all: $(QEMU_IOTESTS_HELPERS-y)
520
Eduardo Habkost14117c72012-07-18 14:22:27 -0300521-include $(wildcard tests/*.d)
Anthony Liguoridb2b5502013-06-26 15:52:14 +0200522-include $(wildcard tests/libqos/*.d)