qapi: Add test for nonexistent schema file
This tests the error-return pathway introduced in the previous commit. (Thanks to Paolo for the help with the Meson magic.) Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20210519183951.3946870-3-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
3404e57410
commit
334c3cd58a
@ -199,11 +199,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')
|
||||
|
1
tests/qapi-schema/missing-schema.err
Normal file
1
tests/qapi-schema/missing-schema.err
Normal file
@ -0,0 +1 @@
|
||||
can't read schema file 'missing-schema.json': No such file or directory
|
0
tests/qapi-schema/missing-schema.out
Normal file
0
tests/qapi-schema/missing-schema.out
Normal file
Loading…
Reference in New Issue
Block a user