[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 05/14] qapi: add some expr tests
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH v2 05/14] qapi: add some expr tests |
Date: |
Tue, 5 Aug 2014 16:38:57 -0600 |
Demonstrate that the qapi generator doesn't deal well with
expressions that aren't up to par. Later patches will improve
the expected results as the generator is made stricter.
* tests/qapi-schema/missing-type.*: New files.
* tests/qapi-schema/double-type.*: Likewise.
* tests/Makefile (check-qapi-schema-y): Run them.
Signed-off-by: Eric Blake <address@hidden>
---
tests/Makefile | 1 +
tests/qapi-schema/double-type.err | 0
tests/qapi-schema/double-type.exit | 1 +
tests/qapi-schema/double-type.json | 1 +
tests/qapi-schema/double-type.out | 3 +++
tests/qapi-schema/missing-type.err | 0
tests/qapi-schema/missing-type.exit | 1 +
tests/qapi-schema/missing-type.json | 1 +
tests/qapi-schema/missing-type.out | 3 +++
9 files changed, 11 insertions(+)
create mode 100644 tests/qapi-schema/double-type.err
create mode 100644 tests/qapi-schema/double-type.exit
create mode 100644 tests/qapi-schema/double-type.json
create mode 100644 tests/qapi-schema/double-type.out
create mode 100644 tests/qapi-schema/missing-type.err
create mode 100644 tests/qapi-schema/missing-type.exit
create mode 100644 tests/qapi-schema/missing-type.json
create mode 100644 tests/qapi-schema/missing-type.out
diff --git a/tests/Makefile b/tests/Makefile
index fbf6909..1b0c96f 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -192,6 +192,7 @@ $(foreach target,$(SYSEMU_TARGET_LIST), \
check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
comments.json empty.json enum-empty.json enum-missing-data.json \
enum-wrong-data.json funny-char.json indented-expr.json \
+ missing-type.json double-type.json \
missing-colon.json missing-comma-list.json \
missing-comma-object.json non-objects.json \
qapi-schema-test.json quoted-structural-chars.json \
diff --git a/tests/qapi-schema/double-type.err
b/tests/qapi-schema/double-type.err
new file mode 100644
index 0000000..e69de29
diff --git a/tests/qapi-schema/double-type.exit
b/tests/qapi-schema/double-type.exit
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/tests/qapi-schema/double-type.exit
@@ -0,0 +1 @@
+0
diff --git a/tests/qapi-schema/double-type.json
b/tests/qapi-schema/double-type.json
new file mode 100644
index 0000000..2d4d97d
--- /dev/null
+++ b/tests/qapi-schema/double-type.json
@@ -0,0 +1 @@
+{ 'command': 'foo', 'type': 'bar', 'data': { } }
diff --git a/tests/qapi-schema/double-type.out
b/tests/qapi-schema/double-type.out
new file mode 100644
index 0000000..3e244f5
--- /dev/null
+++ b/tests/qapi-schema/double-type.out
@@ -0,0 +1,3 @@
+[OrderedDict([('command', 'foo'), ('type', 'bar'), ('data', OrderedDict())])]
+[]
+[OrderedDict([('command', 'foo'), ('type', 'bar'), ('data', OrderedDict())])]
diff --git a/tests/qapi-schema/missing-type.err
b/tests/qapi-schema/missing-type.err
new file mode 100644
index 0000000..e69de29
diff --git a/tests/qapi-schema/missing-type.exit
b/tests/qapi-schema/missing-type.exit
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/tests/qapi-schema/missing-type.exit
@@ -0,0 +1 @@
+0
diff --git a/tests/qapi-schema/missing-type.json
b/tests/qapi-schema/missing-type.json
new file mode 100644
index 0000000..9043aa4
--- /dev/null
+++ b/tests/qapi-schema/missing-type.json
@@ -0,0 +1 @@
+{ 'data': { } }
diff --git a/tests/qapi-schema/missing-type.out
b/tests/qapi-schema/missing-type.out
new file mode 100644
index 0000000..67fd4fa
--- /dev/null
+++ b/tests/qapi-schema/missing-type.out
@@ -0,0 +1,3 @@
+[OrderedDict([('data', OrderedDict())])]
+[]
+[]
--
1.9.3
- Re: [Qemu-devel] [PATCH v2 03/14] qapi: add some enum tests, (continued)
- [Qemu-devel] [PATCH v2 01/14] qapi: consistent whitespace in tests/Makefile, Eric Blake, 2014/08/05
- [Qemu-devel] [PATCH v2 04/14] qapi: better error message for bad enum, Eric Blake, 2014/08/05
- [Qemu-devel] [PATCH v2 08/14] qapi: add expr_name() helper, Eric Blake, 2014/08/05
- [Qemu-devel] [PATCH v2 06/14] qapi: require valid expressions, Eric Blake, 2014/08/05
- [Qemu-devel] [PATCH v2 02/14] qapi: ignore files created during make check, Eric Blake, 2014/08/05
- [Qemu-devel] [PATCH v2 09/14] qapi: add check_type helper function, Eric Blake, 2014/08/05
- [Qemu-devel] [PATCH v2 10/14] qapi: merge UserDefTwo and UserDefNested in tests, Eric Blake, 2014/08/05
- [Qemu-devel] [PATCH v2 07/14] qapi: add some type check tests, Eric Blake, 2014/08/05
- [Qemu-devel] [PATCH v2 05/14] qapi: add some expr tests,
Eric Blake <=
- [Qemu-devel] [PATCH v2 11/14] target-arm: Add FAR_EL2 and 3, Eric Blake, 2014/08/05
- [Qemu-devel] [PATCH v2 12/14] target-arm: Fix bit test in sp_el0_access, Eric Blake, 2014/08/05
- [Qemu-devel] [PATCH v2 13/14] target-arm: don't hardcode mask values in arm_cpu_handle_mmu_fault, Eric Blake, 2014/08/05
- [Qemu-devel] [PATCH v2 14/14] target-arm: A64: fix TLB flush instructions, Eric Blake, 2014/08/05
- Re: [Qemu-devel] [PATCH v2 00/14] drop qapi nested structs, Eric Blake, 2014/08/05