mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
qapi: Unit tests for visitor-based serialization
Currently we test our visitors individually, and seperately for input vs. output. This is useful for validating internal representations against the native C types and vice-versa, and other visitor-specific testing, but it doesn't cover the potential use-case of using visitor pairs for serialization/deserialization very well, and makes it hard to easily extend the coverage for different C types / boundary conditions. To cover that we add a set of unit tests that takes a number of native C values, passes them into an output visitor, extracts the values with an input visitor, then compares the result to the original. Plugging in new visitors to the test harness only requires a user to implement the SerializeOps interface and add it to a list. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
committed by
Andreas Färber
parent
4e27e819be
commit
2d49610539
+3
-1
@@ -13,6 +13,7 @@ check-unit-y += tests/test-qmp-commands$(EXESUF)
|
||||
check-unit-y += tests/test-string-input-visitor$(EXESUF)
|
||||
check-unit-y += tests/test-string-output-visitor$(EXESUF)
|
||||
check-unit-y += tests/test-coroutine$(EXESUF)
|
||||
check-unit-y += tests/test-visitor-serialization$(EXESUF)
|
||||
|
||||
check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
|
||||
|
||||
@@ -31,7 +32,7 @@ test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.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 \
|
||||
tests/test-qmp-commands.o
|
||||
tests/test-qmp-commands.o tests/test-visitor-serialization.o
|
||||
|
||||
test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y)
|
||||
test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o
|
||||
@@ -64,6 +65,7 @@ tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-q
|
||||
tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y)
|
||||
tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y)
|
||||
tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y)
|
||||
tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y)
|
||||
|
||||
tests/rtc-test$(EXESUF): tests/rtc-test.o $(trace-obj-y)
|
||||
tests/m48t59-test$(EXESUF): tests/m48t59-test.o $(trace-obj-y)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user