2012-03-08 12:29:00 +01:00
|
|
|
export SRC_PATH
|
|
|
|
|
2014-01-23 17:22:59 +01:00
|
|
|
# Get the list of all supported sysemu targets
|
|
|
|
SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
|
|
|
|
$(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak)))
|
|
|
|
|
2012-03-28 15:42:01 +02:00
|
|
|
check-unit-y = tests/check-qdict$(EXESUF)
|
2013-01-15 09:49:35 +01:00
|
|
|
gcov-files-check-qdict-y = qobject/qdict.c
|
2012-03-28 15:42:01 +02:00
|
|
|
check-unit-y += tests/check-qfloat$(EXESUF)
|
2013-01-15 09:49:35 +01:00
|
|
|
gcov-files-check-qfloat-y = qobject/qfloat.c
|
2012-03-28 15:42:01 +02:00
|
|
|
check-unit-y += tests/check-qint$(EXESUF)
|
2013-01-15 09:49:35 +01:00
|
|
|
gcov-files-check-qint-y = qobject/qint.c
|
2012-03-28 15:42:01 +02:00
|
|
|
check-unit-y += tests/check-qstring$(EXESUF)
|
2013-01-15 09:49:35 +01:00
|
|
|
gcov-files-check-qstring-y = qobject/qstring.c
|
2012-03-28 15:42:01 +02:00
|
|
|
check-unit-y += tests/check-qlist$(EXESUF)
|
2013-01-15 09:49:35 +01:00
|
|
|
gcov-files-check-qlist-y = qobject/qlist.c
|
2012-03-28 15:42:01 +02:00
|
|
|
check-unit-y += tests/check-qjson$(EXESUF)
|
2013-01-15 09:49:35 +01:00
|
|
|
gcov-files-check-qjson-y = qobject/qjson.c
|
2012-03-28 15:42:01 +02:00
|
|
|
check-unit-y += tests/test-qmp-output-visitor$(EXESUF)
|
2012-05-01 20:45:39 +02:00
|
|
|
gcov-files-test-qmp-output-visitor-y = qapi/qmp-output-visitor.c
|
2012-03-28 15:42:01 +02:00
|
|
|
check-unit-y += tests/test-qmp-input-visitor$(EXESUF)
|
2012-05-01 20:45:39 +02:00
|
|
|
gcov-files-test-qmp-input-visitor-y = qapi/qmp-input-visitor.c
|
2012-03-28 15:42:01 +02:00
|
|
|
check-unit-y += tests/test-qmp-input-strict$(EXESUF)
|
|
|
|
check-unit-y += tests/test-qmp-commands$(EXESUF)
|
2012-05-01 20:45:39 +02:00
|
|
|
gcov-files-test-qmp-commands-y = qapi/qmp-dispatch.c
|
2012-03-28 15:42:01 +02:00
|
|
|
check-unit-y += tests/test-string-input-visitor$(EXESUF)
|
2012-05-01 20:45:39 +02:00
|
|
|
gcov-files-test-string-input-visitor-y = qapi/string-input-visitor.c
|
2012-03-28 15:42:01 +02:00
|
|
|
check-unit-y += tests/test-string-output-visitor$(EXESUF)
|
2012-05-01 20:45:39 +02:00
|
|
|
gcov-files-test-string-output-visitor-y = qapi/string-output-visitor.c
|
2014-06-18 08:43:29 +02:00
|
|
|
check-unit-y += tests/test-qmp-event$(EXESUF)
|
|
|
|
gcov-files-test-qmp-event-y += qapi/qmp-event.c
|
2013-08-20 00:35:40 +02:00
|
|
|
check-unit-y += tests/test-opts-visitor$(EXESUF)
|
|
|
|
gcov-files-test-opts-visitor-y = qapi/opts-visitor.c
|
2012-03-28 15:42:01 +02:00
|
|
|
check-unit-y += tests/test-coroutine$(EXESUF)
|
2013-04-08 13:11:27 +02:00
|
|
|
gcov-files-test-coroutine-y = coroutine-$(CONFIG_COROUTINE_BACKEND).c
|
2012-02-22 04:05:07 +01:00
|
|
|
check-unit-y += tests/test-visitor-serialization$(EXESUF)
|
rewrite iov_* functions
This changes implementations of all iov_*
functions, completing the previous step.
All iov_* functions now ensure that this offset
argument is within the iovec (using assertion),
but lets to specify `bytes' value larger than
actual length of the iovec - in this case they
stops at the actual end of iovec. It is also
suggested to use convinient `-1' value as `bytes'
to mean just this -- "up to the end".
There's one very minor semantic change here: new
requiriment is that `offset' points to inside of
iovec. This is checked just at the end of functions
(assert()), it does not actually need to be enforced,
but using any of these functions with offset pointing
past the end of iovec is wrong anyway.
Note: the new code in iov.c uses arithmetic with
void pointers. I thought this is not supported
everywhere and is a GCC extension (indeed, the C
standard does not define void arithmetic). However,
the original code already use void arith in
iov_from_buf() function:
(memcpy(..., buf + buf_off,...)
which apparently works well so far (it is this
way in qemu 1.0). So I left it this way and used
it in other places.
While at it, add a unit-test file test-iov.c,
to check various corner cases with iov_from_buf(),
iov_to_buf() and iov_memset().
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2012-06-07 18:08:19 +02:00
|
|
|
check-unit-y += tests/test-iov$(EXESUF)
|
2013-01-15 09:49:35 +01:00
|
|
|
gcov-files-test-iov-y = util/iov.c
|
2012-11-23 16:13:23 +01:00
|
|
|
check-unit-y += tests/test-aio$(EXESUF)
|
2014-03-28 10:55:53 +01:00
|
|
|
check-unit-$(CONFIG_POSIX) += tests/test-rfifolock$(EXESUF)
|
2013-09-02 14:14:38 +02:00
|
|
|
check-unit-y += tests/test-throttle$(EXESUF)
|
2012-05-01 20:45:39 +02:00
|
|
|
gcov-files-test-aio-$(CONFIG_WIN32) = aio-win32.c
|
|
|
|
gcov-files-test-aio-$(CONFIG_POSIX) = aio-posix.c
|
2012-11-23 16:13:24 +01:00
|
|
|
check-unit-y += tests/test-thread-pool$(EXESUF)
|
2012-05-01 20:45:39 +02:00
|
|
|
gcov-files-test-thread-pool-y = thread-pool.c
|
add hierarchical bitmap data type and test cases
HBitmaps provides an array of bits. The bits are stored as usual in an
array of unsigned longs, but HBitmap is also optimized to provide fast
iteration over set bits; going from one bit to the next is O(logB n)
worst case, with B = sizeof(long) * CHAR_BIT: the result is low enough
that the number of levels is in fact fixed.
In order to do this, it stacks multiple bitmaps with progressively coarser
granularity; in all levels except the last, bit N is set iff the N-th
unsigned long is nonzero in the immediately next level. When iteration
completes on the last level it can examine the 2nd-last level to quickly
skip entire words, and even do so recursively to skip blocks of 64 words or
powers thereof (32 on 32-bit machines).
Given an index in the bitmap, it can be split in group of bits like
this (for the 64-bit case):
bits 0-57 => word in the last bitmap | bits 58-63 => bit in the word
bits 0-51 => word in the 2nd-last bitmap | bits 52-57 => bit in the word
bits 0-45 => word in the 3rd-last bitmap | bits 46-51 => bit in the word
So it is easy to move up simply by shifting the index right by
log2(BITS_PER_LONG) bits. To move down, you shift the index left
similarly, and add the word index within the group. Iteration uses
ffs (find first set bit) to find the next word to examine; this
operation can be done in constant time in most current architectures.
Setting or clearing a range of m bits on all levels, the work to perform
is O(m + m/W + m/W^2 + ...), which is O(m) like on a regular bitmap.
When iterating on a bitmap, each bit (on any level) is only visited
once. Hence, The total cost of visiting a bitmap with m bits in it is
the number of bits that are set in all bitmaps. Unless the bitmap is
extremely sparse, this is also O(m + m/W + m/W^2 + ...), so the amortized
cost of advancing from one bit to the next is usually constant.
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-01-21 17:09:40 +01:00
|
|
|
gcov-files-test-hbitmap-y = util/hbitmap.c
|
|
|
|
check-unit-y += tests/test-hbitmap$(EXESUF)
|
2013-01-23 18:58:27 +01:00
|
|
|
check-unit-y += tests/test-x86-cpuid$(EXESUF)
|
|
|
|
# all code tested by test-x86-cpuid is inside topology.h
|
|
|
|
gcov-files-test-x86-cpuid-y =
|
2014-12-12 12:13:38 +01:00
|
|
|
ifeq ($(CONFIG_SOFTMMU),y)
|
2013-01-31 08:12:16 +01:00
|
|
|
check-unit-y += tests/test-xbzrle$(EXESUF)
|
2014-12-12 12:13:38 +01:00
|
|
|
gcov-files-test-xbzrle-y = migration/xbzrle.c
|
|
|
|
check-unit-$(CONFIG_POSIX) += tests/test-vmstate$(EXESUF)
|
|
|
|
endif
|
2013-02-04 19:27:45 +01:00
|
|
|
check-unit-y += tests/test-cutils$(EXESUF)
|
|
|
|
gcov-files-test-cutils-y += util/cutils.c
|
2013-02-16 21:47:01 +01:00
|
|
|
check-unit-y += tests/test-mul64$(EXESUF)
|
|
|
|
gcov-files-test-mul64-y = util/host-utils.c
|
2013-06-20 16:19:32 +02:00
|
|
|
check-unit-y += tests/test-int128$(EXESUF)
|
|
|
|
# all code tested by test-int128 is inside int128.h
|
|
|
|
gcov-files-test-int128-y =
|
2013-06-21 09:09:34 +02:00
|
|
|
check-unit-y += tests/rcutorture$(EXESUF)
|
|
|
|
gcov-files-rcutorture-y = util/rcu.c
|
2013-06-28 13:40:32 +02:00
|
|
|
check-unit-y += tests/test-bitops$(EXESUF)
|
2014-09-18 19:46:45 +02:00
|
|
|
check-unit-$(CONFIG_HAS_GLIB_SUBPROCESS_TESTS) += tests/test-qdev-global-props$(EXESUF)
|
2013-12-20 22:14:40 +01:00
|
|
|
check-unit-y += tests/check-qom-interface$(EXESUF)
|
|
|
|
gcov-files-check-qom-interface-y = qom/object.c
|
2014-05-19 23:53:55 +02:00
|
|
|
check-unit-y += tests/test-qemu-opts$(EXESUF)
|
|
|
|
gcov-files-test-qemu-opts-y = qom/test-qemu-opts.c
|
2012-03-28 15:42:01 +02:00
|
|
|
|
|
|
|
check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
|
|
|
|
|
2012-03-28 15:42:07 +02:00
|
|
|
# All QTests for now are POSIX-only, but the dependencies are
|
|
|
|
# really in libqtest, not in the testcases themselves.
|
2013-11-07 18:25:10 +01:00
|
|
|
|
2013-08-02 00:48:40 +02:00
|
|
|
gcov-files-ipack-y += hw/ipack/ipack.c
|
2014-02-09 12:24:15 +01:00
|
|
|
check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF)
|
|
|
|
gcov-files-ipack-y += hw/char/ipoctal232.c
|
|
|
|
|
2014-02-21 17:49:12 +01:00
|
|
|
check-qtest-virtioserial-y += tests/virtio-console-test$(EXESUF)
|
|
|
|
gcov-files-virtioserial-y += hw/char/virtio-console.c
|
|
|
|
|
2014-02-09 04:13:37 +01:00
|
|
|
gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio.c
|
|
|
|
check-qtest-virtio-y += tests/virtio-net-test$(EXESUF)
|
|
|
|
gcov-files-virtio-y += i386-softmmu/hw/net/virtio-net.c
|
2014-02-09 04:39:47 +01:00
|
|
|
check-qtest-virtio-y += tests/virtio-balloon-test$(EXESUF)
|
|
|
|
gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio-balloon.c
|
2014-02-09 04:32:55 +01:00
|
|
|
check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF)
|
|
|
|
gcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c
|
2014-02-09 04:43:10 +01:00
|
|
|
check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF)
|
|
|
|
gcov-files-virtio-y += hw/virtio/virtio-rng.c
|
2014-02-21 16:42:15 +01:00
|
|
|
check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF)
|
|
|
|
gcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c
|
2014-02-21 17:15:21 +01:00
|
|
|
ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
|
|
|
|
check-qtest-virtio-y += tests/virtio-9p-test$(EXESUF)
|
|
|
|
gcov-files-virtio-y += hw/9pfs/virtio-9p.c
|
|
|
|
gcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c
|
|
|
|
endif
|
2014-02-21 17:36:57 +01:00
|
|
|
check-qtest-virtio-y += tests/virtio-serial-test$(EXESUF)
|
|
|
|
gcov-files-virtio-y += i386-softmmu/hw/char/virtio-serial-bus.c
|
2014-02-21 17:49:12 +01:00
|
|
|
check-qtest-virtio-y += $(check-qtest-virtioserial-y)
|
|
|
|
gcov-files-virtio-y += $(gcov-files-virtioserial-y)
|
2014-02-09 04:13:37 +01:00
|
|
|
|
2013-11-07 18:25:10 +01:00
|
|
|
check-qtest-pci-y += tests/e1000-test$(EXESUF)
|
|
|
|
gcov-files-pci-y += hw/net/e1000.c
|
2013-11-07 18:43:09 +01:00
|
|
|
check-qtest-pci-y += tests/rtl8139-test$(EXESUF)
|
|
|
|
gcov-files-pci-y += hw/net/rtl8139.c
|
2013-11-07 18:53:28 +01:00
|
|
|
check-qtest-pci-y += tests/pcnet-test$(EXESUF)
|
|
|
|
gcov-files-pci-y += hw/net/pcnet.c
|
|
|
|
gcov-files-pci-y += hw/net/pcnet-pci.c
|
2013-11-07 19:18:46 +01:00
|
|
|
check-qtest-pci-y += tests/eepro100-test$(EXESUF)
|
|
|
|
gcov-files-pci-y += hw/net/eepro100.c
|
2014-02-09 04:01:37 +01:00
|
|
|
check-qtest-pci-y += tests/ne2000-test$(EXESUF)
|
|
|
|
gcov-files-pci-y += hw/net/ne2000.c
|
2014-02-21 22:19:43 +01:00
|
|
|
check-qtest-pci-y += tests/nvme-test$(EXESUF)
|
|
|
|
gcov-files-pci-y += hw/block/nvme.c
|
2014-03-30 19:00:05 +02:00
|
|
|
check-qtest-pci-y += tests/ac97-test$(EXESUF)
|
|
|
|
gcov-files-pci-y += hw/audio/ac97.c
|
2014-03-30 19:05:20 +02:00
|
|
|
check-qtest-pci-y += tests/es1370-test$(EXESUF)
|
|
|
|
gcov-files-pci-y += hw/audio/es1370.c
|
2014-02-09 04:13:37 +01:00
|
|
|
check-qtest-pci-y += $(check-qtest-virtio-y)
|
|
|
|
gcov-files-pci-y += $(gcov-files-virtio-y) hw/virtio/virtio-pci.c
|
2014-02-09 03:48:44 +01:00
|
|
|
check-qtest-pci-y += tests/tpci200-test$(EXESUF)
|
2014-02-21 16:29:17 +01:00
|
|
|
gcov-files-pci-y += hw/ipack/tpci200.c
|
2014-02-09 12:24:15 +01:00
|
|
|
check-qtest-pci-y += $(check-qtest-ipack-y)
|
2014-02-21 16:29:17 +01:00
|
|
|
gcov-files-pci-y += $(gcov-files-ipack-y)
|
2014-04-28 11:01:13 +02:00
|
|
|
check-qtest-pci-y += tests/display-vga-test$(EXESUF)
|
|
|
|
gcov-files-pci-y += hw/display/vga.c
|
|
|
|
gcov-files-pci-y += hw/display/cirrus_vga.c
|
|
|
|
gcov-files-pci-y += hw/display/vga-pci.c
|
2014-03-30 19:22:48 +02:00
|
|
|
check-qtest-pci-y += tests/intel-hda-test$(EXESUF)
|
|
|
|
gcov-files-pci-y += hw/audio/intel-hda.c hw/audio/hda-codec.c
|
2013-11-07 18:25:10 +01:00
|
|
|
|
2013-07-22 15:54:34 +02:00
|
|
|
check-qtest-i386-y = tests/endianness-test$(EXESUF)
|
|
|
|
check-qtest-i386-y += tests/fdc-test$(EXESUF)
|
2014-02-14 15:09:28 +01:00
|
|
|
gcov-files-i386-y = hw/block/fdc.c
|
2013-05-08 11:18:41 +02:00
|
|
|
check-qtest-i386-y += tests/ide-test$(EXESUF)
|
2014-08-21 19:44:32 +02:00
|
|
|
check-qtest-i386-y += tests/ahci-test$(EXESUF)
|
2012-07-10 11:12:30 +02:00
|
|
|
check-qtest-i386-y += tests/hd-geo-test$(EXESUF)
|
2014-02-14 15:09:28 +01:00
|
|
|
gcov-files-i386-y += hw/block/hd-geometry.c
|
2013-06-26 15:52:13 +02:00
|
|
|
check-qtest-i386-y += tests/boot-order-test$(EXESUF)
|
2014-05-27 21:03:14 +02:00
|
|
|
check-qtest-i386-y += tests/bios-tables-test$(EXESUF)
|
2012-05-15 18:19:45 +02:00
|
|
|
check-qtest-i386-y += tests/rtc-test$(EXESUF)
|
2013-04-16 16:45:19 +02:00
|
|
|
check-qtest-i386-y += tests/i440fx-test$(EXESUF)
|
2013-04-16 16:45:21 +02:00
|
|
|
check-qtest-i386-y += tests/fw_cfg-test$(EXESUF)
|
2014-10-02 16:51:31 +02:00
|
|
|
check-qtest-i386-y += tests/drive_del-test$(EXESUF)
|
2014-07-15 14:57:06 +02:00
|
|
|
check-qtest-i386-y += tests/wdt_ib700-test$(EXESUF)
|
|
|
|
gcov-files-i386-y += hw/watchdog/watchdog.c hw/watchdog/wdt_ib700.c
|
2013-11-07 18:25:10 +01:00
|
|
|
check-qtest-i386-y += $(check-qtest-pci-y)
|
|
|
|
gcov-files-i386-y += $(gcov-files-pci-y)
|
2013-11-07 18:37:34 +01:00
|
|
|
check-qtest-i386-y += tests/vmxnet3-test$(EXESUF)
|
|
|
|
gcov-files-i386-y += hw/net/vmxnet3.c
|
|
|
|
gcov-files-i386-y += hw/net/vmxnet_rx_pkt.c
|
|
|
|
gcov-files-i386-y += hw/net/vmxnet_tx_pkt.c
|
2014-02-21 20:38:48 +01:00
|
|
|
check-qtest-i386-y += tests/pvpanic-test$(EXESUF)
|
|
|
|
gcov-files-i386-y += i386-softmmu/hw/misc/pvpanic.c
|
2014-02-21 22:43:43 +01:00
|
|
|
check-qtest-i386-y += tests/i82801b11-test$(EXESUF)
|
|
|
|
gcov-files-i386-y += hw/pci-bridge/i82801b11.c
|
2014-03-30 20:02:00 +02:00
|
|
|
check-qtest-i386-y += tests/ioh3420-test$(EXESUF)
|
|
|
|
gcov-files-i386-y += hw/pci-bridge/ioh3420.c
|
2014-06-23 13:53:51 +02:00
|
|
|
check-qtest-i386-y += tests/usb-hcd-ohci-test$(EXESUF)
|
|
|
|
gcov-files-i386-y += hw/usb/hcd-ohci.c
|
2014-06-23 13:53:52 +02:00
|
|
|
check-qtest-i386-y += tests/usb-hcd-uhci-test$(EXESUF)
|
|
|
|
gcov-files-i386-y += hw/usb/hcd-uhci.c
|
2014-03-30 20:25:38 +02:00
|
|
|
check-qtest-i386-y += tests/usb-hcd-ehci-test$(EXESUF)
|
|
|
|
gcov-files-i386-y += hw/usb/hcd-ehci.c
|
2014-05-07 16:39:11 +02:00
|
|
|
gcov-files-i386-y += hw/usb/dev-hid.c
|
|
|
|
gcov-files-i386-y += hw/usb/dev-storage.c
|
2014-06-23 13:53:53 +02:00
|
|
|
check-qtest-i386-y += tests/usb-hcd-xhci-test$(EXESUF)
|
|
|
|
gcov-files-i386-y += hw/usb/hcd-xhci.c
|
2014-07-15 19:30:41 +02:00
|
|
|
check-qtest-i386-$(CONFIG_LINUX) += tests/vhost-user-test$(EXESUF)
|
2012-03-28 15:42:07 +02:00
|
|
|
check-qtest-x86_64-y = $(check-qtest-i386-y)
|
2014-02-14 15:09:28 +01:00
|
|
|
gcov-files-i386-y += i386-softmmu/hw/timer/mc146818rtc.c
|
2013-01-26 12:45:14 +01:00
|
|
|
gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
|
2013-07-22 15:54:34 +02:00
|
|
|
check-qtest-mips-y = tests/endianness-test$(EXESUF)
|
|
|
|
check-qtest-mips64-y = tests/endianness-test$(EXESUF)
|
|
|
|
check-qtest-mips64el-y = tests/endianness-test$(EXESUF)
|
|
|
|
check-qtest-ppc-y = tests/endianness-test$(EXESUF)
|
|
|
|
check-qtest-ppc64-y = tests/endianness-test$(EXESUF)
|
|
|
|
check-qtest-sh4-y = tests/endianness-test$(EXESUF)
|
|
|
|
check-qtest-sh4eb-y = tests/endianness-test$(EXESUF)
|
|
|
|
check-qtest-sparc64-y = tests/endianness-test$(EXESUF)
|
2013-01-29 22:42:45 +01:00
|
|
|
#check-qtest-sparc-y = tests/m48t59-test$(EXESUF)
|
2013-07-22 15:54:34 +02:00
|
|
|
#check-qtest-sparc64-y += tests/m48t59-test$(EXESUF)
|
2014-02-14 15:09:28 +01:00
|
|
|
gcov-files-sparc-y += hw/timer/m48t59.c
|
|
|
|
gcov-files-sparc64-y += hw/timer/m48t59.c
|
2013-01-16 01:57:57 +01:00
|
|
|
check-qtest-arm-y = tests/tmp105-test$(EXESUF)
|
2014-02-14 15:09:28 +01:00
|
|
|
gcov-files-arm-y += hw/misc/tmp105.c
|
2013-06-26 15:52:16 +02:00
|
|
|
check-qtest-ppc-y += tests/boot-order-test$(EXESUF)
|
|
|
|
check-qtest-ppc64-y += tests/boot-order-test$(EXESUF)
|
2014-02-10 04:52:56 +01:00
|
|
|
check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF)
|
|
|
|
gcov-files-ppc64-y += ppc64-softmmu/hw/ppc/spapr_pci.c
|
2013-07-29 05:44:47 +02:00
|
|
|
check-qtest-microblazeel-y = $(check-qtest-microblaze-y)
|
|
|
|
check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
|
2012-03-28 15:42:07 +02:00
|
|
|
|
2014-01-23 17:22:59 +01:00
|
|
|
# qom-test works for all sysemu architectures:
|
|
|
|
$(foreach target,$(SYSEMU_TARGET_LIST), \
|
2014-09-19 00:59:33 +02:00
|
|
|
$(if $(findstring tests/qom-test$(EXESUF), $(check-qtest-$(target)-y)),, \
|
|
|
|
$(eval check-qtest-$(target)-y += tests/qom-test$(EXESUF))))
|
2014-01-23 17:22:59 +01:00
|
|
|
|
2013-07-27 17:41:53 +02:00
|
|
|
check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
|
2014-09-26 17:20:31 +02:00
|
|
|
comments.json empty.json funny-char.json indented-expr.json \
|
|
|
|
missing-colon.json missing-comma-list.json \
|
|
|
|
missing-comma-object.json non-objects.json \
|
|
|
|
qapi-schema-test.json quoted-structural-chars.json \
|
|
|
|
trailing-comma-list.json trailing-comma-object.json \
|
|
|
|
unclosed-list.json unclosed-object.json unclosed-string.json \
|
|
|
|
duplicate-key.json union-invalid-base.json flat-union-no-base.json \
|
|
|
|
flat-union-invalid-discriminator.json \
|
|
|
|
flat-union-invalid-branch-key.json flat-union-reverse-define.json \
|
|
|
|
flat-union-string-discriminator.json \
|
|
|
|
include-simple.json include-relpath.json include-format-err.json \
|
|
|
|
include-non-file.json include-no-file.json include-before-err.json \
|
|
|
|
include-nested-err.json include-self-cycle.json include-cycle.json \
|
|
|
|
include-repetition.json event-nest-struct.json)
|
2013-07-27 17:41:53 +02:00
|
|
|
|
2014-06-18 08:43:29 +02:00
|
|
|
GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h \
|
2014-09-26 17:20:31 +02:00
|
|
|
tests/test-qmp-commands.h tests/test-qapi-event.h
|
2012-03-28 15:42:01 +02:00
|
|
|
|
|
|
|
test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \
|
|
|
|
tests/check-qlist.o tests/check-qfloat.o tests/check-qjson.o \
|
|
|
|
tests/test-coroutine.o tests/test-string-output-visitor.o \
|
|
|
|
tests/test-string-input-visitor.o tests/test-qmp-output-visitor.o \
|
|
|
|
tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \
|
2013-01-23 18:58:27 +01:00
|
|
|
tests/test-qmp-commands.o tests/test-visitor-serialization.o \
|
2013-08-20 00:35:40 +02:00
|
|
|
tests/test-x86-cpuid.o tests/test-mul64.o tests/test-int128.o \
|
2013-06-21 09:09:34 +02:00
|
|
|
tests/test-opts-visitor.o tests/test-qmp-event.o \
|
|
|
|
tests/rcutorture.o
|
2012-03-28 15:42:01 +02:00
|
|
|
|
2014-06-18 08:43:29 +02:00
|
|
|
test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o \
|
2014-09-26 17:20:31 +02:00
|
|
|
tests/test-qapi-event.o
|
2012-03-28 15:42:01 +02:00
|
|
|
|
|
|
|
$(test-obj-y): QEMU_INCLUDES += -Itests
|
2013-04-16 16:45:16 +02:00
|
|
|
QEMU_CFLAGS += -I$(SRC_PATH)/tests
|
2013-12-20 22:14:40 +01:00
|
|
|
qom-core-obj = qom/object.o qom/qom-qobject.o qom/container.o
|
2012-03-28 15:42:01 +02:00
|
|
|
|
2013-01-23 18:58:27 +01:00
|
|
|
tests/test-x86-cpuid.o: QEMU_INCLUDES += -I$(SRC_PATH)/target-i386
|
|
|
|
|
2012-12-20 16:10:26 +01:00
|
|
|
tests/check-qint$(EXESUF): tests/check-qint.o libqemuutil.a
|
|
|
|
tests/check-qstring$(EXESUF): tests/check-qstring.o libqemuutil.a
|
|
|
|
tests/check-qdict$(EXESUF): tests/check-qdict.o libqemuutil.a
|
|
|
|
tests/check-qlist$(EXESUF): tests/check-qlist.o libqemuutil.a
|
|
|
|
tests/check-qfloat$(EXESUF): tests/check-qfloat.o libqemuutil.a
|
|
|
|
tests/check-qjson$(EXESUF): tests/check-qjson.o libqemuutil.a libqemustub.a
|
2014-01-15 12:05:36 +01:00
|
|
|
tests/check-qom-interface$(EXESUF): tests/check-qom-interface.o $(qom-core-obj) libqemuutil.a libqemustub.a
|
2012-12-20 16:09:36 +01:00
|
|
|
tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(block-obj-y) libqemuutil.a libqemustub.a
|
|
|
|
tests/test-aio$(EXESUF): tests/test-aio.o $(block-obj-y) libqemuutil.a libqemustub.a
|
2014-03-03 11:30:03 +01:00
|
|
|
tests/test-rfifolock$(EXESUF): tests/test-rfifolock.o libqemuutil.a libqemustub.a
|
2013-09-02 14:14:38 +02:00
|
|
|
tests/test-throttle$(EXESUF): tests/test-throttle.o $(block-obj-y) libqemuutil.a libqemustub.a
|
2012-12-20 16:09:36 +01:00
|
|
|
tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(block-obj-y) libqemuutil.a libqemustub.a
|
|
|
|
tests/test-iov$(EXESUF): tests/test-iov.o libqemuutil.a
|
add hierarchical bitmap data type and test cases
HBitmaps provides an array of bits. The bits are stored as usual in an
array of unsigned longs, but HBitmap is also optimized to provide fast
iteration over set bits; going from one bit to the next is O(logB n)
worst case, with B = sizeof(long) * CHAR_BIT: the result is low enough
that the number of levels is in fact fixed.
In order to do this, it stacks multiple bitmaps with progressively coarser
granularity; in all levels except the last, bit N is set iff the N-th
unsigned long is nonzero in the immediately next level. When iteration
completes on the last level it can examine the 2nd-last level to quickly
skip entire words, and even do so recursively to skip blocks of 64 words or
powers thereof (32 on 32-bit machines).
Given an index in the bitmap, it can be split in group of bits like
this (for the 64-bit case):
bits 0-57 => word in the last bitmap | bits 58-63 => bit in the word
bits 0-51 => word in the 2nd-last bitmap | bits 52-57 => bit in the word
bits 0-45 => word in the 3rd-last bitmap | bits 46-51 => bit in the word
So it is easy to move up simply by shifting the index right by
log2(BITS_PER_LONG) bits. To move down, you shift the index left
similarly, and add the word index within the group. Iteration uses
ffs (find first set bit) to find the next word to examine; this
operation can be done in constant time in most current architectures.
Setting or clearing a range of m bits on all levels, the work to perform
is O(m + m/W + m/W^2 + ...), which is O(m) like on a regular bitmap.
When iterating on a bitmap, each bit (on any level) is only visited
once. Hence, The total cost of visiting a bitmap with m bits in it is
the number of bits that are set in all bitmaps. Unless the bitmap is
extremely sparse, this is also O(m + m/W + m/W^2 + ...), so the amortized
cost of advancing from one bit to the next is usually constant.
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-01-21 17:09:40 +01:00
|
|
|
tests/test-hbitmap$(EXESUF): tests/test-hbitmap.o libqemuutil.a libqemustub.a
|
2013-01-23 18:58:27 +01:00
|
|
|
tests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o
|
2014-12-12 12:13:38 +01:00
|
|
|
tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o page_cache.o libqemuutil.a
|
2013-02-04 19:27:45 +01:00
|
|
|
tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o
|
2013-06-20 16:19:32 +02:00
|
|
|
tests/test-int128$(EXESUF): tests/test-int128.o
|
2013-06-21 09:09:34 +02:00
|
|
|
tests/rcutorture$(EXESUF): tests/rcutorture.o libqemuutil.a
|
|
|
|
|
2013-07-10 22:08:40 +02:00
|
|
|
tests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o \
|
2014-02-05 16:36:52 +01:00
|
|
|
hw/core/qdev.o hw/core/qdev-properties.o hw/core/hotplug.o\
|
2013-07-10 22:08:40 +02:00
|
|
|
hw/core/irq.o \
|
2014-03-17 03:40:23 +01:00
|
|
|
hw/core/fw-path-provider.o \
|
2013-12-20 22:14:40 +01:00
|
|
|
$(qom-core-obj) \
|
2013-07-10 22:08:40 +02:00
|
|
|
$(test-qapi-obj-y) \
|
|
|
|
libqemuutil.a libqemustub.a
|
2013-11-28 15:01:18 +01:00
|
|
|
tests/test-vmstate$(EXESUF): tests/test-vmstate.o \
|
2014-12-12 12:13:41 +01:00
|
|
|
migration/vmstate.o migration/qemu-file.o migration/qemu-file-buf.o \
|
2015-01-22 15:01:39 +01:00
|
|
|
migration/qemu-file-unix.o qjson.o \
|
|
|
|
$(qom-core-obj) \
|
2014-10-10 13:39:05 +02:00
|
|
|
libqemuutil.a libqemustub.a
|
2012-03-28 15:42:01 +02:00
|
|
|
|
|
|
|
tests/test-qapi-types.c tests/test-qapi-types.h :\
|
2013-07-27 17:41:54 +02:00
|
|
|
$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
|
2014-05-02 15:52:24 +02:00
|
|
|
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
|
2014-05-02 15:52:35 +02:00
|
|
|
$(gen-out-type) -o tests -p "test-" -i $<, \
|
2014-05-02 15:52:24 +02:00
|
|
|
" GEN $@")
|
2012-03-28 15:42:01 +02:00
|
|
|
tests/test-qapi-visit.c tests/test-qapi-visit.h :\
|
2013-07-27 17:41:54 +02:00
|
|
|
$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
|
2014-05-02 15:52:24 +02:00
|
|
|
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
|
2014-05-02 15:52:35 +02:00
|
|
|
$(gen-out-type) -o tests -p "test-" -i $<, \
|
2014-05-02 15:52:24 +02:00
|
|
|
" GEN $@")
|
2012-03-28 15:42:01 +02:00
|
|
|
tests/test-qmp-commands.h tests/test-qmp-marshal.c :\
|
2013-07-27 17:41:54 +02:00
|
|
|
$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
|
2014-05-02 15:52:24 +02:00
|
|
|
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
|
2014-05-02 15:52:35 +02:00
|
|
|
$(gen-out-type) -o tests -p "test-" -i $<, \
|
2014-05-02 15:52:24 +02:00
|
|
|
" GEN $@")
|
2014-06-18 08:43:29 +02:00
|
|
|
tests/test-qapi-event.c tests/test-qapi-event.h :\
|
|
|
|
$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-event.py
|
|
|
|
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
|
|
|
|
$(gen-out-type) -o tests -p "test-" -i $<, \
|
|
|
|
" GEN $@")
|
2012-01-10 20:10:43 +01:00
|
|
|
|
2012-12-20 15:40:20 +01:00
|
|
|
tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
|
|
|
|
tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
|
2014-06-18 08:43:29 +02:00
|
|
|
tests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
|
2012-12-20 15:40:20 +01:00
|
|
|
tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
|
|
|
|
tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
|
|
|
|
tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
|
2014-08-07 04:34:41 +02:00
|
|
|
tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
|
2012-12-20 15:40:20 +01:00
|
|
|
tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
|
2013-08-20 00:35:40 +02:00
|
|
|
tests/test-opts-visitor$(EXESUF): tests/test-opts-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
|
2012-02-09 11:21:03 +01:00
|
|
|
|
2013-02-16 21:47:01 +01:00
|
|
|
tests/test-mul64$(EXESUF): tests/test-mul64.o libqemuutil.a
|
2013-06-28 13:40:32 +02:00
|
|
|
tests/test-bitops$(EXESUF): tests/test-bitops.o libqemuutil.a
|
2013-02-16 21:47:01 +01:00
|
|
|
|
2014-10-23 10:12:42 +02:00
|
|
|
libqos-obj-y = tests/libqos/pci.o tests/libqos/fw_cfg.o tests/libqos/malloc.o
|
2013-05-02 15:56:26 +02:00
|
|
|
libqos-obj-y += tests/libqos/i2c.o
|
2013-06-26 15:52:22 +02:00
|
|
|
libqos-pc-obj-y = $(libqos-obj-y) tests/libqos/pci-pc.o
|
2013-04-16 16:45:18 +02:00
|
|
|
libqos-pc-obj-y += tests/libqos/malloc-pc.o
|
2013-05-02 15:56:26 +02:00
|
|
|
libqos-omap-obj-y = $(libqos-obj-y) tests/libqos/i2c-omap.o
|
2014-09-01 12:07:55 +02:00
|
|
|
libqos-virtio-obj-y = $(libqos-obj-y) $(libqos-pc-obj-y) tests/libqos/virtio.o tests/libqos/virtio-pci.o
|
2014-09-26 11:28:12 +02:00
|
|
|
libqos-usb-obj-y = $(libqos-pc-obj-y) tests/libqos/usb.o
|
2013-04-16 16:45:16 +02:00
|
|
|
|
2012-12-21 09:45:20 +01:00
|
|
|
tests/rtc-test$(EXESUF): tests/rtc-test.o
|
|
|
|
tests/m48t59-test$(EXESUF): tests/m48t59-test.o
|
2013-07-22 15:54:34 +02:00
|
|
|
tests/endianness-test$(EXESUF): tests/endianness-test.o
|
2014-02-10 04:52:56 +01:00
|
|
|
tests/spapr-phb-test$(EXESUF): tests/spapr-phb-test.o $(libqos-obj-y)
|
2012-12-21 09:45:20 +01:00
|
|
|
tests/fdc-test$(EXESUF): tests/fdc-test.o
|
2013-05-08 11:18:41 +02:00
|
|
|
tests/ide-test$(EXESUF): tests/ide-test.o $(libqos-pc-obj-y)
|
2014-08-21 19:44:32 +02:00
|
|
|
tests/ahci-test$(EXESUF): tests/ahci-test.o $(libqos-pc-obj-y)
|
2012-12-21 09:45:20 +01:00
|
|
|
tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o
|
2013-06-26 15:52:16 +02:00
|
|
|
tests/boot-order-test$(EXESUF): tests/boot-order-test.o $(libqos-obj-y)
|
2014-05-27 21:03:14 +02:00
|
|
|
tests/bios-tables-test$(EXESUF): tests/bios-tables-test.o $(libqos-obj-y)
|
2013-05-02 15:56:26 +02:00
|
|
|
tests/tmp105-test$(EXESUF): tests/tmp105-test.o $(libqos-omap-obj-y)
|
2013-04-16 16:45:19 +02:00
|
|
|
tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y)
|
2013-04-16 16:45:21 +02:00
|
|
|
tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y)
|
2013-11-07 18:25:10 +01:00
|
|
|
tests/e1000-test$(EXESUF): tests/e1000-test.o
|
2013-11-07 18:43:09 +01:00
|
|
|
tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o
|
2013-11-07 18:53:28 +01:00
|
|
|
tests/pcnet-test$(EXESUF): tests/pcnet-test.o
|
2013-11-07 19:18:46 +01:00
|
|
|
tests/eepro100-test$(EXESUF): tests/eepro100-test.o
|
2013-11-07 18:37:34 +01:00
|
|
|
tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o
|
2014-02-09 04:01:37 +01:00
|
|
|
tests/ne2000-test$(EXESUF): tests/ne2000-test.o
|
2014-07-15 14:57:06 +02:00
|
|
|
tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o
|
2014-02-09 04:39:47 +01:00
|
|
|
tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o
|
2014-09-01 12:07:54 +02:00
|
|
|
tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o $(libqos-virtio-obj-y)
|
2014-09-26 11:28:10 +02:00
|
|
|
tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o $(libqos-pc-obj-y)
|
2014-09-26 11:28:09 +02:00
|
|
|
tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o $(libqos-pc-obj-y)
|
2014-02-21 16:42:15 +01:00
|
|
|
tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o
|
2014-02-21 17:15:21 +01:00
|
|
|
tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o
|
2014-02-21 17:36:57 +01:00
|
|
|
tests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o
|
2014-02-21 17:49:12 +01:00
|
|
|
tests/virtio-console-test$(EXESUF): tests/virtio-console-test.o
|
2014-02-09 03:48:44 +01:00
|
|
|
tests/tpci200-test$(EXESUF): tests/tpci200-test.o
|
2014-04-28 11:01:13 +02:00
|
|
|
tests/display-vga-test$(EXESUF): tests/display-vga-test.o
|
2014-02-09 12:24:15 +01:00
|
|
|
tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
|
2013-07-29 05:44:47 +02:00
|
|
|
tests/qom-test$(EXESUF): tests/qom-test.o
|
2014-10-02 16:51:31 +02:00
|
|
|
tests/drive_del-test$(EXESUF): tests/drive_del-test.o $(libqos-pc-obj-y)
|
2013-10-30 14:54:35 +01:00
|
|
|
tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y)
|
2014-02-21 22:19:43 +01:00
|
|
|
tests/nvme-test$(EXESUF): tests/nvme-test.o
|
2014-02-21 20:38:48 +01:00
|
|
|
tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o
|
2014-02-21 22:43:43 +01:00
|
|
|
tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o
|
2014-03-30 19:00:05 +02:00
|
|
|
tests/ac97-test$(EXESUF): tests/ac97-test.o
|
2014-03-30 19:05:20 +02:00
|
|
|
tests/es1370-test$(EXESUF): tests/es1370-test.o
|
2014-03-30 19:22:48 +02:00
|
|
|
tests/intel-hda-test$(EXESUF): tests/intel-hda-test.o
|
2014-03-30 20:02:00 +02:00
|
|
|
tests/ioh3420-test$(EXESUF): tests/ioh3420-test.o
|
2014-09-26 11:28:14 +02:00
|
|
|
tests/usb-hcd-ohci-test$(EXESUF): tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y)
|
2014-09-26 11:28:13 +02:00
|
|
|
tests/usb-hcd-uhci-test$(EXESUF): tests/usb-hcd-uhci-test.o $(libqos-usb-obj-y)
|
2014-09-26 11:28:12 +02:00
|
|
|
tests/usb-hcd-ehci-test$(EXESUF): tests/usb-hcd-ehci-test.o $(libqos-usb-obj-y)
|
2014-09-26 11:28:14 +02:00
|
|
|
tests/usb-hcd-xhci-test$(EXESUF): tests/usb-hcd-xhci-test.o $(libqos-usb-obj-y)
|
2014-06-19 19:35:42 +02:00
|
|
|
tests/vhost-user-test$(EXESUF): tests/vhost-user-test.o qemu-char.o qemu-timer.o $(qtest-obj-y)
|
2013-09-06 05:24:32 +02:00
|
|
|
tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o
|
2014-05-19 23:53:55 +02:00
|
|
|
tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o libqemuutil.a libqemustub.a
|
2012-03-30 19:39:33 +02:00
|
|
|
|
2014-06-19 19:35:42 +02:00
|
|
|
ifeq ($(CONFIG_POSIX),y)
|
|
|
|
LIBS += -lutil
|
|
|
|
endif
|
2014-06-10 12:03:23 +02:00
|
|
|
|
2012-03-28 15:42:05 +02:00
|
|
|
# QTest rules
|
|
|
|
|
|
|
|
TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
|
2014-03-28 10:55:54 +01:00
|
|
|
ifeq ($(CONFIG_POSIX),y)
|
2012-03-28 15:42:05 +02:00
|
|
|
QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),))
|
2014-03-28 10:55:54 +01:00
|
|
|
check-qtest-y=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))
|
|
|
|
endif
|
2012-03-28 15:42:05 +02:00
|
|
|
|
2012-12-20 15:40:20 +01:00
|
|
|
qtest-obj-y = tests/libqtest.o libqemuutil.a libqemustub.a
|
2012-03-28 15:42:05 +02:00
|
|
|
$(check-qtest-y): $(qtest-obj-y)
|
|
|
|
|
2012-03-28 15:42:01 +02:00
|
|
|
.PHONY: check-help
|
|
|
|
check-help:
|
|
|
|
@echo "Regression testing targets:"
|
|
|
|
@echo
|
|
|
|
@echo " make check Run all tests"
|
2012-03-28 15:42:05 +02:00
|
|
|
@echo " make check-qtest-TARGET Run qtest tests for given target"
|
|
|
|
@echo " make check-qtest Run qtest tests"
|
2012-03-28 15:42:01 +02:00
|
|
|
@echo " make check-unit Run qobject tests"
|
2013-07-27 17:41:53 +02:00
|
|
|
@echo " make check-qapi-schema Run QAPI schema tests"
|
2012-03-28 15:42:01 +02:00
|
|
|
@echo " make check-block Run block tests"
|
|
|
|
@echo " make check-report.html Generates an HTML test report"
|
2013-09-26 02:42:56 +02:00
|
|
|
@echo " make check-clean Clean the tests"
|
2012-03-28 15:42:01 +02:00
|
|
|
@echo
|
|
|
|
@echo "Please note that HTML reports do not regenerate if the unit tests"
|
|
|
|
@echo "has not changed."
|
|
|
|
@echo
|
|
|
|
@echo "The variable SPEED can be set to control the gtester speed setting."
|
|
|
|
@echo "Default options are -k and (for make V=1) --verbose; they can be"
|
|
|
|
@echo "changed with variable GTESTER_OPTIONS."
|
2012-02-09 11:21:03 +01:00
|
|
|
|
2012-03-28 15:42:01 +02:00
|
|
|
SPEED = quick
|
|
|
|
GTESTER_OPTIONS = -k $(if $(V),--verbose,-q)
|
2012-05-01 20:45:39 +02:00
|
|
|
GCOV_OPTIONS = -n $(if $(V),-f,)
|
2012-01-10 20:10:43 +01:00
|
|
|
|
2012-03-28 15:42:01 +02:00
|
|
|
# gtester tests, possibly with verbose output
|
2012-01-10 20:10:43 +01:00
|
|
|
|
2012-03-28 15:42:05 +02:00
|
|
|
.PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS))
|
|
|
|
$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: $(check-qtest-y)
|
2012-05-01 20:45:39 +02:00
|
|
|
$(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,)
|
2012-03-28 15:42:05 +02:00
|
|
|
$(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
|
2013-05-27 15:28:51 +02:00
|
|
|
MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$((RANDOM % 255 + 1))} \
|
2012-03-28 15:42:05 +02:00
|
|
|
gtester $(GTESTER_OPTIONS) -m=$(SPEED) $(check-qtest-$*-y),"GTESTER $@")
|
2012-05-01 20:45:39 +02:00
|
|
|
$(if $(CONFIG_GCOV),@for f in $(gcov-files-$*-y); do \
|
|
|
|
echo Gcov report for $$f:;\
|
|
|
|
$(GCOV) $(GCOV_OPTIONS) $$f -o `dirname $$f`; \
|
|
|
|
done,)
|
2012-03-28 15:42:05 +02:00
|
|
|
|
2012-03-28 15:42:01 +02:00
|
|
|
.PHONY: $(patsubst %, check-%, $(check-unit-y))
|
|
|
|
$(patsubst %, check-%, $(check-unit-y)): check-%: %
|
2012-05-01 20:45:39 +02:00
|
|
|
$(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,)
|
2013-05-27 15:28:51 +02:00
|
|
|
$(call quiet-command, \
|
|
|
|
MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$((RANDOM % 255 + 1))} \
|
|
|
|
gtester $(GTESTER_OPTIONS) -m=$(SPEED) $*,"GTESTER $*")
|
2012-05-01 20:45:39 +02:00
|
|
|
$(if $(CONFIG_GCOV),@for f in $(gcov-files-$(subst tests/,,$*)-y); do \
|
|
|
|
echo Gcov report for $$f:;\
|
|
|
|
$(GCOV) $(GCOV_OPTIONS) $$f -o `dirname $$f`; \
|
|
|
|
done,)
|
2012-01-10 20:10:43 +01:00
|
|
|
|
2012-03-28 15:42:01 +02:00
|
|
|
# gtester tests with XML output
|
2012-03-08 12:29:00 +01:00
|
|
|
|
2012-03-28 15:42:05 +02:00
|
|
|
$(patsubst %, check-report-qtest-%.xml, $(QTEST_TARGETS)): check-report-qtest-%.xml: $(check-qtest-y)
|
|
|
|
$(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
|
|
|
|
gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $(check-qtest-$*-y),"GTESTER $@")
|
|
|
|
|
2012-03-28 15:42:01 +02:00
|
|
|
check-report-unit.xml: $(check-unit-y)
|
|
|
|
$(call quiet-command,gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $^, "GTESTER $@")
|
2012-03-09 13:37:40 +01:00
|
|
|
|
2012-03-28 15:42:01 +02:00
|
|
|
# Reports and overall runs
|
2012-03-09 13:37:40 +01:00
|
|
|
|
2012-03-28 15:42:05 +02:00
|
|
|
check-report.xml: $(patsubst %,check-report-qtest-%.xml, $(QTEST_TARGETS)) check-report-unit.xml
|
2012-03-28 15:42:01 +02:00
|
|
|
$(call quiet-command,$(SRC_PATH)/scripts/gtester-cat $^ > $@, " GEN $@")
|
2012-03-09 13:37:40 +01:00
|
|
|
|
2012-03-28 15:42:01 +02:00
|
|
|
check-report.html: check-report.xml
|
|
|
|
$(call quiet-command,gtester-report $< > $@, " GEN $@")
|
|
|
|
|
|
|
|
|
|
|
|
# Other tests
|
|
|
|
|
2013-09-26 02:42:55 +02:00
|
|
|
QEMU_IOTESTS_HELPERS-$(CONFIG_LINUX) = tests/qemu-iotests/socket_scm_helper$(EXESUF)
|
|
|
|
|
2012-03-28 15:42:01 +02:00
|
|
|
.PHONY: check-tests/qemu-iotests-quick.sh
|
2013-09-26 02:42:55 +02:00
|
|
|
check-tests/qemu-iotests-quick.sh: tests/qemu-iotests-quick.sh qemu-img$(EXESUF) qemu-io$(EXESUF) $(QEMU_IOTESTS_HELPERS-y)
|
2012-03-28 15:42:01 +02:00
|
|
|
$<
|
|
|
|
|
2013-07-27 17:41:53 +02:00
|
|
|
.PHONY: check-tests/test-qapi.py
|
|
|
|
check-tests/test-qapi.py: tests/test-qapi.py
|
|
|
|
|
|
|
|
.PHONY: $(patsubst %, check-%, $(check-qapi-schema-y))
|
|
|
|
$(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
|
2014-05-02 15:52:24 +02:00
|
|
|
$(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts \
|
|
|
|
$(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py \
|
2014-05-02 15:52:35 +02:00
|
|
|
$^ >$*.test.out 2>$*.test.err; \
|
2014-05-02 15:52:24 +02:00
|
|
|
echo $$? >$*.test.exit, \
|
|
|
|
" TEST $*.out")
|
2013-09-24 09:43:39 +02:00
|
|
|
@diff -q $(SRC_PATH)/$*.out $*.test.out
|
2014-05-02 15:52:35 +02:00
|
|
|
@# Sanitize error messages (make them independent of build directory)
|
|
|
|
@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q $(SRC_PATH)/$*.err -
|
2013-09-24 09:43:39 +02:00
|
|
|
@diff -q $(SRC_PATH)/$*.exit $*.test.exit
|
2013-07-27 17:41:53 +02:00
|
|
|
|
2012-03-28 15:42:01 +02:00
|
|
|
# Consolidated targets
|
|
|
|
|
2013-09-26 02:42:56 +02:00
|
|
|
.PHONY: check-qapi-schema check-qtest check-unit check check-clean
|
2013-07-27 17:41:53 +02:00
|
|
|
check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y))
|
2012-03-28 15:42:05 +02:00
|
|
|
check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
|
2012-03-28 15:42:01 +02:00
|
|
|
check-unit: $(patsubst %,check-%, $(check-unit-y))
|
|
|
|
check-block: $(patsubst %,check-%, $(check-block-y))
|
2013-07-27 17:41:53 +02:00
|
|
|
check: check-qapi-schema check-unit check-qtest
|
2013-09-26 02:42:56 +02:00
|
|
|
check-clean:
|
|
|
|
$(MAKE) -C tests/tcg clean
|
2014-04-07 18:33:22 +02:00
|
|
|
rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
|
|
|
|
rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y)))
|
2013-09-26 02:42:56 +02:00
|
|
|
|
|
|
|
clean: check-clean
|
2012-07-18 19:22:27 +02:00
|
|
|
|
2013-09-26 02:42:55 +02:00
|
|
|
# Build the help program automatically
|
|
|
|
|
|
|
|
all: $(QEMU_IOTESTS_HELPERS-y)
|
|
|
|
|
2012-07-18 19:22:27 +02:00
|
|
|
-include $(wildcard tests/*.d)
|
2013-06-26 15:52:14 +02:00
|
|
|
-include $(wildcard tests/libqos/*.d)
|