2012-03-08 19:29:00 +08:00
|
|
|
export SRC_PATH
|
|
|
|
|
2012-03-28 21:42:01 +08:00
|
|
|
check-unit-y = tests/check-qdict$(EXESUF)
|
2013-01-15 16:49:35 +08:00
|
|
|
gcov-files-check-qdict-y = qobject/qdict.c
|
2012-03-28 21:42:01 +08:00
|
|
|
check-unit-y += tests/check-qfloat$(EXESUF)
|
2013-01-15 16:49:35 +08:00
|
|
|
gcov-files-check-qfloat-y = qobject/qfloat.c
|
2012-03-28 21:42:01 +08:00
|
|
|
check-unit-y += tests/check-qint$(EXESUF)
|
2013-01-15 16:49:35 +08:00
|
|
|
gcov-files-check-qint-y = qobject/qint.c
|
2012-03-28 21:42:01 +08:00
|
|
|
check-unit-y += tests/check-qstring$(EXESUF)
|
2013-01-15 16:49:35 +08:00
|
|
|
gcov-files-check-qstring-y = qobject/qstring.c
|
2012-03-28 21:42:01 +08:00
|
|
|
check-unit-y += tests/check-qlist$(EXESUF)
|
2013-01-15 16:49:35 +08:00
|
|
|
gcov-files-check-qlist-y = qobject/qlist.c
|
2012-03-28 21:42:01 +08:00
|
|
|
check-unit-y += tests/check-qjson$(EXESUF)
|
2013-01-15 16:49:35 +08:00
|
|
|
gcov-files-check-qjson-y = qobject/qjson.c
|
2012-03-28 21:42:01 +08:00
|
|
|
check-unit-y += tests/test-qmp-output-visitor$(EXESUF)
|
2012-05-02 02:45:39 +08:00
|
|
|
gcov-files-test-qmp-output-visitor-y = qapi/qmp-output-visitor.c
|
2012-03-28 21:42:01 +08:00
|
|
|
check-unit-y += tests/test-qmp-input-visitor$(EXESUF)
|
2012-05-02 02:45:39 +08:00
|
|
|
gcov-files-test-qmp-input-visitor-y = qapi/qmp-input-visitor.c
|
2012-03-28 21:42:01 +08:00
|
|
|
check-unit-y += tests/test-qmp-input-strict$(EXESUF)
|
|
|
|
check-unit-y += tests/test-qmp-commands$(EXESUF)
|
2012-05-02 02:45:39 +08:00
|
|
|
gcov-files-test-qmp-commands-y = qapi/qmp-dispatch.c
|
2012-03-28 21:42:01 +08:00
|
|
|
check-unit-y += tests/test-string-input-visitor$(EXESUF)
|
2012-05-02 02:45:39 +08:00
|
|
|
gcov-files-test-string-input-visitor-y = qapi/string-input-visitor.c
|
2012-03-28 21:42:01 +08:00
|
|
|
check-unit-y += tests/test-string-output-visitor$(EXESUF)
|
2012-05-02 02:45:39 +08:00
|
|
|
gcov-files-test-string-output-visitor-y = qapi/string-output-visitor.c
|
2012-03-28 21:42:01 +08:00
|
|
|
check-unit-y += tests/test-coroutine$(EXESUF)
|
2013-04-08 19:11:27 +08:00
|
|
|
gcov-files-test-coroutine-y = coroutine-$(CONFIG_COROUTINE_BACKEND).c
|
2012-02-22 11:05:07 +08: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-08 00:08:19 +08:00
|
|
|
check-unit-y += tests/test-iov$(EXESUF)
|
2013-01-15 16:49:35 +08:00
|
|
|
gcov-files-test-iov-y = util/iov.c
|
2012-11-23 23:13:23 +08:00
|
|
|
check-unit-y += tests/test-aio$(EXESUF)
|
2012-05-02 02:45:39 +08:00
|
|
|
gcov-files-test-aio-$(CONFIG_WIN32) = aio-win32.c
|
|
|
|
gcov-files-test-aio-$(CONFIG_POSIX) = aio-posix.c
|
2012-11-23 23:13:24 +08:00
|
|
|
check-unit-y += tests/test-thread-pool$(EXESUF)
|
2012-05-02 02:45:39 +08: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-22 00:09:40 +08:00
|
|
|
gcov-files-test-hbitmap-y = util/hbitmap.c
|
|
|
|
check-unit-y += tests/test-hbitmap$(EXESUF)
|
2013-01-24 01:58:27 +08: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 =
|
2013-01-31 15:12:16 +08:00
|
|
|
check-unit-y += tests/test-xbzrle$(EXESUF)
|
|
|
|
gcov-files-test-xbzrle-y = xbzrle.c
|
2013-02-05 02:27:45 +08:00
|
|
|
check-unit-y += tests/test-cutils$(EXESUF)
|
|
|
|
gcov-files-test-cutils-y += util/cutils.c
|
2013-02-17 04:47:01 +08:00
|
|
|
check-unit-y += tests/test-mul64$(EXESUF)
|
|
|
|
gcov-files-test-mul64-y = util/host-utils.c
|
2012-03-28 21:42:01 +08:00
|
|
|
|
|
|
|
check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
|
|
|
|
|
2012-03-28 21:42:07 +08:00
|
|
|
# All QTests for now are POSIX-only, but the dependencies are
|
|
|
|
# really in libqtest, not in the testcases themselves.
|
2012-05-10 15:46:18 +08:00
|
|
|
check-qtest-i386-y = tests/fdc-test$(EXESUF)
|
2012-05-02 02:45:39 +08:00
|
|
|
gcov-files-i386-y = hw/fdc.c
|
2012-07-10 17:12:30 +08:00
|
|
|
check-qtest-i386-y += tests/hd-geo-test$(EXESUF)
|
2012-05-02 02:45:39 +08:00
|
|
|
gcov-files-i386-y += hw/hd-geometry.c
|
2012-05-16 00:19:45 +08:00
|
|
|
check-qtest-i386-y += tests/rtc-test$(EXESUF)
|
2013-04-16 22:45:19 +08:00
|
|
|
check-qtest-i386-y += tests/i440fx-test$(EXESUF)
|
2012-03-28 21:42:07 +08:00
|
|
|
check-qtest-x86_64-y = $(check-qtest-i386-y)
|
2012-05-02 02:45:39 +08:00
|
|
|
gcov-files-i386-y += i386-softmmu/hw/mc146818rtc.c
|
2013-01-26 19:45:14 +08:00
|
|
|
gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
|
2013-01-30 05:42:45 +08:00
|
|
|
#check-qtest-sparc-y = tests/m48t59-test$(EXESUF)
|
|
|
|
#check-qtest-sparc64-y = tests/m48t59-test$(EXESUF)
|
2012-05-02 02:45:39 +08:00
|
|
|
gcov-files-sparc-y += hw/m48t59.c
|
2013-01-26 19:45:13 +08:00
|
|
|
gcov-files-sparc64-y += hw/m48t59.c
|
2013-01-16 08:57:57 +08:00
|
|
|
check-qtest-arm-y = tests/tmp105-test$(EXESUF)
|
2013-01-26 19:45:12 +08:00
|
|
|
gcov-files-arm-y += hw/tmp105.c
|
2012-03-28 21:42:07 +08:00
|
|
|
|
2012-03-28 21:42:01 +08:00
|
|
|
GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h tests/test-qmp-commands.h
|
|
|
|
|
|
|
|
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-24 01:58:27 +08:00
|
|
|
tests/test-qmp-commands.o tests/test-visitor-serialization.o \
|
2013-02-17 04:47:01 +08:00
|
|
|
tests/test-x86-cpuid.o tests/test-mul64.o
|
2012-03-28 21:42:01 +08:00
|
|
|
|
2012-12-20 22:27:51 +08:00
|
|
|
test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o
|
2012-03-28 21:42:01 +08:00
|
|
|
|
|
|
|
$(test-obj-y): QEMU_INCLUDES += -Itests
|
2013-04-16 22:45:16 +08:00
|
|
|
QEMU_CFLAGS += -I$(SRC_PATH)/tests
|
2012-03-28 21:42:01 +08:00
|
|
|
|
2013-01-24 01:58:27 +08:00
|
|
|
tests/test-x86-cpuid.o: QEMU_INCLUDES += -I$(SRC_PATH)/target-i386
|
|
|
|
|
2012-12-20 23:10:26 +08: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
|
2012-12-20 23:09:36 +08: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
|
|
|
|
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-22 00:09:40 +08:00
|
|
|
tests/test-hbitmap$(EXESUF): tests/test-hbitmap.o libqemuutil.a libqemustub.a
|
2013-01-24 01:58:27 +08:00
|
|
|
tests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o
|
2013-01-31 15:12:16 +08:00
|
|
|
tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o xbzrle.o page_cache.o libqemuutil.a
|
2013-02-05 02:27:45 +08:00
|
|
|
tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o
|
2012-03-28 21:42:01 +08:00
|
|
|
|
|
|
|
tests/test-qapi-types.c tests/test-qapi-types.h :\
|
2012-01-11 03:10:43 +08:00
|
|
|
$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
|
2012-03-28 21:42:01 +08:00
|
|
|
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o tests -p "test-" < $<, " GEN $@")
|
|
|
|
tests/test-qapi-visit.c tests/test-qapi-visit.h :\
|
2012-01-11 03:10:43 +08:00
|
|
|
$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
|
2012-03-28 21:42:01 +08:00
|
|
|
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o tests -p "test-" < $<, " GEN $@")
|
|
|
|
tests/test-qmp-commands.h tests/test-qmp-marshal.c :\
|
2012-01-11 03:10:43 +08:00
|
|
|
$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
|
2012-03-28 21:42:01 +08:00
|
|
|
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o tests -p "test-" < $<, " GEN $@")
|
2012-01-11 03:10:43 +08:00
|
|
|
|
2012-12-20 22:40:20 +08: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
|
|
|
|
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
|
2012-12-20 22:03:18 +08:00
|
|
|
tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) qapi-types.o qapi-visit.o libqemuutil.a libqemustub.a
|
2012-12-20 22:40:20 +08:00
|
|
|
tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
|
2012-02-09 18:21:03 +08:00
|
|
|
|
2013-02-17 04:47:01 +08:00
|
|
|
tests/test-mul64$(EXESUF): tests/test-mul64.o libqemuutil.a
|
|
|
|
|
2013-04-16 22:45:17 +08:00
|
|
|
libqos-obj-y = tests/libqos/pci.o tests/libqos/fw_cfg.o
|
|
|
|
libqos-pc-obj-y = $(libqos-obj-y) tests/libqos/pci-pc.o tests/libqos/fw_cfg-pc.o
|
2013-04-16 22:45:18 +08:00
|
|
|
libqos-pc-obj-y += tests/libqos/malloc-pc.o
|
2013-04-16 22:45:16 +08:00
|
|
|
|
2012-12-21 16:45:20 +08:00
|
|
|
tests/rtc-test$(EXESUF): tests/rtc-test.o
|
|
|
|
tests/m48t59-test$(EXESUF): tests/m48t59-test.o
|
|
|
|
tests/fdc-test$(EXESUF): tests/fdc-test.o
|
|
|
|
tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o
|
2013-01-16 08:57:57 +08:00
|
|
|
tests/tmp105-test$(EXESUF): tests/tmp105-test.o
|
2013-04-16 22:45:19 +08:00
|
|
|
tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y)
|
2012-03-31 01:39:33 +08:00
|
|
|
|
2012-03-28 21:42:05 +08:00
|
|
|
# QTest rules
|
|
|
|
|
|
|
|
TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
|
|
|
|
QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),))
|
|
|
|
check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))
|
|
|
|
|
2012-12-20 22:40:20 +08:00
|
|
|
qtest-obj-y = tests/libqtest.o libqemuutil.a libqemustub.a
|
2013-01-16 08:57:54 +08:00
|
|
|
qtest-obj-y += tests/libi2c.o tests/libi2c-omap.o
|
2012-03-28 21:42:05 +08:00
|
|
|
$(check-qtest-y): $(qtest-obj-y)
|
|
|
|
|
2012-03-28 21:42:01 +08:00
|
|
|
.PHONY: check-help
|
|
|
|
check-help:
|
|
|
|
@echo "Regression testing targets:"
|
|
|
|
@echo
|
|
|
|
@echo " make check Run all tests"
|
2012-03-28 21:42:05 +08:00
|
|
|
@echo " make check-qtest-TARGET Run qtest tests for given target"
|
|
|
|
@echo " make check-qtest Run qtest tests"
|
2012-03-28 21:42:01 +08:00
|
|
|
@echo " make check-unit Run qobject tests"
|
|
|
|
@echo " make check-block Run block tests"
|
|
|
|
@echo " make check-report.html Generates an HTML test report"
|
|
|
|
@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 18:21:03 +08:00
|
|
|
|
2012-03-28 21:42:01 +08:00
|
|
|
SPEED = quick
|
|
|
|
GTESTER_OPTIONS = -k $(if $(V),--verbose,-q)
|
2012-05-02 02:45:39 +08:00
|
|
|
GCOV_OPTIONS = -n $(if $(V),-f,)
|
2012-01-11 03:10:43 +08:00
|
|
|
|
2012-03-28 21:42:01 +08:00
|
|
|
# gtester tests, possibly with verbose output
|
2012-01-11 03:10:43 +08:00
|
|
|
|
2012-03-28 21:42:05 +08:00
|
|
|
.PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS))
|
|
|
|
$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: $(check-qtest-y)
|
2012-05-02 02:45:39 +08:00
|
|
|
$(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,)
|
2012-03-28 21:42:05 +08:00
|
|
|
$(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
|
|
|
|
gtester $(GTESTER_OPTIONS) -m=$(SPEED) $(check-qtest-$*-y),"GTESTER $@")
|
2012-05-02 02:45:39 +08: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 21:42:05 +08:00
|
|
|
|
2012-03-28 21:42:01 +08:00
|
|
|
.PHONY: $(patsubst %, check-%, $(check-unit-y))
|
|
|
|
$(patsubst %, check-%, $(check-unit-y)): check-%: %
|
2012-05-02 02:45:39 +08:00
|
|
|
$(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,)
|
2012-03-28 21:42:01 +08:00
|
|
|
$(call quiet-command,gtester $(GTESTER_OPTIONS) -m=$(SPEED) $*,"GTESTER $*")
|
2012-05-02 02:45:39 +08: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-11 03:10:43 +08:00
|
|
|
|
2012-03-28 21:42:01 +08:00
|
|
|
# gtester tests with XML output
|
2012-03-08 19:29:00 +08:00
|
|
|
|
2012-03-28 21:42:05 +08: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 21:42:01 +08:00
|
|
|
check-report-unit.xml: $(check-unit-y)
|
|
|
|
$(call quiet-command,gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $^, "GTESTER $@")
|
2012-03-09 20:37:40 +08:00
|
|
|
|
2012-03-28 21:42:01 +08:00
|
|
|
# Reports and overall runs
|
2012-03-09 20:37:40 +08:00
|
|
|
|
2012-03-28 21:42:05 +08:00
|
|
|
check-report.xml: $(patsubst %,check-report-qtest-%.xml, $(QTEST_TARGETS)) check-report-unit.xml
|
2012-03-28 21:42:01 +08:00
|
|
|
$(call quiet-command,$(SRC_PATH)/scripts/gtester-cat $^ > $@, " GEN $@")
|
2012-03-09 20:37:40 +08:00
|
|
|
|
2012-03-28 21:42:01 +08:00
|
|
|
check-report.html: check-report.xml
|
|
|
|
$(call quiet-command,gtester-report $< > $@, " GEN $@")
|
|
|
|
|
|
|
|
|
|
|
|
# Other tests
|
|
|
|
|
|
|
|
.PHONY: check-tests/qemu-iotests-quick.sh
|
|
|
|
check-tests/qemu-iotests-quick.sh: tests/qemu-iotests-quick.sh qemu-img$(EXESUF) qemu-io$(EXESUF)
|
|
|
|
$<
|
|
|
|
|
|
|
|
# Consolidated targets
|
|
|
|
|
2012-03-28 21:42:05 +08:00
|
|
|
.PHONY: check-qtest check-unit check
|
|
|
|
check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
|
2012-03-28 21:42:01 +08:00
|
|
|
check-unit: $(patsubst %,check-%, $(check-unit-y))
|
|
|
|
check-block: $(patsubst %,check-%, $(check-block-y))
|
2012-03-28 21:42:05 +08:00
|
|
|
check: check-unit check-qtest
|
2012-07-19 01:22:27 +08:00
|
|
|
|
|
|
|
-include $(wildcard tests/*.d)
|