Blame SOURCES/kvm-tests-Use-qapi-schema-test.json-as-schema-parser-tes.patch

0a122b
From 1c4e0e685b539c2ee15d88922a88c9b9998ba8c1 Mon Sep 17 00:00:00 2001
0a122b
Message-Id: <1c4e0e685b539c2ee15d88922a88c9b9998ba8c1.1387369730.git.minovotn@redhat.com>
0a122b
In-Reply-To: <091eecc4fa42754760dfff393dabcc2b444e9693.1387369730.git.minovotn@redhat.com>
0a122b
References: <091eecc4fa42754760dfff393dabcc2b444e9693.1387369730.git.minovotn@redhat.com>
0a122b
From: Markus Armbruster <armbru@redhat.com>
0a122b
Date: Tue, 10 Dec 2013 15:29:12 +0100
0a122b
Subject: [PATCH 12/21] tests: Use qapi-schema-test.json as schema parser test
0a122b
0a122b
RH-Author: Markus Armbruster <armbru@redhat.com>
0a122b
Message-id: <1386689361-30281-10-git-send-email-armbru@redhat.com>
0a122b
Patchwork-id: 56137
0a122b
O-Subject: [PATCH 7.0 qemu-kvm 09/18] tests: Use qapi-schema-test.json as schema parser test
0a122b
Bugzilla: 997915
0a122b
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
0a122b
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
0a122b
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
0a122b
0a122b
From: Markus Armbruster <armbru@redhat.com>
0a122b
0a122b
Signed-off-by: Markus Armbruster <armbru@redhat.com>
0a122b
Reviewed-by: Eric Blake <eblake@redhat.com>
0a122b
Message-id: 1374939721-7876-3-git-send-email-armbru@redhat.com
0a122b
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
0a122b
(cherry picked from commit 4f193e34c6c41abdd06c134e584312077def2bda)
0a122b
---
0a122b
 tests/Makefile                                        |  8 ++++----
0a122b
 tests/qapi-schema/qapi-schema-test.err                |  0
0a122b
 tests/qapi-schema/qapi-schema-test.exit               |  1 +
0a122b
 .../qapi-schema/qapi-schema-test.json                 |  0
0a122b
 tests/qapi-schema/qapi-schema-test.out                | 19 +++++++++++++++++++
0a122b
 5 files changed, 24 insertions(+), 4 deletions(-)
0a122b
 create mode 100644 tests/qapi-schema/qapi-schema-test.err
0a122b
 create mode 100644 tests/qapi-schema/qapi-schema-test.exit
0a122b
 rename qapi-schema-test.json => tests/qapi-schema/qapi-schema-test.json (100%)
0a122b
 create mode 100644 tests/qapi-schema/qapi-schema-test.out
0a122b
0a122b
diff --git a/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json
0a122b
similarity index 100%
0a122b
rename from qapi-schema-test.json
0a122b
rename to tests/qapi-schema/qapi-schema-test.json
0a122b
0a122b
Signed-off-by: Michal Novotny <minovotn@redhat.com>
0a122b
---
0a122b
 tests/Makefile                          |  8 ++++----
0a122b
 tests/qapi-schema/qapi-schema-test.exit |  1 +
0a122b
 tests/qapi-schema/qapi-schema-test.out  | 19 +++++++++++++++++++
0a122b
 3 files changed, 24 insertions(+), 4 deletions(-)
0a122b
 create mode 100644 tests/qapi-schema/qapi-schema-test.err
0a122b
 create mode 100644 tests/qapi-schema/qapi-schema-test.exit
0a122b
 create mode 100644 tests/qapi-schema/qapi-schema-test.out
0a122b
0a122b
diff --git a/tests/Makefile b/tests/Makefile
0a122b
index e96982b..a38f360 100644
0a122b
--- a/tests/Makefile
0a122b
+++ b/tests/Makefile
0a122b
@@ -74,7 +74,7 @@ check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
0a122b
         comments.json empty.json funny-char.json indented-expr.json \
0a122b
         missing-colon.json missing-comma-list.json \
0a122b
         missing-comma-object.json non-objects.json \
0a122b
-        quoted-structural-chars.json \
0a122b
+        qapi-schema-test.json quoted-structural-chars.json \
0a122b
         trailing-comma-list.json trailing-comma-object.json \
0a122b
         unclosed-list.json unclosed-object.json unclosed-string.json)
0a122b
 
0a122b
@@ -111,13 +111,13 @@ tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o xbzrle.o page_cache.o libqemuuti
0a122b
 tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o
0a122b
 
0a122b
 tests/test-qapi-types.c tests/test-qapi-types.h :\
0a122b
-$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
0a122b
+$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
0a122b
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o tests -p "test-" < $<, "  GEN   $@")
0a122b
 tests/test-qapi-visit.c tests/test-qapi-visit.h :\
0a122b
-$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
0a122b
+$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
0a122b
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o tests -p "test-" < $<, "  GEN   $@")
0a122b
 tests/test-qmp-commands.h tests/test-qmp-marshal.c :\
0a122b
-$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
0a122b
+$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
0a122b
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o tests -p "test-" < $<, "  GEN   $@")
0a122b
 
0a122b
 tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
0a122b
diff --git a/tests/qapi-schema/qapi-schema-test.err b/tests/qapi-schema/qapi-schema-test.err
0a122b
new file mode 100644
0a122b
index 0000000..e69de29
0a122b
diff --git a/tests/qapi-schema/qapi-schema-test.exit b/tests/qapi-schema/qapi-schema-test.exit
0a122b
new file mode 100644
0a122b
index 0000000..573541a
0a122b
--- /dev/null
0a122b
+++ b/tests/qapi-schema/qapi-schema-test.exit
0a122b
@@ -0,0 +1 @@
0a122b
+0
0a122b
diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out
0a122b
new file mode 100644
0a122b
index 0000000..fb00344
0a122b
--- /dev/null
0a122b
+++ b/tests/qapi-schema/qapi-schema-test.out
0a122b
@@ -0,0 +1,19 @@
0a122b
+[OrderedDict([('enum', 'EnumOne'), ('data', ['value1', 'value2', 'value3'])]),
0a122b
+ OrderedDict([('type', 'NestedEnumsOne'), ('data', OrderedDict([('enum1', 'EnumOne'), ('*enum2', 'EnumOne'), ('enum3', 'EnumOne'), ('*enum4', 'EnumOne')]))]),
0a122b
+ OrderedDict([('type', 'UserDefOne'), ('data', OrderedDict([('integer', 'int'), ('string', 'str'), ('*enum1', 'EnumOne')]))]),
0a122b
+ OrderedDict([('type', 'UserDefTwo'), ('data', OrderedDict([('string', 'str'), ('dict', OrderedDict([('string', 'str'), ('dict', OrderedDict([('userdef', 'UserDefOne'), ('string', 'str')])), ('*dict2', OrderedDict([('userdef', 'UserDefOne'), ('string', 'str')]))]))]))]),
0a122b
+ OrderedDict([('type', 'UserDefNested'), ('data', OrderedDict([('string0', 'str'), ('dict1', OrderedDict([('string1', 'str'), ('dict2', OrderedDict([('userdef1', 'UserDefOne'), ('string2', 'str')])), ('*dict3', OrderedDict([('userdef2', 'UserDefOne'), ('string3', 'str')]))]))]))]),
0a122b
+ OrderedDict([('type', 'UserDefA'), ('data', OrderedDict([('boolean', 'bool')]))]),
0a122b
+ OrderedDict([('type', 'UserDefB'), ('data', OrderedDict([('integer', 'int')]))]),
0a122b
+ OrderedDict([('union', 'UserDefUnion'), ('data', OrderedDict([('a', 'UserDefA'), ('b', 'UserDefB')]))]),
0a122b
+ OrderedDict([('union', 'UserDefNativeListUnion'), ('data', OrderedDict([('integer', ['int']), ('s8', ['int8']), ('s16', ['int16']), ('s32', ['int32']), ('s64', ['int64']), ('u8', ['uint8']), ('u16', ['uint16']), ('u32', ['uint32']), ('u64', ['uint64']), ('number', ['number']), ('boolean', ['bool']), ('string', ['str'])]))]),
0a122b
+ OrderedDict([('command', 'user_def_cmd'), ('data', OrderedDict())]),
0a122b
+ OrderedDict([('command', 'user_def_cmd1'), ('data', OrderedDict([('ud1a', 'UserDefOne')]))]),
0a122b
+ OrderedDict([('command', 'user_def_cmd2'), ('data', OrderedDict([('ud1a', 'UserDefOne'), ('ud1b', 'UserDefOne')])), ('returns', 'UserDefTwo')])]
0a122b
+['EnumOne', 'UserDefUnionKind', 'UserDefNativeListUnionKind']
0a122b
+[OrderedDict([('type', 'NestedEnumsOne'), ('data', OrderedDict([('enum1', 'EnumOne'), ('*enum2', 'EnumOne'), ('enum3', 'EnumOne'), ('*enum4', 'EnumOne')]))]),
0a122b
+ OrderedDict([('type', 'UserDefOne'), ('data', OrderedDict([('integer', 'int'), ('string', 'str'), ('*enum1', 'EnumOne')]))]),
0a122b
+ OrderedDict([('type', 'UserDefTwo'), ('data', OrderedDict([('string', 'str'), ('dict', OrderedDict([('string', 'str'), ('dict', OrderedDict([('userdef', 'UserDefOne'), ('string', 'str')])), ('*dict2', OrderedDict([('userdef', 'UserDefOne'), ('string', 'str')]))]))]))]),
0a122b
+ OrderedDict([('type', 'UserDefNested'), ('data', OrderedDict([('string0', 'str'), ('dict1', OrderedDict([('string1', 'str'), ('dict2', OrderedDict([('userdef1', 'UserDefOne'), ('string2', 'str')])), ('*dict3', OrderedDict([('userdef2', 'UserDefOne'), ('string3', 'str')]))]))]))]),
0a122b
+ OrderedDict([('type', 'UserDefA'), ('data', OrderedDict([('boolean', 'bool')]))]),
0a122b
+ OrderedDict([('type', 'UserDefB'), ('data', OrderedDict([('integer', 'int')]))])]
0a122b
-- 
0a122b
1.7.11.7
0a122b