From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiBX3-0005nT-1F for qemu-devel@nongnu.org; Wed, 07 May 2014 19:45:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiBWy-0001D5-Nj for qemu-devel@nongnu.org; Wed, 07 May 2014 19:45:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiBWy-0001Cz-Cv for qemu-devel@nongnu.org; Wed, 07 May 2014 19:45:44 -0400 Date: Wed, 7 May 2014 16:44:06 -0400 From: Luiz Capitulino Message-ID: <20140507164406.348d4ce0@redhat.com> In-Reply-To: <87eh05bf60.fsf_-_@fimbulvetr.bsc.es> References: <20140502135218.31383.90270.stgit@fimbulvetr.bsc.es> <20140502135241.31383.48774.stgit@fimbulvetr.bsc.es> <87eh05bf60.fsf_-_@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v12 4/4] qapi: Add a primitive to include other files from a QAPI schema file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TGx1w61z?= Vilanova Cc: =?UTF-8?B?QmVub8OudA==?= Canet , qemu-devel@nongnu.org, Markus Armbruster On Wed, 07 May 2014 20:46:15 +0200 Llu=C3=ADs Vilanova wrote: > The primitive uses JSON syntax, and include paths are relative to the fil= e using the directive: >=20 > { 'include': 'path/to/file.json' } >=20 > Signed-off-by: Llu=C3=ADs Vilanova > Reviewed-by: Eric Blake > Reviewed-by: Markus Armbruster I've replaced the patch and now the tests pass. Thanks Llu=C3=ADs! > --- > docs/qapi-code-gen.txt | 11 +++++ > scripts/qapi.py | 64 ++++++++++++++++++++++= +----- > tests/Makefile | 5 ++ > tests/qapi-schema/include-before-err.err | 1=20 > tests/qapi-schema/include-before-err.exit | 1=20 > tests/qapi-schema/include-before-err.json | 2 + > tests/qapi-schema/include-before-err.out | 0=20 > tests/qapi-schema/include-cycle-b.json | 1=20 > tests/qapi-schema/include-cycle-c.json | 1=20 > tests/qapi-schema/include-cycle.err | 3 + > tests/qapi-schema/include-cycle.exit | 1=20 > tests/qapi-schema/include-cycle.json | 1=20 > tests/qapi-schema/include-cycle.out | 0=20 > tests/qapi-schema/include-format-err.err | 1=20 > tests/qapi-schema/include-format-err.exit | 1=20 > tests/qapi-schema/include-format-err.json | 2 + > tests/qapi-schema/include-format-err.out | 0=20 > tests/qapi-schema/include-nested-err.err | 2 + > tests/qapi-schema/include-nested-err.exit | 1=20 > tests/qapi-schema/include-nested-err.json | 1=20 > tests/qapi-schema/include-nested-err.out | 0=20 > tests/qapi-schema/include-no-file.err | 1=20 > tests/qapi-schema/include-no-file.exit | 1=20 > tests/qapi-schema/include-no-file.json | 1=20 > tests/qapi-schema/include-no-file.out | 0=20 > tests/qapi-schema/include-non-file.err | 1=20 > tests/qapi-schema/include-non-file.exit | 1=20 > tests/qapi-schema/include-non-file.json | 1=20 > tests/qapi-schema/include-non-file.out | 0=20 > tests/qapi-schema/include-relpath-sub.json | 2 + > tests/qapi-schema/include-relpath.err | 0=20 > tests/qapi-schema/include-relpath.exit | 1=20 > tests/qapi-schema/include-relpath.json | 1=20 > tests/qapi-schema/include-relpath.out | 3 + > tests/qapi-schema/include-self-cycle.err | 1=20 > tests/qapi-schema/include-self-cycle.exit | 1=20 > tests/qapi-schema/include-self-cycle.json | 1=20 > tests/qapi-schema/include-self-cycle.out | 0=20 > tests/qapi-schema/include-simple-sub.json | 2 + > tests/qapi-schema/include-simple.err | 0=20 > tests/qapi-schema/include-simple.exit | 1=20 > tests/qapi-schema/include-simple.json | 1=20 > tests/qapi-schema/include-simple.out | 3 + > tests/qapi-schema/include/relpath.json | 1=20 > 44 files changed, 110 insertions(+), 13 deletions(-) > create mode 100644 tests/qapi-schema/include-before-err.err > create mode 100644 tests/qapi-schema/include-before-err.exit > create mode 100644 tests/qapi-schema/include-before-err.json > create mode 100644 tests/qapi-schema/include-before-err.out > create mode 100644 tests/qapi-schema/include-cycle-b.json > create mode 100644 tests/qapi-schema/include-cycle-c.json > create mode 100644 tests/qapi-schema/include-cycle.err > create mode 100644 tests/qapi-schema/include-cycle.exit > create mode 100644 tests/qapi-schema/include-cycle.json > create mode 100644 tests/qapi-schema/include-cycle.out > create mode 100644 tests/qapi-schema/include-format-err.err > create mode 100644 tests/qapi-schema/include-format-err.exit > create mode 100644 tests/qapi-schema/include-format-err.json > create mode 100644 tests/qapi-schema/include-format-err.out > create mode 100644 tests/qapi-schema/include-nested-err.err > create mode 100644 tests/qapi-schema/include-nested-err.exit > create mode 100644 tests/qapi-schema/include-nested-err.json > create mode 100644 tests/qapi-schema/include-nested-err.out > create mode 100644 tests/qapi-schema/include-no-file.err > create mode 100644 tests/qapi-schema/include-no-file.exit > create mode 100644 tests/qapi-schema/include-no-file.json > create mode 100644 tests/qapi-schema/include-no-file.out > create mode 100644 tests/qapi-schema/include-non-file.err > create mode 100644 tests/qapi-schema/include-non-file.exit > create mode 100644 tests/qapi-schema/include-non-file.json > create mode 100644 tests/qapi-schema/include-non-file.out > create mode 100644 tests/qapi-schema/include-relpath-sub.json > create mode 100644 tests/qapi-schema/include-relpath.err > create mode 100644 tests/qapi-schema/include-relpath.exit > create mode 100644 tests/qapi-schema/include-relpath.json > create mode 100644 tests/qapi-schema/include-relpath.out > create mode 100644 tests/qapi-schema/include-self-cycle.err > create mode 100644 tests/qapi-schema/include-self-cycle.exit > create mode 100644 tests/qapi-schema/include-self-cycle.json > create mode 100644 tests/qapi-schema/include-self-cycle.out > create mode 100644 tests/qapi-schema/include-simple-sub.json > create mode 100644 tests/qapi-schema/include-simple.err > create mode 100644 tests/qapi-schema/include-simple.exit > create mode 100644 tests/qapi-schema/include-simple.json > create mode 100644 tests/qapi-schema/include-simple.out > create mode 100644 tests/qapi-schema/include/relpath.json >=20 > diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt > index 63b03cf..051d109 100644 > --- a/docs/qapi-code-gen.txt > +++ b/docs/qapi-code-gen.txt > @@ -40,6 +40,17 @@ enumeration types and union types. > Generally speaking, types definitions should always use CamelCase for th= e type > names. Command names should be all lower case with words separated by a = hyphen. > =20 > + > +=3D=3D=3D Includes =3D=3D=3D > + > +The QAPI schema definitions can be modularized using the 'include' direc= tive: > + > + { 'include': 'path/to/file.json'} > + > +The directive is evaluated recursively, and include paths are relative t= o the > +file using the directive. > + > + > =3D=3D=3D Complex types =3D=3D=3D > =20 > A complex type is a dictionary containing a single key whose value is a > diff --git a/scripts/qapi.py b/scripts/qapi.py > index 07a7a82..ec806aa 100644 > --- a/scripts/qapi.py > +++ b/scripts/qapi.py > @@ -11,6 +11,7 @@ > # This work is licensed under the terms of the GNU GPL, version 2. > # See the COPYING file in the top-level directory. > =20 > +import re > from ordereddict import OrderedDict > import os > import sys > @@ -36,9 +37,17 @@ builtin_type_qtypes =3D { > 'uint64': 'QTYPE_QINT', > } > =20 > +def error_path(parent): > + res =3D "" > + while parent: > + res =3D ("In file included from %s:%d:\n" % (parent['file'], > + parent['line'])) + res > + parent =3D parent['parent'] > + return res > + > class QAPISchemaError(Exception): > def __init__(self, schema, msg): > - self.fp =3D schema.fp > + self.input_file =3D schema.input_file > self.msg =3D msg > self.col =3D 1 > self.line =3D schema.line > @@ -47,23 +56,31 @@ class QAPISchemaError(Exception): > self.col =3D (self.col + 7) % 8 + 1 > else: > self.col +=3D 1 > + self.info =3D schema.parent_info > =20 > def __str__(self): > - return "%s:%s:%s: %s" % (self.fp.name, self.line, self.col, self= .msg) > + return error_path(self.info) + \ > + "%s:%d:%d: %s" % (self.input_file, self.line, self.col, self= .msg) > =20 > class QAPIExprError(Exception): > def __init__(self, expr_info, msg): > - self.fp =3D expr_info['fp'] > - self.line =3D expr_info['line'] > + self.info =3D expr_info > self.msg =3D msg > =20 > def __str__(self): > - return "%s:%s: %s" % (self.fp.name, self.line, self.msg) > + return error_path(self.info['parent']) + \ > + "%s:%d: %s" % (self.info['file'], self.info['line'], self.ms= g) > =20 > class QAPISchema: > =20 > - def __init__(self, fp): > - self.fp =3D fp > + def __init__(self, fp, input_relname=3DNone, include_hist=3D[], pare= nt_info=3DNone): > + input_fname =3D os.path.abspath(fp.name) > + if input_relname is None: > + input_relname =3D fp.name > + self.input_dir =3D os.path.dirname(input_fname) > + self.input_file =3D input_relname > + self.include_hist =3D include_hist + [(input_relname, input_fnam= e)] > + self.parent_info =3D parent_info > self.src =3D fp.read() > if self.src =3D=3D '' or self.src[-1] !=3D '\n': > self.src +=3D '\n' > @@ -74,10 +91,33 @@ class QAPISchema: > self.accept() > =20 > while self.tok !=3D None: > - expr_info =3D {'fp': fp, 'line': self.line} > - expr_elem =3D {'expr': self.get_expr(False), > - 'info': expr_info} > - self.exprs.append(expr_elem) > + expr_info =3D {'file': input_relname, 'line': self.line, 'pa= rent': self.parent_info} > + expr =3D self.get_expr(False) > + if isinstance(expr, dict) and "include" in expr: > + if len(expr) !=3D 1: > + raise QAPIExprError(expr_info, "Invalid 'include' di= rective") > + include =3D expr["include"] > + if not isinstance(include, str): > + raise QAPIExprError(expr_info, > + 'Expected a file name (string), = got: %s' > + % include) > + include_path =3D os.path.join(self.input_dir, include) > + if any(include_path =3D=3D elem[1] > + for elem in self.include_hist): > + raise QAPIExprError(expr_info, "Inclusion loop for %= s" > + % include) > + try: > + fobj =3D open(include_path, 'r') > + except IOError as e: > + raise QAPIExprError(expr_info, > + '%s: %s' % (e.strerror, include)) > + exprs_include =3D QAPISchema(fobj, include, > + self.include_hist, expr_info) > + self.exprs.extend(exprs_include.exprs) > + else: > + expr_elem =3D {'expr': expr, > + 'info': expr_info} > + self.exprs.append(expr_elem) > =20 > def accept(self): > while True: > @@ -267,7 +307,7 @@ def check_exprs(schema): > def parse_schema(input_file): > try: > schema =3D QAPISchema(open(input_file, "r")) > - except QAPISchemaError, e: > + except (QAPISchemaError, QAPIExprError), e: > print >>sys.stderr, e > exit(1) > =20 > diff --git a/tests/Makefile b/tests/Makefile > index 3aa9b0b..409bd24 100644 > --- a/tests/Makefile > +++ b/tests/Makefile > @@ -164,7 +164,10 @@ check-qapi-schema-y :=3D $(addprefix tests/qapi-sche= ma/, \ > duplicate-key.json union-invalid-base.json flat-union-no-base.js= on \ > flat-union-invalid-discriminator.json \ > flat-union-invalid-branch-key.json flat-union-reverse-define.jso= n \ > - flat-union-string-discriminator.json) > + flat-union-string-discriminator.json \ > + include-simple.json include-relpath.json include-format-err.json= \ > + include-non-file.json include-no-file.json include-before-err.js= on \ > + include-nested-err.json include-self-cycle.json include-cycle.js= on) > =20 > GENERATED_HEADERS +=3D tests/test-qapi-types.h tests/test-qapi-visit.h t= ests/test-qmp-commands.h > =20 > diff --git a/tests/qapi-schema/include-before-err.err b/tests/qapi-schema= /include-before-err.err > new file mode 100644 > index 0000000..5565275 > --- /dev/null > +++ b/tests/qapi-schema/include-before-err.err > @@ -0,0 +1 @@ > +tests/qapi-schema/include-before-err.json:2:13: Expected ":" > diff --git a/tests/qapi-schema/include-before-err.exit b/tests/qapi-schem= a/include-before-err.exit > new file mode 100644 > index 0000000..d00491f > --- /dev/null > +++ b/tests/qapi-schema/include-before-err.exit > @@ -0,0 +1 @@ > +1 > diff --git a/tests/qapi-schema/include-before-err.json b/tests/qapi-schem= a/include-before-err.json > new file mode 100644 > index 0000000..afb6cb6 > --- /dev/null > +++ b/tests/qapi-schema/include-before-err.json > @@ -0,0 +1,2 @@ > +{ 'include': 'include-simple-sub.json' } > +{ 'command' 'missing-colon' } > diff --git a/tests/qapi-schema/include-before-err.out b/tests/qapi-schema= /include-before-err.out > new file mode 100644 > index 0000000..e69de29 > diff --git a/tests/qapi-schema/include-cycle-b.json b/tests/qapi-schema/i= nclude-cycle-b.json > new file mode 100644 > index 0000000..4fa985d > --- /dev/null > +++ b/tests/qapi-schema/include-cycle-b.json > @@ -0,0 +1 @@ > +{ 'include': 'include-cycle-c.json' } > diff --git a/tests/qapi-schema/include-cycle-c.json b/tests/qapi-schema/i= nclude-cycle-c.json > new file mode 100644 > index 0000000..d12b592 > --- /dev/null > +++ b/tests/qapi-schema/include-cycle-c.json > @@ -0,0 +1 @@ > +{ 'include': 'include-cycle.json' } > diff --git a/tests/qapi-schema/include-cycle.err b/tests/qapi-schema/incl= ude-cycle.err > new file mode 100644 > index 0000000..602cf62 > --- /dev/null > +++ b/tests/qapi-schema/include-cycle.err > @@ -0,0 +1,3 @@ > +In file included from tests/qapi-schema/include-cycle.json:1: > +In file included from include-cycle-b.json:1: > +include-cycle-c.json:1: Inclusion loop for include-cycle.json > diff --git a/tests/qapi-schema/include-cycle.exit b/tests/qapi-schema/inc= lude-cycle.exit > new file mode 100644 > index 0000000..d00491f > --- /dev/null > +++ b/tests/qapi-schema/include-cycle.exit > @@ -0,0 +1 @@ > +1 > diff --git a/tests/qapi-schema/include-cycle.json b/tests/qapi-schema/inc= lude-cycle.json > new file mode 100644 > index 0000000..6fcf1eb > --- /dev/null > +++ b/tests/qapi-schema/include-cycle.json > @@ -0,0 +1 @@ > +{ 'include': 'include-cycle-b.json' } > diff --git a/tests/qapi-schema/include-cycle.out b/tests/qapi-schema/incl= ude-cycle.out > new file mode 100644 > index 0000000..e69de29 > diff --git a/tests/qapi-schema/include-format-err.err b/tests/qapi-schema= /include-format-err.err > new file mode 100644 > index 0000000..721ff4e > --- /dev/null > +++ b/tests/qapi-schema/include-format-err.err > @@ -0,0 +1 @@ > +tests/qapi-schema/include-format-err.json:1: Invalid 'include' directive > diff --git a/tests/qapi-schema/include-format-err.exit b/tests/qapi-schem= a/include-format-err.exit > new file mode 100644 > index 0000000..d00491f > --- /dev/null > +++ b/tests/qapi-schema/include-format-err.exit > @@ -0,0 +1 @@ > +1 > diff --git a/tests/qapi-schema/include-format-err.json b/tests/qapi-schem= a/include-format-err.json > new file mode 100644 > index 0000000..44980f0 > --- /dev/null > +++ b/tests/qapi-schema/include-format-err.json > @@ -0,0 +1,2 @@ > +{ 'include': 'include-simple-sub.json', > + 'foo': 'bar' } > diff --git a/tests/qapi-schema/include-format-err.out b/tests/qapi-schema= /include-format-err.out > new file mode 100644 > index 0000000..e69de29 > diff --git a/tests/qapi-schema/include-nested-err.err b/tests/qapi-schema= /include-nested-err.err > new file mode 100644 > index 0000000..1dacbda > --- /dev/null > +++ b/tests/qapi-schema/include-nested-err.err > @@ -0,0 +1,2 @@ > +In file included from tests/qapi-schema/include-nested-err.json:1: > +missing-colon.json:1:10: Expected ":" > diff --git a/tests/qapi-schema/include-nested-err.exit b/tests/qapi-schem= a/include-nested-err.exit > new file mode 100644 > index 0000000..d00491f > --- /dev/null > +++ b/tests/qapi-schema/include-nested-err.exit > @@ -0,0 +1 @@ > +1 > diff --git a/tests/qapi-schema/include-nested-err.json b/tests/qapi-schem= a/include-nested-err.json > new file mode 100644 > index 0000000..5631e56 > --- /dev/null > +++ b/tests/qapi-schema/include-nested-err.json > @@ -0,0 +1 @@ > +{ 'include': 'missing-colon.json' } > diff --git a/tests/qapi-schema/include-nested-err.out b/tests/qapi-schema= /include-nested-err.out > new file mode 100644 > index 0000000..e69de29 > diff --git a/tests/qapi-schema/include-no-file.err b/tests/qapi-schema/in= clude-no-file.err > new file mode 100644 > index 0000000..d5b9b22 > --- /dev/null > +++ b/tests/qapi-schema/include-no-file.err > @@ -0,0 +1 @@ > +tests/qapi-schema/include-no-file.json:1: No such file or directory: inc= lude-no-file-sub.json > diff --git a/tests/qapi-schema/include-no-file.exit b/tests/qapi-schema/i= nclude-no-file.exit > new file mode 100644 > index 0000000..d00491f > --- /dev/null > +++ b/tests/qapi-schema/include-no-file.exit > @@ -0,0 +1 @@ > +1 > diff --git a/tests/qapi-schema/include-no-file.json b/tests/qapi-schema/i= nclude-no-file.json > new file mode 100644 > index 0000000..9249ebd > --- /dev/null > +++ b/tests/qapi-schema/include-no-file.json > @@ -0,0 +1 @@ > +{ 'include': 'include-no-file-sub.json' } > diff --git a/tests/qapi-schema/include-no-file.out b/tests/qapi-schema/in= clude-no-file.out > new file mode 100644 > index 0000000..e69de29 > diff --git a/tests/qapi-schema/include-non-file.err b/tests/qapi-schema/i= nclude-non-file.err > new file mode 100644 > index 0000000..9658c78 > --- /dev/null > +++ b/tests/qapi-schema/include-non-file.err > @@ -0,0 +1 @@ > +tests/qapi-schema/include-non-file.json:1: Expected a file name (string)= , got: ['foo', 'bar'] > diff --git a/tests/qapi-schema/include-non-file.exit b/tests/qapi-schema/= include-non-file.exit > new file mode 100644 > index 0000000..d00491f > --- /dev/null > +++ b/tests/qapi-schema/include-non-file.exit > @@ -0,0 +1 @@ > +1 > diff --git a/tests/qapi-schema/include-non-file.json b/tests/qapi-schema/= include-non-file.json > new file mode 100644 > index 0000000..cd43c3f > --- /dev/null > +++ b/tests/qapi-schema/include-non-file.json > @@ -0,0 +1 @@ > +{ 'include': [ 'foo', 'bar' ] } > diff --git a/tests/qapi-schema/include-non-file.out b/tests/qapi-schema/i= nclude-non-file.out > new file mode 100644 > index 0000000..e69de29 > diff --git a/tests/qapi-schema/include-relpath-sub.json b/tests/qapi-sche= ma/include-relpath-sub.json > new file mode 100644 > index 0000000..4bd4af4 > --- /dev/null > +++ b/tests/qapi-schema/include-relpath-sub.json > @@ -0,0 +1,2 @@ > +{ 'enum': 'Status', > + 'data': [ 'good', 'bad', 'ugly' ] } > diff --git a/tests/qapi-schema/include-relpath.err b/tests/qapi-schema/in= clude-relpath.err > new file mode 100644 > index 0000000..e69de29 > diff --git a/tests/qapi-schema/include-relpath.exit b/tests/qapi-schema/i= nclude-relpath.exit > new file mode 100644 > index 0000000..573541a > --- /dev/null > +++ b/tests/qapi-schema/include-relpath.exit > @@ -0,0 +1 @@ > +0 > diff --git a/tests/qapi-schema/include-relpath.json b/tests/qapi-schema/i= nclude-relpath.json > new file mode 100644 > index 0000000..05018f3 > --- /dev/null > +++ b/tests/qapi-schema/include-relpath.json > @@ -0,0 +1 @@ > +{ 'include': 'include/relpath.json' } > diff --git a/tests/qapi-schema/include-relpath.out b/tests/qapi-schema/in= clude-relpath.out > new file mode 100644 > index 0000000..4ce3dcf > --- /dev/null > +++ b/tests/qapi-schema/include-relpath.out > @@ -0,0 +1,3 @@ > +[OrderedDict([('enum', 'Status'), ('data', ['good', 'bad', 'ugly'])])] > +[{'enum_name': 'Status', 'enum_values': ['good', 'bad', 'ugly']}] > +[] > diff --git a/tests/qapi-schema/include-self-cycle.err b/tests/qapi-schema= /include-self-cycle.err > new file mode 100644 > index 0000000..981742a > --- /dev/null > +++ b/tests/qapi-schema/include-self-cycle.err > @@ -0,0 +1 @@ > +tests/qapi-schema/include-self-cycle.json:1: Inclusion loop for include-= self-cycle.json > diff --git a/tests/qapi-schema/include-self-cycle.exit b/tests/qapi-schem= a/include-self-cycle.exit > new file mode 100644 > index 0000000..d00491f > --- /dev/null > +++ b/tests/qapi-schema/include-self-cycle.exit > @@ -0,0 +1 @@ > +1 > diff --git a/tests/qapi-schema/include-self-cycle.json b/tests/qapi-schem= a/include-self-cycle.json > new file mode 100644 > index 0000000..55fb1b5 > --- /dev/null > +++ b/tests/qapi-schema/include-self-cycle.json > @@ -0,0 +1 @@ > +{ 'include': 'include-self-cycle.json' } > diff --git a/tests/qapi-schema/include-self-cycle.out b/tests/qapi-schema= /include-self-cycle.out > new file mode 100644 > index 0000000..e69de29 > diff --git a/tests/qapi-schema/include-simple-sub.json b/tests/qapi-schem= a/include-simple-sub.json > new file mode 100644 > index 0000000..4bd4af4 > --- /dev/null > +++ b/tests/qapi-schema/include-simple-sub.json > @@ -0,0 +1,2 @@ > +{ 'enum': 'Status', > + 'data': [ 'good', 'bad', 'ugly' ] } > diff --git a/tests/qapi-schema/include-simple.err b/tests/qapi-schema/inc= lude-simple.err > new file mode 100644 > index 0000000..e69de29 > diff --git a/tests/qapi-schema/include-simple.exit b/tests/qapi-schema/in= clude-simple.exit > new file mode 100644 > index 0000000..573541a > --- /dev/null > +++ b/tests/qapi-schema/include-simple.exit > @@ -0,0 +1 @@ > +0 > diff --git a/tests/qapi-schema/include-simple.json b/tests/qapi-schema/in= clude-simple.json > new file mode 100644 > index 0000000..1dd391a > --- /dev/null > +++ b/tests/qapi-schema/include-simple.json > @@ -0,0 +1 @@ > +{ 'include': 'include-simple-sub.json' } > diff --git a/tests/qapi-schema/include-simple.out b/tests/qapi-schema/inc= lude-simple.out > new file mode 100644 > index 0000000..4ce3dcf > --- /dev/null > +++ b/tests/qapi-schema/include-simple.out > @@ -0,0 +1,3 @@ > +[OrderedDict([('enum', 'Status'), ('data', ['good', 'bad', 'ugly'])])] > +[{'enum_name': 'Status', 'enum_values': ['good', 'bad', 'ugly']}] > +[] > diff --git a/tests/qapi-schema/include/relpath.json b/tests/qapi-schema/i= nclude/relpath.json > new file mode 100644 > index 0000000..45dee24 > --- /dev/null > +++ b/tests/qapi-schema/include/relpath.json > @@ -0,0 +1 @@ > +{ 'include': '../include-relpath-sub.json' } >=20 >=20