diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/qapi-schema/meson.build | 9 | ||||
-rw-r--r-- | tests/qapi-schema/missing-array-rsqb.err | 1 | ||||
-rw-r--r-- | tests/qapi-schema/missing-array-rsqb.json | 1 | ||||
-rw-r--r-- | tests/qapi-schema/missing-array-rsqb.out | 0 | ||||
-rw-r--r-- | tests/qapi-schema/missing-object-member-element.err | 1 | ||||
-rw-r--r-- | tests/qapi-schema/missing-object-member-element.json | 1 | ||||
-rw-r--r-- | tests/qapi-schema/missing-object-member-element.out | 0 | ||||
-rw-r--r-- | tests/qapi-schema/missing-schema.err | 1 | ||||
-rw-r--r-- | tests/qapi-schema/missing-schema.out | 0 | ||||
-rw-r--r-- | tests/qapi-schema/non-objects.err | 2 | ||||
-rw-r--r-- | tests/qapi-schema/quoted-structural-chars.err | 2 | ||||
-rwxr-xr-x | tests/qapi-schema/test-qapi.py | 3 |
12 files changed, 15 insertions, 6 deletions
diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index d7163e6601..9e8f658ce3 100644 --- a/tests/qapi-schema/meson.build +++ b/tests/qapi-schema/meson.build @@ -134,9 +134,11 @@ schemas = [ 'indented-expr.json', 'leading-comma-list.json', 'leading-comma-object.json', + 'missing-array-rsqb.json', 'missing-colon.json', 'missing-comma-list.json', 'missing-comma-object.json', + 'missing-object-member-element.json', 'missing-type.json', 'nested-struct-data.json', 'nested-struct-data-invalid-dict.json', @@ -199,11 +201,16 @@ schemas = [ 'unknown-escape.json', 'unknown-expr-key.json', ] +schemas = files(schemas) + +# Intentionally missing schema file test -- not passed through files(): +schemas += [meson.current_source_dir() / 'missing-schema.json'] # Because people may want to use test-qapi.py from the command line, we # are not using the "#! /usr/bin/env python3" trick here. See # docs/devel/build-system.txt -test('QAPI schema regression tests', python, args: files('test-qapi.py', schemas), +test('QAPI schema regression tests', python, + args: files('test-qapi.py') + schemas, env: test_env, suite: ['qapi-schema', 'qapi-frontend']) diff = find_program('diff') diff --git a/tests/qapi-schema/missing-array-rsqb.err b/tests/qapi-schema/missing-array-rsqb.err new file mode 100644 index 0000000000..b5f58b8c12 --- /dev/null +++ b/tests/qapi-schema/missing-array-rsqb.err @@ -0,0 +1 @@ +missing-array-rsqb.json:1:44: expected '{', '[', string, or boolean diff --git a/tests/qapi-schema/missing-array-rsqb.json b/tests/qapi-schema/missing-array-rsqb.json new file mode 100644 index 0000000000..7fca1df923 --- /dev/null +++ b/tests/qapi-schema/missing-array-rsqb.json @@ -0,0 +1 @@ +['Daisy,', 'Daisy,', 'Give me your answer', diff --git a/tests/qapi-schema/missing-array-rsqb.out b/tests/qapi-schema/missing-array-rsqb.out new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/qapi-schema/missing-array-rsqb.out diff --git a/tests/qapi-schema/missing-object-member-element.err b/tests/qapi-schema/missing-object-member-element.err new file mode 100644 index 0000000000..c08a3dc307 --- /dev/null +++ b/tests/qapi-schema/missing-object-member-element.err @@ -0,0 +1 @@ +missing-object-member-element.json:1:8: expected '{', '[', string, or boolean diff --git a/tests/qapi-schema/missing-object-member-element.json b/tests/qapi-schema/missing-object-member-element.json new file mode 100644 index 0000000000..f52d0106f3 --- /dev/null +++ b/tests/qapi-schema/missing-object-member-element.json @@ -0,0 +1 @@ +{'key': diff --git a/tests/qapi-schema/missing-object-member-element.out b/tests/qapi-schema/missing-object-member-element.out new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/qapi-schema/missing-object-member-element.out diff --git a/tests/qapi-schema/missing-schema.err b/tests/qapi-schema/missing-schema.err new file mode 100644 index 0000000000..b4d9ff1fb2 --- /dev/null +++ b/tests/qapi-schema/missing-schema.err @@ -0,0 +1 @@ +can't read schema file 'missing-schema.json': No such file or directory diff --git a/tests/qapi-schema/missing-schema.out b/tests/qapi-schema/missing-schema.out new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/qapi-schema/missing-schema.out diff --git a/tests/qapi-schema/non-objects.err b/tests/qapi-schema/non-objects.err index 3a4ea36966..23bdb69c71 100644 --- a/tests/qapi-schema/non-objects.err +++ b/tests/qapi-schema/non-objects.err @@ -1 +1 @@ -non-objects.json:1:1: expected '{' +non-objects.json:1: top-level expression must be an object diff --git a/tests/qapi-schema/quoted-structural-chars.err b/tests/qapi-schema/quoted-structural-chars.err index 07d1561d1f..af6c1e173d 100644 --- a/tests/qapi-schema/quoted-structural-chars.err +++ b/tests/qapi-schema/quoted-structural-chars.err @@ -1 +1 @@ -quoted-structural-chars.json:1:1: expected '{' +quoted-structural-chars.json:1: top-level expression must be an object diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py index e8db9d09d9..f1c4deb9a5 100755 --- a/tests/qapi-schema/test-qapi.py +++ b/tests/qapi-schema/test-qapi.py @@ -128,9 +128,6 @@ def test_and_diff(test_name, dir_name, update): try: test_frontend(os.path.join(dir_name, test_name + '.json')) except QAPIError as err: - if err.info.fname is None: - print("%s" % err, file=sys.stderr) - return 2 errstr = str(err) + '\n' if dir_name: errstr = errstr.replace(dir_name + '/', '') |