yeahuh / rpms / qemu-kvm

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