blob: 651d8b2dac0c574112b69895608fb4703ed71e29 [file] [log] [blame]
Kevin Wolf89594492012-03-08 12:29:00 +01001export SRC_PATH
2
Daniel P. Berrangeb1245332015-09-02 11:35:52 +01003qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
4
Peter Maydell3687d532014-01-23 16:22:59 +00005# Get the list of all supported sysemu targets
6SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
7 $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak)))
8
Paolo Bonzinib93b63f2012-03-28 15:42:01 +02009check-unit-y = tests/check-qdict$(EXESUF)
Paolo Bonzini5f7a74a2013-01-15 09:49:35 +010010gcov-files-check-qdict-y = qobject/qdict.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020011check-unit-y += tests/check-qfloat$(EXESUF)
Paolo Bonzini5f7a74a2013-01-15 09:49:35 +010012gcov-files-check-qfloat-y = qobject/qfloat.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020013check-unit-y += tests/check-qint$(EXESUF)
Paolo Bonzini5f7a74a2013-01-15 09:49:35 +010014gcov-files-check-qint-y = qobject/qint.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020015check-unit-y += tests/check-qstring$(EXESUF)
Paolo Bonzini5f7a74a2013-01-15 09:49:35 +010016gcov-files-check-qstring-y = qobject/qstring.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020017check-unit-y += tests/check-qlist$(EXESUF)
Paolo Bonzini5f7a74a2013-01-15 09:49:35 +010018gcov-files-check-qlist-y = qobject/qlist.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020019check-unit-y += tests/check-qjson$(EXESUF)
Paolo Bonzini5f7a74a2013-01-15 09:49:35 +010020gcov-files-check-qjson-y = qobject/qjson.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020021check-unit-y += tests/test-qmp-output-visitor$(EXESUF)
Blue Swirl1d728c32012-05-01 18:45:39 +000022gcov-files-test-qmp-output-visitor-y = qapi/qmp-output-visitor.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020023check-unit-y += tests/test-qmp-input-visitor$(EXESUF)
Blue Swirl1d728c32012-05-01 18:45:39 +000024gcov-files-test-qmp-input-visitor-y = qapi/qmp-input-visitor.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020025check-unit-y += tests/test-qmp-input-strict$(EXESUF)
26check-unit-y += tests/test-qmp-commands$(EXESUF)
Blue Swirl1d728c32012-05-01 18:45:39 +000027gcov-files-test-qmp-commands-y = qapi/qmp-dispatch.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020028check-unit-y += tests/test-string-input-visitor$(EXESUF)
Blue Swirl1d728c32012-05-01 18:45:39 +000029gcov-files-test-string-input-visitor-y = qapi/string-input-visitor.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020030check-unit-y += tests/test-string-output-visitor$(EXESUF)
Blue Swirl1d728c32012-05-01 18:45:39 +000031gcov-files-test-string-output-visitor-y = qapi/string-output-visitor.c
Wenchao Xiaf6dadb02014-06-18 08:43:29 +020032check-unit-y += tests/test-qmp-event$(EXESUF)
33gcov-files-test-qmp-event-y += qapi/qmp-event.c
Laszlo Ersek3953e3a2013-08-20 00:35:40 +020034check-unit-y += tests/test-opts-visitor$(EXESUF)
35gcov-files-test-opts-visitor-y = qapi/opts-visitor.c
Paolo Bonzinib93b63f2012-03-28 15:42:01 +020036check-unit-y += tests/test-coroutine$(EXESUF)
Peter Maydell7c2acc72013-04-08 12:11:27 +010037gcov-files-test-coroutine-y = coroutine-$(CONFIG_COROUTINE_BACKEND).c
Michael Roth2d496102012-02-21 21:05:07 -060038check-unit-y += tests/test-visitor-serialization$(EXESUF)
Michael Tokarev2278a692012-06-07 20:08:19 +040039check-unit-y += tests/test-iov$(EXESUF)
Paolo Bonzini5f7a74a2013-01-15 09:49:35 +010040gcov-files-test-iov-y = util/iov.c
Paolo Bonzinib2ea25d2012-11-23 16:13:23 +010041check-unit-y += tests/test-aio$(EXESUF)
Stefan Hajnoczid597a322014-03-28 10:55:53 +010042check-unit-$(CONFIG_POSIX) += tests/test-rfifolock$(EXESUF)
Benoît Canetf17cfe82013-09-02 14:14:38 +020043check-unit-y += tests/test-throttle$(EXESUF)
Blue Swirl1d728c32012-05-01 18:45:39 +000044gcov-files-test-aio-$(CONFIG_WIN32) = aio-win32.c
45gcov-files-test-aio-$(CONFIG_POSIX) = aio-posix.c
Paolo Bonzini74c856e2012-11-23 16:13:24 +010046check-unit-y += tests/test-thread-pool$(EXESUF)
Blue Swirl1d728c32012-05-01 18:45:39 +000047gcov-files-test-thread-pool-y = thread-pool.c
Paolo Bonzinie7c033c2013-01-21 17:09:40 +010048gcov-files-test-hbitmap-y = util/hbitmap.c
49check-unit-y += tests/test-hbitmap$(EXESUF)
Stefan Hajnoczi6c6f3122015-11-05 18:13:20 -050050gcov-files-test-hbitmap-y = blockjob.c
51check-unit-y += tests/test-blockjob-txn$(EXESUF)
Eduardo Habkost247c9de2013-01-23 15:58:27 -020052check-unit-y += tests/test-x86-cpuid$(EXESUF)
53# all code tested by test-x86-cpuid is inside topology.h
54gcov-files-test-x86-cpuid-y =
Dr. David Alan Gilbert60fe6372014-12-12 11:13:38 +000055ifeq ($(CONFIG_SOFTMMU),y)
Orit Wasserman21e3cd22013-01-31 09:12:16 +020056check-unit-y += tests/test-xbzrle$(EXESUF)
Dr. David Alan Gilbert60fe6372014-12-12 11:13:38 +000057gcov-files-test-xbzrle-y = migration/xbzrle.c
58check-unit-$(CONFIG_POSIX) += tests/test-vmstate$(EXESUF)
59endif
Eduardo Habkoste3f9fe22013-02-04 16:27:45 -020060check-unit-y += tests/test-cutils$(EXESUF)
61gcov-files-test-cutils-y += util/cutils.c
Richard Hendersonf4c0f982013-02-16 12:47:01 -080062check-unit-y += tests/test-mul64$(EXESUF)
63gcov-files-test-mul64-y = util/host-utils.c
Paolo Bonzini6046c622013-06-20 16:19:32 +020064check-unit-y += tests/test-int128$(EXESUF)
65# all code tested by test-int128 is inside int128.h
66gcov-files-test-int128-y =
Paolo Bonzini8fda74a2013-06-21 09:09:34 +020067check-unit-y += tests/rcutorture$(EXESUF)
68gcov-files-rcutorture-y = util/rcu.c
Mike Day341774f2013-08-27 11:38:45 -040069check-unit-y += tests/test-rcu-list$(EXESUF)
70gcov-files-test-rcu-list-y = util/rcu.c
Peter Maydell34647002013-06-28 12:40:32 +010071check-unit-y += tests/test-bitops$(EXESUF)
Michael S. Tsirkin9d414012014-09-18 20:46:45 +030072check-unit-$(CONFIG_HAS_GLIB_SUBPROCESS_TESTS) += tests/test-qdev-global-props$(EXESUF)
Igor Mammedov14389db2013-12-20 22:14:40 +010073check-unit-y += tests/check-qom-interface$(EXESUF)
74gcov-files-check-qom-interface-y = qom/object.c
Daniel P. Berrangea31bdae2015-05-13 17:14:06 +010075check-unit-y += tests/check-qom-proplist$(EXESUF)
76gcov-files-check-qom-proplist-y = qom/object.c
Leandro Dorileo4ba6fab2014-05-19 18:53:55 -030077check-unit-y += tests/test-qemu-opts$(EXESUF)
78gcov-files-test-qemu-opts-y = qom/test-qemu-opts.c
Francesco Romanie2462112015-01-12 14:11:13 +010079check-unit-y += tests/test-write-threshold$(EXESUF)
80gcov-files-test-write-threshold-y = block/write-threshold.c
Daniel P. Berrangeddbb0d02015-07-01 18:10:29 +010081check-unit-$(CONFIG_GNUTLS_HASH) += tests/test-crypto-hash$(EXESUF)
Daniel P. Berrangeca38a4c2015-07-01 18:10:32 +010082check-unit-y += tests/test-crypto-cipher$(EXESUF)
Daniel P. Berrangeac1d8872015-10-14 09:58:38 +010083check-unit-y += tests/test-crypto-secret$(EXESUF)
Daniel P. Berrange9a2fd432015-04-13 14:01:39 +010084check-unit-$(CONFIG_GNUTLS) += tests/test-crypto-tlscredsx509$(EXESUF)
Daniel P. Berranged321e1e2015-03-02 17:23:31 +000085check-unit-$(CONFIG_GNUTLS) += tests/test-crypto-tlssession$(EXESUF)
Marc-André Lureau62c39b32015-10-02 14:58:18 +020086check-unit-$(CONFIG_LINUX) += tests/test-qga$(EXESUF)
Alberto Garciabd797fc2015-10-28 17:33:01 +020087check-unit-y += tests/test-timed-average$(EXESUF)
Daniel P. Berrangeb02db2d2015-03-18 17:25:45 +000088check-unit-y += tests/test-io-task$(EXESUF)
Daniel P. Berrange559607e2015-02-27 16:19:33 +000089check-unit-y += tests/test-io-channel-socket$(EXESUF)
Daniel P. Berranged6e48862015-02-27 18:25:25 +000090check-unit-y += tests/test-io-channel-file$(EXESUF)
Daniel P. Berrangeed8ee422015-03-02 18:13:13 +000091check-unit-$(CONFIG_GNUTLS) += tests/test-io-channel-tls$(EXESUF)
Daniel P. Berrange195e14d2015-08-27 16:25:30 +010092check-unit-y += tests/test-io-channel-command$(EXESUF)
Daniel P. Berranged98e4eb2015-09-15 17:27:33 +010093check-unit-y += tests/test-io-channel-buffer$(EXESUF)
Daniel P. Berrange89bc0b62015-11-23 15:24:50 +000094check-unit-y += tests/test-base64$(EXESUF)
Daniel P. Berrangec44e92a2016-04-04 15:08:45 +010095check-unit-$(if $(CONFIG_NETTLE_KDF),y,$(CONFIG_GCRYPT_KDF)) += tests/test-crypto-pbkdf$(EXESUF)
Daniel P. Berrangecb730892015-10-15 12:35:28 +010096check-unit-y += tests/test-crypto-ivgen$(EXESUF)
Daniel P. Berrange5a95e0f2015-10-23 16:14:25 +010097check-unit-y += tests/test-crypto-afsplit$(EXESUF)
Daniel P. Berrange84f7f182016-02-11 14:00:17 +000098check-unit-y += tests/test-crypto-xts$(EXESUF)
Daniel P. Berrange7d969012015-10-24 11:44:13 +010099check-unit-y += tests/test-crypto-block$(EXESUF)
Alex Bennée35145522016-03-15 14:30:20 +0000100gcov-files-test-logging-y = tests/test-logging.c
101check-unit-y += tests/test-logging$(EXESUF)
Anthony Liguoriad65aa82012-01-10 13:10:51 -0600102
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200103check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
Anthony Liguoridbfe06c2012-01-10 13:10:43 -0600104
Anthony Liguorid1aaf542012-03-28 15:42:07 +0200105# All QTests for now are POSIX-only, but the dependencies are
106# really in libqtest, not in the testcases themselves.
Andreas Färbera21baf72013-11-07 18:25:10 +0100107
Markus Armbruster2d1abb82015-10-01 10:59:56 +0200108check-qtest-generic-y = tests/device-introspect-test$(EXESUF)
109gcov-files-generic-y = qdev-monitor.c qmp.c
Markus Armbrustere253c282015-10-01 10:59:53 +0200110
Andreas Färber1f9c4cf2013-08-02 00:48:40 +0200111gcov-files-ipack-y += hw/ipack/ipack.c
Andreas Färber37146822014-02-09 12:24:15 +0100112check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF)
113gcov-files-ipack-y += hw/char/ipoctal232.c
114
Andreas Färber6e8114a2014-02-21 17:49:12 +0100115check-qtest-virtioserial-y += tests/virtio-console-test$(EXESUF)
116gcov-files-virtioserial-y += hw/char/virtio-console.c
117
Andreas Färberb815ec52014-02-09 04:13:37 +0100118gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio.c
119check-qtest-virtio-y += tests/virtio-net-test$(EXESUF)
120gcov-files-virtio-y += i386-softmmu/hw/net/virtio-net.c
Andreas Färber02063aa2014-02-09 04:39:47 +0100121check-qtest-virtio-y += tests/virtio-balloon-test$(EXESUF)
122gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio-balloon.c
Andreas Färberc7a59be2014-02-09 04:32:55 +0100123check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF)
124gcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c
Andreas Färberb6f46f02014-02-09 04:43:10 +0100125check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF)
126gcov-files-virtio-y += hw/virtio/virtio-rng.c
Andreas Färber26c9a012014-02-21 16:42:15 +0100127check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF)
128gcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c
Andreas Färber2d888c02014-02-21 17:15:21 +0100129ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
130check-qtest-virtio-y += tests/virtio-9p-test$(EXESUF)
131gcov-files-virtio-y += hw/9pfs/virtio-9p.c
132gcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c
133endif
Andreas Färberaa974052014-02-21 17:36:57 +0100134check-qtest-virtio-y += tests/virtio-serial-test$(EXESUF)
135gcov-files-virtio-y += i386-softmmu/hw/char/virtio-serial-bus.c
Andreas Färber6e8114a2014-02-21 17:49:12 +0100136check-qtest-virtio-y += $(check-qtest-virtioserial-y)
137gcov-files-virtio-y += $(gcov-files-virtioserial-y)
Andreas Färberb815ec52014-02-09 04:13:37 +0100138
Andreas Färbera21baf72013-11-07 18:25:10 +0100139check-qtest-pci-y += tests/e1000-test$(EXESUF)
140gcov-files-pci-y += hw/net/e1000.c
Andreas Färber74769fe2013-11-07 18:43:09 +0100141check-qtest-pci-y += tests/rtl8139-test$(EXESUF)
142gcov-files-pci-y += hw/net/rtl8139.c
Andreas Färber85f68d52013-11-07 18:53:28 +0100143check-qtest-pci-y += tests/pcnet-test$(EXESUF)
144gcov-files-pci-y += hw/net/pcnet.c
145gcov-files-pci-y += hw/net/pcnet-pci.c
Andreas Färber92838a12013-11-07 19:18:46 +0100146check-qtest-pci-y += tests/eepro100-test$(EXESUF)
147gcov-files-pci-y += hw/net/eepro100.c
Andreas Färber5297ea62014-02-09 04:01:37 +0100148check-qtest-pci-y += tests/ne2000-test$(EXESUF)
149gcov-files-pci-y += hw/net/ne2000.c
Andreas Färberfc967792014-02-21 22:19:43 +0100150check-qtest-pci-y += tests/nvme-test$(EXESUF)
151gcov-files-pci-y += hw/block/nvme.c
Andreas Färberd7b50c02014-03-30 19:00:05 +0200152check-qtest-pci-y += tests/ac97-test$(EXESUF)
153gcov-files-pci-y += hw/audio/ac97.c
Andreas Färber8fa74c92014-03-30 19:05:20 +0200154check-qtest-pci-y += tests/es1370-test$(EXESUF)
155gcov-files-pci-y += hw/audio/es1370.c
Andreas Färberb815ec52014-02-09 04:13:37 +0100156check-qtest-pci-y += $(check-qtest-virtio-y)
157gcov-files-pci-y += $(gcov-files-virtio-y) hw/virtio/virtio-pci.c
Andreas Färber76491072014-02-09 03:48:44 +0100158check-qtest-pci-y += tests/tpci200-test$(EXESUF)
Andreas Färber83bb0b22014-02-21 16:29:17 +0100159gcov-files-pci-y += hw/ipack/tpci200.c
Andreas Färber37146822014-02-09 12:24:15 +0100160check-qtest-pci-y += $(check-qtest-ipack-y)
Andreas Färber83bb0b22014-02-21 16:29:17 +0100161gcov-files-pci-y += $(gcov-files-ipack-y)
Gerd Hoffmann0850fd52014-04-28 11:01:13 +0200162check-qtest-pci-y += tests/display-vga-test$(EXESUF)
163gcov-files-pci-y += hw/display/vga.c
164gcov-files-pci-y += hw/display/cirrus_vga.c
165gcov-files-pci-y += hw/display/vga-pci.c
Gerd Hoffmann501eea42014-04-28 11:10:12 +0200166gcov-files-pci-y += hw/display/virtio-gpu.c
167gcov-files-pci-y += hw/display/virtio-gpu-pci.c
168gcov-files-pci-$(CONFIG_VIRTIO_VGA) += hw/display/virtio-vga.c
Andreas Färberfbaf4452014-03-30 19:22:48 +0200169check-qtest-pci-y += tests/intel-hda-test$(EXESUF)
170gcov-files-pci-y += hw/audio/intel-hda.c hw/audio/hda-codec.c
Markus Armbruster330b5832016-03-15 19:34:20 +0100171check-qtest-pci-$(CONFIG_EVENTFD) += tests/ivshmem-test$(EXESUF)
Andreas Färberbbfc2ef2015-10-11 00:18:32 +0200172gcov-files-pci-y += hw/misc/ivshmem.c
Andreas Färbera21baf72013-11-07 18:25:10 +0100173
Paolo Bonzini8fefa312013-07-22 15:54:34 +0200174check-qtest-i386-y = tests/endianness-test$(EXESUF)
175check-qtest-i386-y += tests/fdc-test$(EXESUF)
Andreas Färber5ec889b2014-02-14 15:09:28 +0100176gcov-files-i386-y = hw/block/fdc.c
Kevin Wolfacbe4802013-05-08 11:18:41 +0200177check-qtest-i386-y += tests/ide-test$(EXESUF)
John Snow1cd10312014-08-21 13:44:32 -0400178check-qtest-i386-y += tests/ahci-test$(EXESUF)
Markus Armbruster0e8a8c82012-07-10 11:12:30 +0200179check-qtest-i386-y += tests/hd-geo-test$(EXESUF)
Andreas Färber5ec889b2014-02-14 15:09:28 +0100180gcov-files-i386-y += hw/block/hd-geometry.c
Markus Armbrusteredbd7902013-06-26 15:52:13 +0200181check-qtest-i386-y += tests/boot-order-test$(EXESUF)
Gabriel L. Somlo501f28c2014-05-27 15:03:14 -0400182check-qtest-i386-y += tests/bios-tables-test$(EXESUF)
Victor Kaplansky4e082562016-02-14 18:59:27 +0200183check-qtest-i386-y += tests/pxe-test$(EXESUF)
Stefan Weilfba0c402012-05-15 18:19:45 +0200184check-qtest-i386-y += tests/rtc-test$(EXESUF)
Corey Minyard24f976d2015-12-17 12:50:09 -0600185check-qtest-i386-y += tests/ipmi-kcs-test$(EXESUF)
186check-qtest-i386-y += tests/ipmi-bt-test$(EXESUF)
Anthony Liguori9bda4132013-04-16 09:45:19 -0500187check-qtest-i386-y += tests/i440fx-test$(EXESUF)
Anthony Liguoribf2a38d2013-04-16 09:45:21 -0500188check-qtest-i386-y += tests/fw_cfg-test$(EXESUF)
Markus Armbrustere2f3f222014-10-02 16:51:31 +0200189check-qtest-i386-y += tests/drive_del-test$(EXESUF)
Paolo Bonzinif52b7682014-07-15 14:57:06 +0200190check-qtest-i386-y += tests/wdt_ib700-test$(EXESUF)
Michael S. Tsirkinc4fc82b2015-07-08 10:06:15 +0300191check-qtest-i386-y += tests/tco-test$(EXESUF)
Paolo Bonzinif52b7682014-07-15 14:57:06 +0200192gcov-files-i386-y += hw/watchdog/watchdog.c hw/watchdog/wdt_ib700.c
Andreas Färbera21baf72013-11-07 18:25:10 +0100193check-qtest-i386-y += $(check-qtest-pci-y)
194gcov-files-i386-y += $(gcov-files-pci-y)
Andreas Färber4a053e72013-11-07 18:37:34 +0100195check-qtest-i386-y += tests/vmxnet3-test$(EXESUF)
196gcov-files-i386-y += hw/net/vmxnet3.c
197gcov-files-i386-y += hw/net/vmxnet_rx_pkt.c
198gcov-files-i386-y += hw/net/vmxnet_tx_pkt.c
Andreas Färberabc53732014-02-21 20:38:48 +0100199check-qtest-i386-y += tests/pvpanic-test$(EXESUF)
200gcov-files-i386-y += i386-softmmu/hw/misc/pvpanic.c
Andreas Färbere683eb92014-02-21 22:43:43 +0100201check-qtest-i386-y += tests/i82801b11-test$(EXESUF)
202gcov-files-i386-y += hw/pci-bridge/i82801b11.c
Andreas Färberefbf5df2014-03-30 20:02:00 +0200203check-qtest-i386-y += tests/ioh3420-test$(EXESUF)
204gcov-files-i386-y += hw/pci-bridge/ioh3420.c
Gonglei28edfce2014-06-23 19:53:51 +0800205check-qtest-i386-y += tests/usb-hcd-ohci-test$(EXESUF)
206gcov-files-i386-y += hw/usb/hcd-ohci.c
Gonglei44ced582014-06-23 19:53:52 +0800207check-qtest-i386-y += tests/usb-hcd-uhci-test$(EXESUF)
208gcov-files-i386-y += hw/usb/hcd-uhci.c
Andreas Färbercc900d32014-03-30 20:25:38 +0200209check-qtest-i386-y += tests/usb-hcd-ehci-test$(EXESUF)
210gcov-files-i386-y += hw/usb/hcd-ehci.c
Gerd Hoffmannd81d4102014-05-07 16:39:11 +0200211gcov-files-i386-y += hw/usb/dev-hid.c
212gcov-files-i386-y += hw/usb/dev-storage.c
Gonglei25e89ec2014-06-23 19:53:53 +0800213check-qtest-i386-y += tests/usb-hcd-xhci-test$(EXESUF)
214gcov-files-i386-y += hw/usb/hcd-xhci.c
Andreas Färber7fe55c32015-03-13 17:21:11 +0100215check-qtest-i386-y += tests/pc-cpu-test$(EXESUF)
Gerd Hoffmann66e2ec22015-04-14 15:11:36 +0200216check-qtest-i386-y += tests/q35-test$(EXESUF)
217gcov-files-i386-y += hw/pci-host/q35.c
Marc-André Lureau421f4442015-10-26 15:32:00 +0100218check-qtest-i386-$(CONFIG_VHOST_NET_TEST_i386) += tests/vhost-user-test$(EXESUF)
219ifeq ($(CONFIG_VHOST_NET_TEST_i386),)
220check-qtest-x86_64-$(CONFIG_VHOST_NET_TEST_x86_64) += tests/vhost-user-test$(EXESUF)
Michael S. Tsirkin7fe34ca2015-10-06 10:17:55 +0100221endif
Yang Hongyang89b12732015-10-07 11:52:22 +0800222check-qtest-i386-y += tests/test-netfilter$(EXESUF)
Zhang Chen06809ec2016-03-15 15:41:34 +0800223check-qtest-i386-y += tests/test-filter-mirror$(EXESUF)
Zhang Chen9fd3c5d2016-03-17 16:16:27 +0800224check-qtest-i386-y += tests/test-filter-redirector$(EXESUF)
Anthony Liguorid1aaf542012-03-28 15:42:07 +0200225check-qtest-x86_64-y = $(check-qtest-i386-y)
Andreas Färber5ec889b2014-02-14 15:09:28 +0100226gcov-files-i386-y += i386-softmmu/hw/timer/mc146818rtc.c
Andreas Färberc5cd02b2013-01-26 12:45:14 +0100227gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
Paolo Bonzini8fefa312013-07-22 15:54:34 +0200228check-qtest-mips-y = tests/endianness-test$(EXESUF)
229check-qtest-mips64-y = tests/endianness-test$(EXESUF)
230check-qtest-mips64el-y = tests/endianness-test$(EXESUF)
231check-qtest-ppc-y = tests/endianness-test$(EXESUF)
232check-qtest-ppc64-y = tests/endianness-test$(EXESUF)
233check-qtest-sh4-y = tests/endianness-test$(EXESUF)
234check-qtest-sh4eb-y = tests/endianness-test$(EXESUF)
235check-qtest-sparc64-y = tests/endianness-test$(EXESUF)
Anthony Liguoribaeddde2013-01-29 15:42:45 -0600236#check-qtest-sparc-y = tests/m48t59-test$(EXESUF)
Paolo Bonzini8fefa312013-07-22 15:54:34 +0200237#check-qtest-sparc64-y += tests/m48t59-test$(EXESUF)
Andreas Färber5ec889b2014-02-14 15:09:28 +0100238gcov-files-sparc-y += hw/timer/m48t59.c
239gcov-files-sparc64-y += hw/timer/m48t59.c
Andreas Färber6e998902013-01-16 01:57:57 +0100240check-qtest-arm-y = tests/tmp105-test$(EXESUF)
Jean-Christophe Dubois7f398622015-09-07 10:39:31 +0100241check-qtest-arm-y = tests/ds1338-test$(EXESUF)
Andreas Färber5ec889b2014-02-14 15:09:28 +0100242gcov-files-arm-y += hw/misc/tmp105.c
Marc Marí0a6ed702015-02-24 22:21:55 +0100243check-qtest-arm-y += tests/virtio-blk-test$(EXESUF)
244gcov-files-arm-y += arm-softmmu/hw/block/virtio-blk.c
Andreas Färber530a7e42013-06-26 15:52:16 +0200245check-qtest-ppc-y += tests/boot-order-test$(EXESUF)
246check-qtest-ppc64-y += tests/boot-order-test$(EXESUF)
Alexey Kardashevskiy04e9a202014-02-10 14:52:56 +1100247check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF)
248gcov-files-ppc64-y += ppc64-softmmu/hw/ppc/spapr_pci.c
Andreas Färber7c41f212013-07-29 05:44:47 +0200249check-qtest-microblazeel-y = $(check-qtest-microblaze-y)
Andreas Färber7c41f212013-07-29 05:44:47 +0200250check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
Anthony Liguorid1aaf542012-03-28 15:42:07 +0200251
Markus Armbrustere253c282015-10-01 10:59:53 +0200252check-qtest-generic-y += tests/qom-test$(EXESUF)
Peter Maydell3687d532014-01-23 16:22:59 +0000253
Eric Blake46534302016-02-17 23:48:17 -0700254qapi-schema += alternate-any.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600255qapi-schema += alternate-array.json
256qapi-schema += alternate-base.json
257qapi-schema += alternate-clash.json
258qapi-schema += alternate-conflict-dict.json
259qapi-schema += alternate-conflict-string.json
Eric Blake8d25dd12015-09-29 16:21:05 -0600260qapi-schema += alternate-empty.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600261qapi-schema += alternate-nested.json
262qapi-schema += alternate-unknown.json
263qapi-schema += args-alternate.json
264qapi-schema += args-any.json
265qapi-schema += args-array-empty.json
266qapi-schema += args-array-unknown.json
267qapi-schema += args-int.json
268qapi-schema += args-invalid.json
269qapi-schema += args-member-array-bad.json
Eric Blake893e1f22015-12-01 22:20:57 -0700270qapi-schema += args-member-case.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600271qapi-schema += args-member-unknown.json
Eric Blaked220fbc2015-09-29 16:21:03 -0600272qapi-schema += args-name-clash.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600273qapi-schema += args-union.json
274qapi-schema += args-unknown.json
275qapi-schema += bad-base.json
276qapi-schema += bad-data.json
277qapi-schema += bad-ident.json
278qapi-schema += bad-type-bool.json
279qapi-schema += bad-type-dict.json
280qapi-schema += bad-type-int.json
Eric Blakebac54292015-12-01 22:20:59 -0700281qapi-schema += base-cycle-direct.json
282qapi-schema += base-cycle-indirect.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600283qapi-schema += command-int.json
284qapi-schema += comments.json
285qapi-schema += double-data.json
286qapi-schema += double-type.json
287qapi-schema += duplicate-key.json
288qapi-schema += empty.json
289qapi-schema += enum-bad-name.json
290qapi-schema += enum-bad-prefix.json
291qapi-schema += enum-clash-member.json
292qapi-schema += enum-dict-member.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600293qapi-schema += enum-int-member.json
Eric Blake893e1f22015-12-01 22:20:57 -0700294qapi-schema += enum-member-case.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600295qapi-schema += enum-missing-data.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600296qapi-schema += enum-wrong-data.json
297qapi-schema += escape-outside-string.json
298qapi-schema += escape-too-big.json
299qapi-schema += escape-too-short.json
300qapi-schema += event-case.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600301qapi-schema += event-nest-struct.json
302qapi-schema += flat-union-array-branch.json
303qapi-schema += flat-union-bad-base.json
304qapi-schema += flat-union-bad-discriminator.json
305qapi-schema += flat-union-base-any.json
306qapi-schema += flat-union-base-union.json
Eric Blaked220fbc2015-09-29 16:21:03 -0600307qapi-schema += flat-union-clash-member.json
Eric Blake8d25dd12015-09-29 16:21:05 -0600308qapi-schema += flat-union-empty.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600309qapi-schema += flat-union-inline.json
310qapi-schema += flat-union-int-branch.json
311qapi-schema += flat-union-invalid-branch-key.json
312qapi-schema += flat-union-invalid-discriminator.json
313qapi-schema += flat-union-no-base.json
314qapi-schema += flat-union-optional-discriminator.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600315qapi-schema += flat-union-string-discriminator.json
316qapi-schema += funny-char.json
317qapi-schema += ident-with-escape.json
318qapi-schema += include-before-err.json
319qapi-schema += include-cycle.json
320qapi-schema += include-format-err.json
321qapi-schema += include-nested-err.json
322qapi-schema += include-no-file.json
323qapi-schema += include-non-file.json
324qapi-schema += include-relpath.json
325qapi-schema += include-repetition.json
326qapi-schema += include-self-cycle.json
327qapi-schema += include-simple.json
328qapi-schema += indented-expr.json
329qapi-schema += leading-comma-list.json
330qapi-schema += leading-comma-object.json
331qapi-schema += missing-colon.json
332qapi-schema += missing-comma-list.json
333qapi-schema += missing-comma-object.json
334qapi-schema += missing-type.json
335qapi-schema += nested-struct-data.json
336qapi-schema += non-objects.json
337qapi-schema += qapi-schema-test.json
338qapi-schema += quoted-structural-chars.json
339qapi-schema += redefined-builtin.json
340qapi-schema += redefined-command.json
341qapi-schema += redefined-event.json
342qapi-schema += redefined-type.json
Eric Blake19767082015-10-26 16:34:40 -0600343qapi-schema += reserved-command-q.json
Eric Blake59a92fe2015-11-18 01:52:56 -0700344qapi-schema += reserved-enum-q.json
Eric Blake19767082015-10-26 16:34:40 -0600345qapi-schema += reserved-member-has.json
346qapi-schema += reserved-member-q.json
Eric Blake5e59baf2015-10-26 16:35:02 -0600347qapi-schema += reserved-member-u.json
Eric Blake59a92fe2015-11-18 01:52:56 -0700348qapi-schema += reserved-member-underscore.json
Eric Blake19767082015-10-26 16:34:40 -0600349qapi-schema += reserved-type-kind.json
350qapi-schema += reserved-type-list.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600351qapi-schema += returns-alternate.json
352qapi-schema += returns-array-bad.json
353qapi-schema += returns-dict.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600354qapi-schema += returns-unknown.json
355qapi-schema += returns-whitelist.json
356qapi-schema += struct-base-clash-deep.json
357qapi-schema += struct-base-clash.json
358qapi-schema += struct-data-invalid.json
359qapi-schema += struct-member-invalid.json
360qapi-schema += trailing-comma-list.json
361qapi-schema += trailing-comma-object.json
362qapi-schema += type-bypass-bad-gen.json
363qapi-schema += unclosed-list.json
364qapi-schema += unclosed-object.json
365qapi-schema += unclosed-string.json
366qapi-schema += unicode-str.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600367qapi-schema += union-base-no-discriminator.json
Eric Blake893e1f22015-12-01 22:20:57 -0700368qapi-schema += union-branch-case.json
Eric Blaked220fbc2015-09-29 16:21:03 -0600369qapi-schema += union-clash-branches.json
Eric Blake8d25dd12015-09-29 16:21:05 -0600370qapi-schema += union-empty.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600371qapi-schema += union-invalid-base.json
Eric Blake1ffe8182015-09-29 16:20:59 -0600372qapi-schema += union-optional-branch.json
373qapi-schema += union-unknown.json
374qapi-schema += unknown-escape.json
375qapi-schema += unknown-expr-key.json
376check-qapi-schema-y := $(addprefix tests/qapi-schema/, $(qapi-schema))
Markus Armbruster98626572013-07-27 17:41:53 +0200377
Wenchao Xiaf6dadb02014-06-18 08:43:29 +0200378GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h \
Markus Armbruster39a18152015-09-16 13:06:28 +0200379 tests/test-qmp-commands.h tests/test-qapi-event.h \
380 tests/test-qmp-introspect.h
Anthony Liguoridbfe06c2012-01-10 13:10:43 -0600381
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200382test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \
383 tests/check-qlist.o tests/check-qfloat.o tests/check-qjson.o \
384 tests/test-coroutine.o tests/test-string-output-visitor.o \
385 tests/test-string-input-visitor.o tests/test-qmp-output-visitor.o \
386 tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \
Eduardo Habkost247c9de2013-01-23 15:58:27 -0200387 tests/test-qmp-commands.o tests/test-visitor-serialization.o \
Laszlo Ersek3953e3a2013-08-20 00:35:40 +0200388 tests/test-x86-cpuid.o tests/test-mul64.o tests/test-int128.o \
Paolo Bonzini8fda74a2013-06-21 09:09:34 +0200389 tests/test-opts-visitor.o tests/test-qmp-event.o \
Mike Day341774f2013-08-27 11:38:45 -0400390 tests/rcutorture.o tests/test-rcu-list.o
Anthony Liguoridbfe06c2012-01-10 13:10:43 -0600391
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200392$(test-obj-y): QEMU_INCLUDES += -Itests
Anthony Liguoric4efe1c2013-04-16 09:45:16 -0500393QEMU_CFLAGS += -I$(SRC_PATH)/tests
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200394
Daniel P. Berrangeb1245332015-09-02 11:35:52 +0100395
396# Deps that are common to various different sets of tests below
397test-util-obj-y = libqemuutil.a libqemustub.a
Daniel P. Berrange0c7012e2015-09-02 11:18:16 +0100398test-qom-obj-y = $(qom-obj-y) $(test-util-obj-y)
Daniel P. Berrangeb1245332015-09-02 11:35:52 +0100399test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o \
Markus Armbruster39a18152015-09-16 13:06:28 +0200400 tests/test-qapi-event.o tests/test-qmp-introspect.o \
Daniel P. Berrangeb1245332015-09-02 11:35:52 +0100401 $(test-qom-obj-y)
Daniel P. Berrangea0901872015-03-13 17:39:26 +0000402test-crypto-obj-y = $(crypto-obj-y) $(test-qom-obj-y)
Daniel P. Berrangeb02db2d2015-03-18 17:25:45 +0000403test-io-obj-y = $(io-obj-y) $(test-crypto-obj-y)
Daniel P. Berrange064097d2016-02-10 18:41:01 +0000404test-block-obj-y = $(block-obj-y) $(test-io-obj-y)
Daniel P. Berrangeb1245332015-09-02 11:35:52 +0100405
406tests/check-qint$(EXESUF): tests/check-qint.o $(test-util-obj-y)
407tests/check-qstring$(EXESUF): tests/check-qstring.o $(test-util-obj-y)
408tests/check-qdict$(EXESUF): tests/check-qdict.o $(test-util-obj-y)
409tests/check-qlist$(EXESUF): tests/check-qlist.o $(test-util-obj-y)
410tests/check-qfloat$(EXESUF): tests/check-qfloat.o $(test-util-obj-y)
411tests/check-qjson$(EXESUF): tests/check-qjson.o $(test-util-obj-y)
412tests/check-qom-interface$(EXESUF): tests/check-qom-interface.o $(test-qom-obj-y)
413tests/check-qom-proplist$(EXESUF): tests/check-qom-proplist.o $(test-qom-obj-y)
414tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(test-block-obj-y)
415tests/test-aio$(EXESUF): tests/test-aio.o $(test-block-obj-y)
416tests/test-rfifolock$(EXESUF): tests/test-rfifolock.o $(test-util-obj-y)
417tests/test-throttle$(EXESUF): tests/test-throttle.o $(test-block-obj-y)
Stefan Hajnoczi6c6f3122015-11-05 18:13:20 -0500418tests/test-blockjob-txn$(EXESUF): tests/test-blockjob-txn.o $(test-block-obj-y) $(test-util-obj-y)
Daniel P. Berrangeb1245332015-09-02 11:35:52 +0100419tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(test-block-obj-y)
420tests/test-iov$(EXESUF): tests/test-iov.o $(test-util-obj-y)
421tests/test-hbitmap$(EXESUF): tests/test-hbitmap.o $(test-util-obj-y)
Eduardo Habkost247c9de2013-01-23 15:58:27 -0200422tests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o
Daniel P. Berrangeb1245332015-09-02 11:35:52 +0100423tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o page_cache.o $(test-util-obj-y)
Eduardo Habkoste3f9fe22013-02-04 16:27:45 -0200424tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o
Paolo Bonzini6046c622013-06-20 16:19:32 +0200425tests/test-int128$(EXESUF): tests/test-int128.o
Daniel P. Berrangeb1245332015-09-02 11:35:52 +0100426tests/rcutorture$(EXESUF): tests/rcutorture.o $(test-util-obj-y)
427tests/test-rcu-list$(EXESUF): tests/test-rcu-list.o $(test-util-obj-y)
Paolo Bonzini8fda74a2013-06-21 09:09:34 +0200428
Eduardo Habkost747b0cb2013-07-10 17:08:40 -0300429tests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o \
Igor Mammedov5e954942014-02-05 16:36:52 +0100430 hw/core/qdev.o hw/core/qdev-properties.o hw/core/hotplug.o\
Eduardo Habkost747b0cb2013-07-10 17:08:40 -0300431 hw/core/irq.o \
Paolo Bonzini6b1566c2014-03-17 13:40:23 +1100432 hw/core/fw-path-provider.o \
Daniel P. Berrangeb1245332015-09-02 11:35:52 +0100433 $(test-qapi-obj-y)
Eduardo Habkost2668b4b2013-11-28 12:01:18 -0200434tests/test-vmstate$(EXESUF): tests/test-vmstate.o \
Dr. David Alan Gilbert977184d2014-12-12 11:13:41 +0000435 migration/vmstate.o migration/qemu-file.o migration/qemu-file-buf.o \
Alexander Graf8118f092015-01-22 15:01:39 +0100436 migration/qemu-file-unix.o qjson.o \
Daniel P. Berrangeb1245332015-09-02 11:35:52 +0100437 $(test-qom-obj-y)
Alberto Garciabd797fc2015-10-28 17:33:01 +0200438tests/test-timed-average$(EXESUF): tests/test-timed-average.o qemu-timer.o \
Kevin Wolf5e41fbf2015-11-23 13:28:12 +0100439 $(test-util-obj-y)
Daniel P. Berrange89bc0b62015-11-23 15:24:50 +0000440tests/test-base64$(EXESUF): tests/test-base64.o \
441 libqemuutil.a libqemustub.a
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200442
Alex Bennée35145522016-03-15 14:30:20 +0000443tests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y)
444
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200445tests/test-qapi-types.c tests/test-qapi-types.h :\
Markus Armbrusterdf3e21a2015-04-02 13:38:48 +0200446$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
Lluís Vilanova0a607742014-05-02 15:52:24 +0200447 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
Markus Armbruster16d80f62015-04-02 13:32:16 +0200448 $(gen-out-type) -o tests -p "test-" $<, \
Lluís Vilanova0a607742014-05-02 15:52:24 +0200449 " GEN $@")
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200450tests/test-qapi-visit.c tests/test-qapi-visit.h :\
Markus Armbrusterdf3e21a2015-04-02 13:38:48 +0200451$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
Lluís Vilanova0a607742014-05-02 15:52:24 +0200452 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
Markus Armbruster16d80f62015-04-02 13:32:16 +0200453 $(gen-out-type) -o tests -p "test-" $<, \
Lluís Vilanova0a607742014-05-02 15:52:24 +0200454 " GEN $@")
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200455tests/test-qmp-commands.h tests/test-qmp-marshal.c :\
Markus Armbrusterdf3e21a2015-04-02 13:38:48 +0200456$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
Lluís Vilanova0a607742014-05-02 15:52:24 +0200457 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
Markus Armbruster16d80f62015-04-02 13:32:16 +0200458 $(gen-out-type) -o tests -p "test-" $<, \
Lluís Vilanova0a607742014-05-02 15:52:24 +0200459 " GEN $@")
Wenchao Xiaf6dadb02014-06-18 08:43:29 +0200460tests/test-qapi-event.c tests/test-qapi-event.h :\
Markus Armbrusterdf3e21a2015-04-02 13:38:48 +0200461$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
Wenchao Xiaf6dadb02014-06-18 08:43:29 +0200462 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
Markus Armbruster16d80f62015-04-02 13:32:16 +0200463 $(gen-out-type) -o tests -p "test-" $<, \
Wenchao Xiaf6dadb02014-06-18 08:43:29 +0200464 " GEN $@")
Markus Armbruster39a18152015-09-16 13:06:28 +0200465tests/test-qmp-introspect.c tests/test-qmp-introspect.h :\
466$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
467 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \
468 $(gen-out-type) -o tests -p "test-" $<, \
469 " GEN $@")
Anthony Liguoridbfe06c2012-01-10 13:10:43 -0600470
Daniel P. Berrangeb1245332015-09-02 11:35:52 +0100471tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y)
472tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y)
473tests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y)
474tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y)
475tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y)
476tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y)
477tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y)
478tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y)
479tests/test-opts-visitor$(EXESUF): tests/test-opts-visitor.o $(test-qapi-obj-y)
Paolo Bonzini2d7799f2012-02-09 11:21:03 +0100480
Daniel P. Berrangeb1245332015-09-02 11:35:52 +0100481tests/test-mul64$(EXESUF): tests/test-mul64.o $(test-util-obj-y)
482tests/test-bitops$(EXESUF): tests/test-bitops.o $(test-util-obj-y)
Daniel P. Berrangefb377262015-09-02 10:57:27 +0100483tests/test-crypto-hash$(EXESUF): tests/test-crypto-hash.o $(test-crypto-obj-y)
484tests/test-crypto-cipher$(EXESUF): tests/test-crypto-cipher.o $(test-crypto-obj-y)
Daniel P. Berrangeac1d8872015-10-14 09:58:38 +0100485tests/test-crypto-secret$(EXESUF): tests/test-crypto-secret.o $(test-crypto-obj-y)
Daniel P. Berrange84f7f182016-02-11 14:00:17 +0000486tests/test-crypto-xts$(EXESUF): tests/test-crypto-xts.o $(test-crypto-obj-y)
Daniel P. Berrange90246032015-09-21 17:25:34 +0100487
488tests/crypto-tls-x509-helpers.o-cflags := $(TASN1_CFLAGS)
489tests/crypto-tls-x509-helpers.o-libs := $(TASN1_LIBS)
490tests/pkix_asn1_tab.o-cflags := $(TASN1_CFLAGS)
491
492tests/test-crypto-tlscredsx509.o-cflags := $(TASN1_CFLAGS)
Daniel P. Berrange9a2fd432015-04-13 14:01:39 +0100493tests/test-crypto-tlscredsx509$(EXESUF): tests/test-crypto-tlscredsx509.o \
494 tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y)
Daniel P. Berrange90246032015-09-21 17:25:34 +0100495
496tests/test-crypto-tlssession.o-cflags := $(TASN1_CFLAGS)
Daniel P. Berranged321e1e2015-03-02 17:23:31 +0000497tests/test-crypto-tlssession$(EXESUF): tests/test-crypto-tlssession.o \
498 tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y)
Daniel P. Berrangeb02db2d2015-03-18 17:25:45 +0000499tests/test-io-task$(EXESUF): tests/test-io-task.o $(test-io-obj-y)
Daniel P. Berrange559607e2015-02-27 16:19:33 +0000500tests/test-io-channel-socket$(EXESUF): tests/test-io-channel-socket.o \
501 tests/io-channel-helpers.o $(test-io-obj-y)
Daniel P. Berranged6e48862015-02-27 18:25:25 +0000502tests/test-io-channel-file$(EXESUF): tests/test-io-channel-file.o \
503 tests/io-channel-helpers.o $(test-io-obj-y)
Daniel P. Berrangeed8ee422015-03-02 18:13:13 +0000504tests/test-io-channel-tls$(EXESUF): tests/test-io-channel-tls.o \
505 tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o \
506 tests/io-channel-helpers.o $(test-io-obj-y)
Daniel P. Berrange195e14d2015-08-27 16:25:30 +0100507tests/test-io-channel-command$(EXESUF): tests/test-io-channel-command.o \
508 tests/io-channel-helpers.o $(test-io-obj-y)
Daniel P. Berranged98e4eb2015-09-15 17:27:33 +0100509tests/test-io-channel-buffer$(EXESUF): tests/test-io-channel-buffer.o \
510 tests/io-channel-helpers.o $(test-io-obj-y)
Daniel P. Berrange37788f22015-10-14 13:14:04 +0100511tests/test-crypto-pbkdf$(EXESUF): tests/test-crypto-pbkdf.o $(test-crypto-obj-y)
Daniel P. Berrangecb730892015-10-15 12:35:28 +0100512tests/test-crypto-ivgen$(EXESUF): tests/test-crypto-ivgen.o $(test-crypto-obj-y)
Daniel P. Berrange5a95e0f2015-10-23 16:14:25 +0100513tests/test-crypto-afsplit$(EXESUF): tests/test-crypto-afsplit.o $(test-crypto-obj-y)
Daniel P. Berrange7d969012015-10-24 11:44:13 +0100514tests/test-crypto-block$(EXESUF): tests/test-crypto-block.o $(test-crypto-obj-y)
Richard Hendersonf4c0f982013-02-16 12:47:01 -0800515
Marc Marí292be092014-10-23 10:12:42 +0200516libqos-obj-y = tests/libqos/pci.o tests/libqos/fw_cfg.o tests/libqos/malloc.o
John Snow90e5add2015-01-19 15:15:55 -0500517libqos-obj-y += tests/libqos/i2c.o tests/libqos/libqos.o
Markus Armbruster26491a32013-06-26 15:52:22 +0200518libqos-pc-obj-y = $(libqos-obj-y) tests/libqos/pci-pc.o
John Snow90e5add2015-01-19 15:15:55 -0500519libqos-pc-obj-y += tests/libqos/malloc-pc.o tests/libqos/libqos-pc.o
John Snow9a75b0a2015-01-19 15:16:03 -0500520libqos-pc-obj-y += tests/libqos/ahci.o
Andreas Färbercc9936a2013-05-02 15:56:26 +0200521libqos-omap-obj-y = $(libqos-obj-y) tests/libqos/i2c-omap.o
Jean-Christophe Dubois7f398622015-09-07 10:39:31 +0100522libqos-imx-obj-y = $(libqos-obj-y) tests/libqos/i2c-imx.o
Igor Mammedovb0354ec2014-09-26 09:28:12 +0000523libqos-usb-obj-y = $(libqos-pc-obj-y) tests/libqos/usb.o
Marc Marí0a6ed702015-02-24 22:21:55 +0100524libqos-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 -0500525
Markus Armbruster2d1abb82015-10-01 10:59:56 +0200526tests/device-introspect-test$(EXESUF): tests/device-introspect-test.o
Paolo Bonziniff667e22012-12-21 09:45:20 +0100527tests/rtc-test$(EXESUF): tests/rtc-test.o
528tests/m48t59-test$(EXESUF): tests/m48t59-test.o
Paolo Bonzini8fefa312013-07-22 15:54:34 +0200529tests/endianness-test$(EXESUF): tests/endianness-test.o
Alexey Kardashevskiy04e9a202014-02-10 14:52:56 +1100530tests/spapr-phb-test$(EXESUF): tests/spapr-phb-test.o $(libqos-obj-y)
Paolo Bonziniff667e22012-12-21 09:45:20 +0100531tests/fdc-test$(EXESUF): tests/fdc-test.o
Kevin Wolfacbe4802013-05-08 11:18:41 +0200532tests/ide-test$(EXESUF): tests/ide-test.o $(libqos-pc-obj-y)
John Snow90e5add2015-01-19 15:15:55 -0500533tests/ahci-test$(EXESUF): tests/ahci-test.o $(libqos-pc-obj-y)
Corey Minyard24f976d2015-12-17 12:50:09 -0600534tests/ipmi-kcs-test$(EXESUF): tests/ipmi-kcs-test.o
535tests/ipmi-bt-test$(EXESUF): tests/ipmi-bt-test.o
Paolo Bonziniff667e22012-12-21 09:45:20 +0100536tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o
Andreas Färber530a7e42013-06-26 15:52:16 +0200537tests/boot-order-test$(EXESUF): tests/boot-order-test.o $(libqos-obj-y)
Victor Kaplansky4e082562016-02-14 18:59:27 +0200538tests/bios-tables-test$(EXESUF): tests/bios-tables-test.o \
539 tests/boot-sector.o $(libqos-obj-y)
540tests/pxe-test$(EXESUF): tests/pxe-test.o tests/boot-sector.o $(libqos-obj-y)
Andreas Färbercc9936a2013-05-02 15:56:26 +0200541tests/tmp105-test$(EXESUF): tests/tmp105-test.o $(libqos-omap-obj-y)
Jean-Christophe Dubois7f398622015-09-07 10:39:31 +0100542tests/ds1338-test$(EXESUF): tests/ds1338-test.o $(libqos-imx-obj-y)
Anthony Liguori9bda4132013-04-16 09:45:19 -0500543tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y)
Gerd Hoffmann66e2ec22015-04-14 15:11:36 +0200544tests/q35-test$(EXESUF): tests/q35-test.o $(libqos-pc-obj-y)
Anthony Liguoribf2a38d2013-04-16 09:45:21 -0500545tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y)
Andreas Färbera21baf72013-11-07 18:25:10 +0100546tests/e1000-test$(EXESUF): tests/e1000-test.o
Frediano Ziglio069bb582015-01-08 18:38:23 +0000547tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o $(libqos-pc-obj-y)
Andreas Färber85f68d52013-11-07 18:53:28 +0100548tests/pcnet-test$(EXESUF): tests/pcnet-test.o
Andreas Färber92838a12013-11-07 19:18:46 +0100549tests/eepro100-test$(EXESUF): tests/eepro100-test.o
Andreas Färber4a053e72013-11-07 18:37:34 +0100550tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o
Andreas Färber5297ea62014-02-09 04:01:37 +0100551tests/ne2000-test$(EXESUF): tests/ne2000-test.o
Paolo Bonzinif52b7682014-07-15 14:57:06 +0200552tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o
Paulo Alcantara45dcdb92015-06-28 14:58:57 -0300553tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y)
Andreas Färber02063aa2014-02-09 04:39:47 +0100554tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o
Marc Marí311e6662014-09-01 12:07:54 +0200555tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o $(libqos-virtio-obj-y)
Jason Wang2af40252015-07-17 15:25:53 +0800556tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o $(libqos-pc-obj-y) $(libqos-virtio-obj-y)
Igor Mammedovd1f3fc22014-09-26 09:28:09 +0000557tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o $(libqos-pc-obj-y)
Fam Zhengebe7d8b2015-04-24 19:35:16 +0800558tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o $(libqos-virtio-obj-y)
Andreas Färber2d888c02014-02-21 17:15:21 +0100559tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o
Andreas Färberaa974052014-02-21 17:36:57 +0100560tests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o
Andreas Färber6e8114a2014-02-21 17:49:12 +0100561tests/virtio-console-test$(EXESUF): tests/virtio-console-test.o
Andreas Färber76491072014-02-09 03:48:44 +0100562tests/tpci200-test$(EXESUF): tests/tpci200-test.o
Gerd Hoffmann0850fd52014-04-28 11:01:13 +0200563tests/display-vga-test$(EXESUF): tests/display-vga-test.o
Andreas Färber37146822014-02-09 12:24:15 +0100564tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
Andreas Färber7c41f212013-07-29 05:44:47 +0200565tests/qom-test$(EXESUF): tests/qom-test.o
Markus Armbrustere2f3f222014-10-02 16:51:31 +0200566tests/drive_del-test$(EXESUF): tests/drive_del-test.o $(libqos-pc-obj-y)
Stefan Hajnoczi43cd2092013-10-30 14:54:35 +0100567tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y)
Andreas Färberfc967792014-02-21 22:19:43 +0100568tests/nvme-test$(EXESUF): tests/nvme-test.o
Andreas Färberabc53732014-02-21 20:38:48 +0100569tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o
Andreas Färbere683eb92014-02-21 22:43:43 +0100570tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o
Andreas Färberd7b50c02014-03-30 19:00:05 +0200571tests/ac97-test$(EXESUF): tests/ac97-test.o
Andreas Färber8fa74c92014-03-30 19:05:20 +0200572tests/es1370-test$(EXESUF): tests/es1370-test.o
Andreas Färberfbaf4452014-03-30 19:22:48 +0200573tests/intel-hda-test$(EXESUF): tests/intel-hda-test.o
Andreas Färberefbf5df2014-03-30 20:02:00 +0200574tests/ioh3420-test$(EXESUF): tests/ioh3420-test.o
Igor Mammedovb3937682014-09-26 09:28:14 +0000575tests/usb-hcd-ohci-test$(EXESUF): tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y)
Igor Mammedovfbd942c2014-09-26 09:28:13 +0000576tests/usb-hcd-uhci-test$(EXESUF): tests/usb-hcd-uhci-test.o $(libqos-usb-obj-y)
Igor Mammedovb0354ec2014-09-26 09:28:12 +0000577tests/usb-hcd-ehci-test$(EXESUF): tests/usb-hcd-ehci-test.o $(libqos-usb-obj-y)
Igor Mammedovb3937682014-09-26 09:28:14 +0000578tests/usb-hcd-xhci-test$(EXESUF): tests/usb-hcd-xhci-test.o $(libqos-usb-obj-y)
Andreas Färber7fe55c32015-03-13 17:21:11 +0100579tests/pc-cpu-test$(EXESUF): tests/pc-cpu-test.o
Daniel P. Berrange9894dc02016-01-19 11:14:29 +0000580tests/vhost-user-test$(EXESUF): tests/vhost-user-test.o qemu-char.o qemu-timer.o $(qtest-obj-y) $(test-io-obj-y)
Wenchao Xiaf93296e2013-09-06 11:24:32 +0800581tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o
Daniel P. Berrangeb1245332015-09-02 11:35:52 +0100582tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o $(test-util-obj-y)
583tests/test-write-threshold$(EXESUF): tests/test-write-threshold.o $(test-block-obj-y)
Yang Hongyang89b12732015-10-07 11:52:22 +0800584tests/test-netfilter$(EXESUF): tests/test-netfilter.o $(qtest-obj-y)
Zhang Chen06809ec2016-03-15 15:41:34 +0800585tests/test-filter-mirror$(EXESUF): tests/test-filter-mirror.o $(qtest-obj-y)
Zhang Chen9fd3c5d2016-03-17 16:16:27 +0800586tests/test-filter-redirector$(EXESUF): tests/test-filter-redirector.o $(qtest-obj-y)
Marc-André Lureauddef6a02014-04-02 16:57:48 +0200587tests/ivshmem-test$(EXESUF): tests/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y)
Victor Kaplansky3595e2e2015-10-28 14:53:07 +0200588tests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o
Blue Swirld2a16f72012-03-30 17:39:33 +0000589
Nikolay Nikolaeve06cbc32014-06-19 20:35:42 +0300590ifeq ($(CONFIG_POSIX),y)
591LIBS += -lutil
592endif
Nikolay Nikolaeva77e6b12014-06-10 13:03:23 +0300593
Anthony Liguori49ee3592012-03-28 15:42:05 +0200594# QTest rules
595
596TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
Stefan Hajnoczi5c4e24c2014-03-28 10:55:54 +0100597ifeq ($(CONFIG_POSIX),y)
Markus Armbrustere253c282015-10-01 10:59:53 +0200598QTEST_TARGETS = $(TARGETS)
Stefan Hajnoczi5c4e24c2014-03-28 10:55:54 +0100599check-qtest-y=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))
Markus Armbrustere253c282015-10-01 10:59:53 +0200600check-qtest-y += $(check-qtest-generic-y)
601else
602QTEST_TARGETS =
Stefan Hajnoczi5c4e24c2014-03-28 10:55:54 +0100603endif
Anthony Liguori49ee3592012-03-28 15:42:05 +0200604
Daniel P. Berrangeb1245332015-09-02 11:35:52 +0100605qtest-obj-y = tests/libqtest.o $(test-util-obj-y)
Anthony Liguori49ee3592012-03-28 15:42:05 +0200606$(check-qtest-y): $(qtest-obj-y)
607
Marc-André Lureau62c39b32015-10-02 14:58:18 +0200608tests/test-qga: tests/test-qga.o $(qtest-obj-y)
609
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200610.PHONY: check-help
611check-help:
612 @echo "Regression testing targets:"
613 @echo
614 @echo " make check Run all tests"
Anthony Liguori49ee3592012-03-28 15:42:05 +0200615 @echo " make check-qtest-TARGET Run qtest tests for given target"
616 @echo " make check-qtest Run qtest tests"
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200617 @echo " make check-unit Run qobject tests"
Markus Armbruster98626572013-07-27 17:41:53 +0200618 @echo " make check-qapi-schema Run QAPI schema tests"
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200619 @echo " make check-block Run block tests"
620 @echo " make check-report.html Generates an HTML test report"
Wenchao Xia2cdfb122013-09-26 08:42:56 +0800621 @echo " make check-clean Clean the tests"
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200622 @echo
623 @echo "Please note that HTML reports do not regenerate if the unit tests"
624 @echo "has not changed."
625 @echo
626 @echo "The variable SPEED can be set to control the gtester speed setting."
627 @echo "Default options are -k and (for make V=1) --verbose; they can be"
628 @echo "changed with variable GTESTER_OPTIONS."
Paolo Bonzini2d7799f2012-02-09 11:21:03 +0100629
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200630SPEED = quick
631GTESTER_OPTIONS = -k $(if $(V),--verbose,-q)
Blue Swirl1d728c32012-05-01 18:45:39 +0000632GCOV_OPTIONS = -n $(if $(V),-f,)
Anthony Liguoridbfe06c2012-01-10 13:10:43 -0600633
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200634# gtester tests, possibly with verbose output
Anthony Liguoridbfe06c2012-01-10 13:10:43 -0600635
Anthony Liguori49ee3592012-03-28 15:42:05 +0200636.PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS))
637$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: $(check-qtest-y)
Blue Swirl1d728c32012-05-01 18:45:39 +0000638 $(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,)
Anthony Liguori49ee3592012-03-28 15:42:05 +0200639 $(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
John Snow122fdf22015-04-28 15:27:51 -0400640 QTEST_QEMU_IMG=qemu-img$(EXESUF) \
Stefan Hajnoczi04129602013-05-27 15:28:51 +0200641 MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$((RANDOM % 255 + 1))} \
Markus Armbrustere253c282015-10-01 10:59:53 +0200642 gtester $(GTESTER_OPTIONS) -m=$(SPEED) $(check-qtest-$*-y) $(check-qtest-generic-y),"GTESTER $@")
Markus Armbruster2d1abb82015-10-01 10:59:56 +0200643 $(if $(CONFIG_GCOV),@for f in $(gcov-files-$*-y) $(gcov-files-generic-y); do \
Blue Swirl1d728c32012-05-01 18:45:39 +0000644 echo Gcov report for $$f:;\
645 $(GCOV) $(GCOV_OPTIONS) $$f -o `dirname $$f`; \
646 done,)
Anthony Liguori49ee3592012-03-28 15:42:05 +0200647
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200648.PHONY: $(patsubst %, check-%, $(check-unit-y))
649$(patsubst %, check-%, $(check-unit-y)): check-%: %
Blue Swirl1d728c32012-05-01 18:45:39 +0000650 $(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,)
Stefan Hajnoczi04129602013-05-27 15:28:51 +0200651 $(call quiet-command, \
652 MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$((RANDOM % 255 + 1))} \
653 gtester $(GTESTER_OPTIONS) -m=$(SPEED) $*,"GTESTER $*")
Markus Armbruster2d1abb82015-10-01 10:59:56 +0200654 $(if $(CONFIG_GCOV),@for f in $(gcov-files-$(subst tests/,,$*)-y) $(gcov-files-generic-y); do \
Blue Swirl1d728c32012-05-01 18:45:39 +0000655 echo Gcov report for $$f:;\
656 $(GCOV) $(GCOV_OPTIONS) $$f -o `dirname $$f`; \
657 done,)
Anthony Liguoridbfe06c2012-01-10 13:10:43 -0600658
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200659# gtester tests with XML output
660
Anthony Liguori49ee3592012-03-28 15:42:05 +0200661$(patsubst %, check-report-qtest-%.xml, $(QTEST_TARGETS)): check-report-qtest-%.xml: $(check-qtest-y)
662 $(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
Stefan Weil47c71992015-07-20 12:21:18 -0400663 QTEST_QEMU_IMG=qemu-img$(EXESUF) \
Andreas Färberb5e62af2015-11-21 02:20:06 +0100664 gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $(check-qtest-$*-y) $(check-qtest-generic-y),"GTESTER $@")
Anthony Liguori49ee3592012-03-28 15:42:05 +0200665
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200666check-report-unit.xml: $(check-unit-y)
667 $(call quiet-command,gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $^, "GTESTER $@")
668
669# Reports and overall runs
670
Anthony Liguori49ee3592012-03-28 15:42:05 +0200671check-report.xml: $(patsubst %,check-report-qtest-%.xml, $(QTEST_TARGETS)) check-report-unit.xml
Stefan Weilf6288b92015-07-18 16:54:32 +0200672 $(call quiet-command,$(SRC_PATH)/scripts/gtester-cat $^ > $@, " GEN $@")
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200673
674check-report.html: check-report.xml
Stefan Weilf6288b92015-07-18 16:54:32 +0200675 $(call quiet-command,gtester-report $< > $@, " GEN $@")
Kevin Wolf89594492012-03-08 12:29:00 +0100676
Kevin Wolfb8c6f292012-03-09 13:37:40 +0100677
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200678# Other tests
Kevin Wolfb8c6f292012-03-09 13:37:40 +0100679
Wenchao Xia22ee5a52013-09-26 08:42:55 +0800680QEMU_IOTESTS_HELPERS-$(CONFIG_LINUX) = tests/qemu-iotests/socket_scm_helper$(EXESUF)
681
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200682.PHONY: check-tests/qemu-iotests-quick.sh
Wenchao Xia22ee5a52013-09-26 08:42:55 +0800683check-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 +0200684 $<
Kevin Wolfb8c6f292012-03-09 13:37:40 +0100685
Markus Armbruster98626572013-07-27 17:41:53 +0200686.PHONY: check-tests/test-qapi.py
687check-tests/test-qapi.py: tests/test-qapi.py
688
689.PHONY: $(patsubst %, check-%, $(check-qapi-schema-y))
690$(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
Lluís Vilanova0a607742014-05-02 15:52:24 +0200691 $(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts \
692 $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py \
Lluís Vilanova33aaad52014-05-02 15:52:35 +0200693 $^ >$*.test.out 2>$*.test.err; \
Lluís Vilanova0a607742014-05-02 15:52:24 +0200694 echo $$? >$*.test.exit, \
695 " TEST $*.out")
Markus Armbrusterd8039e52013-09-24 09:43:39 +0200696 @diff -q $(SRC_PATH)/$*.out $*.test.out
Lluís Vilanova33aaad52014-05-02 15:52:35 +0200697 @# Sanitize error messages (make them independent of build directory)
698 @perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q $(SRC_PATH)/$*.err -
Markus Armbrusterd8039e52013-09-24 09:43:39 +0200699 @diff -q $(SRC_PATH)/$*.exit $*.test.exit
Markus Armbruster98626572013-07-27 17:41:53 +0200700
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200701# Consolidated targets
702
Wenchao Xia2cdfb122013-09-26 08:42:56 +0800703.PHONY: check-qapi-schema check-qtest check-unit check check-clean
Markus Armbruster98626572013-07-27 17:41:53 +0200704check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y))
Anthony Liguori49ee3592012-03-28 15:42:05 +0200705check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
Paolo Bonzinib93b63f2012-03-28 15:42:01 +0200706check-unit: $(patsubst %,check-%, $(check-unit-y))
707check-block: $(patsubst %,check-%, $(check-block-y))
Markus Armbruster98626572013-07-27 17:41:53 +0200708check: check-qapi-schema check-unit check-qtest
Wenchao Xia2cdfb122013-09-26 08:42:56 +0800709check-clean:
710 $(MAKE) -C tests/tcg clean
Andreas Färberf85e3452014-04-07 18:33:22 +0200711 rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
Andreas Färberb5e62af2015-11-21 02:20:06 +0100712 rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y)) $(check-qtest-generic-y))
Wenchao Xia2cdfb122013-09-26 08:42:56 +0800713
714clean: check-clean
Eduardo Habkost14117c72012-07-18 14:22:27 -0300715
Wenchao Xia22ee5a52013-09-26 08:42:55 +0800716# Build the help program automatically
717
718all: $(QEMU_IOTESTS_HELPERS-y)
719
Eduardo Habkost14117c72012-07-18 14:22:27 -0300720-include $(wildcard tests/*.d)
Anthony Liguoridb2b5502013-06-26 15:52:14 +0200721-include $(wildcard tests/libqos/*.d)