xref: /openbmc/qemu/tests/qapi-schema/meson.build (revision 30b5707c)
1test_env = environment()
2test_env.set('PYTHONPATH', meson.source_root() / 'scripts')
3test_env.set('PYTHONIOENCODING', 'utf-8')
4
5schemas = [
6  'alternate-any.json',
7  'alternate-array.json',
8  'alternate-base.json',
9  'alternate-branch-if-invalid.json',
10  'alternate-clash.json',
11  'alternate-conflict-dict.json',
12  'alternate-conflict-enum-bool.json',
13  'alternate-conflict-enum-int.json',
14  'alternate-conflict-string.json',
15  'alternate-conflict-bool-string.json',
16  'alternate-conflict-num-string.json',
17  'alternate-empty.json',
18  'alternate-invalid-dict.json',
19  'alternate-nested.json',
20  'alternate-unknown.json',
21  'args-alternate.json',
22  'args-any.json',
23  'args-array-empty.json',
24  'args-array-unknown.json',
25  'args-bad-boxed.json',
26  'args-boxed-anon.json',
27  'args-boxed-string.json',
28  'args-int.json',
29  'args-invalid.json',
30  'args-member-array-bad.json',
31  'args-member-case.json',
32  'args-member-unknown.json',
33  'args-name-clash.json',
34  'args-union.json',
35  'args-unknown.json',
36  'bad-base.json',
37  'bad-data.json',
38  'bad-ident.json',
39  'bad-if.json',
40  'bad-if-empty.json',
41  'bad-if-empty-list.json',
42  'bad-if-list.json',
43  'bad-type-bool.json',
44  'bad-type-dict.json',
45  'bad-type-int.json',
46  'base-cycle-direct.json',
47  'base-cycle-indirect.json',
48  'command-int.json',
49  'comments.json',
50  'doc-bad-alternate-member.json',
51  'doc-bad-boxed-command-arg.json',
52  'doc-bad-command-arg.json',
53  'doc-bad-enum-member.json',
54  'doc-bad-event-arg.json',
55  'doc-bad-feature.json',
56  'doc-bad-section.json',
57  'doc-bad-symbol.json',
58  'doc-bad-union-member.json',
59  'doc-before-include.json',
60  'doc-before-pragma.json',
61  'doc-duplicated-arg.json',
62  'doc-duplicated-return.json',
63  'doc-duplicated-since.json',
64  'doc-empty-arg.json',
65  'doc-empty-section.json',
66  'doc-empty-symbol.json',
67  'doc-good.json',
68  'doc-interleaved-section.json',
69  'doc-invalid-end.json',
70  'doc-invalid-end2.json',
71  'doc-invalid-return.json',
72  'doc-invalid-section.json',
73  'doc-invalid-start.json',
74  'doc-missing-colon.json',
75  'doc-missing-expr.json',
76  'doc-missing-space.json',
77  'doc-missing.json',
78  'doc-no-symbol.json',
79  'doc-undoc-feature.json',
80  'double-type.json',
81  'duplicate-key.json',
82  'empty.json',
83  'enum-bad-member.json',
84  'enum-bad-name.json',
85  'enum-bad-prefix.json',
86  'enum-clash-member.json',
87  'enum-dict-member-unknown.json',
88  'enum-if-invalid.json',
89  'enum-int-member.json',
90  'enum-member-case.json',
91  'enum-missing-data.json',
92  'enum-wrong-data.json',
93  'event-boxed-empty.json',
94  'event-case.json',
95  'event-member-invalid-dict.json',
96  'event-nest-struct.json',
97  'features-bad-type.json',
98  'features-deprecated-type.json',
99  'features-duplicate-name.json',
100  'features-if-invalid.json',
101  'features-missing-name.json',
102  'features-name-bad-type.json',
103  'features-no-list.json',
104  'features-unknown-key.json',
105  'flat-union-array-branch.json',
106  'flat-union-bad-base.json',
107  'flat-union-bad-discriminator.json',
108  'flat-union-base-any.json',
109  'flat-union-base-union.json',
110  'flat-union-clash-member.json',
111  'flat-union-discriminator-bad-name.json',
112  'flat-union-empty.json',
113  'flat-union-inline.json',
114  'flat-union-inline-invalid-dict.json',
115  'flat-union-int-branch.json',
116  'flat-union-invalid-branch-key.json',
117  'flat-union-invalid-discriminator.json',
118  'flat-union-invalid-if-discriminator.json',
119  'flat-union-no-base.json',
120  'flat-union-optional-discriminator.json',
121  'flat-union-string-discriminator.json',
122  'funny-char.json',
123  'funny-word.json',
124  'ident-with-escape.json',
125  'include-before-err.json',
126  'include-cycle.json',
127  'include-extra-junk.json',
128  'include-nested-err.json',
129  'include-no-file.json',
130  'include-non-file.json',
131  'include-repetition.json',
132  'include-self-cycle.json',
133  'include-simple.json',
134  'indented-expr.json',
135  'leading-comma-list.json',
136  'leading-comma-object.json',
137  'missing-colon.json',
138  'missing-comma-list.json',
139  'missing-comma-object.json',
140  'missing-type.json',
141  'nested-struct-data.json',
142  'nested-struct-data-invalid-dict.json',
143  'non-objects.json',
144  'oob-test.json',
145  'allow-preconfig-test.json',
146  'pragma-doc-required-crap.json',
147  'pragma-extra-junk.json',
148  'pragma-name-case-whitelist-crap.json',
149  'pragma-non-dict.json',
150  'pragma-unknown.json',
151  'pragma-returns-whitelist-crap.json',
152  'qapi-schema-test.json',
153  'quoted-structural-chars.json',
154  'redefined-builtin.json',
155  'redefined-command.json',
156  'redefined-event.json',
157  'redefined-type.json',
158  'reserved-command-q.json',
159  'reserved-enum-q.json',
160  'reserved-member-has.json',
161  'reserved-member-q.json',
162  'reserved-member-u.json',
163  'reserved-member-underscore.json',
164  'reserved-type-kind.json',
165  'reserved-type-list.json',
166  'returns-alternate.json',
167  'returns-array-bad.json',
168  'returns-dict.json',
169  'returns-unknown.json',
170  'returns-whitelist.json',
171  'string-code-point-31.json',
172  'string-code-point-127.json',
173  'struct-base-clash-deep.json',
174  'struct-base-clash.json',
175  'struct-data-invalid.json',
176  'struct-member-if-invalid.json',
177  'struct-member-invalid-dict.json',
178  'struct-member-invalid.json',
179  'trailing-comma-list.json',
180  'trailing-comma-object.json',
181  'type-bypass-bad-gen.json',
182  'unclosed-list.json',
183  'unclosed-object.json',
184  'unclosed-string.json',
185  'union-base-empty.json',
186  'union-base-no-discriminator.json',
187  'union-branch-case.json',
188  'union-branch-if-invalid.json',
189  'union-branch-invalid-dict.json',
190  'union-clash-branches.json',
191  'union-empty.json',
192  'union-invalid-base.json',
193  'union-optional-branch.json',
194  'union-unknown.json',
195  'unknown-escape.json',
196  'unknown-expr-key.json',
197]
198
199# Because people may want to use test-qapi.py from the command line, we
200# are not using the "#! /usr/bin/env python3" trick here.  See
201# docs/devel/build-system.txt
202test('QAPI schema regression tests', python, args: files('test-qapi.py', schemas),
203     env: test_env, suite: ['qapi-schema', 'qapi-frontend'])
204
205diff = find_program('diff')
206
207qapi_doc = custom_target('QAPI doc',
208                         output: ['doc-good-qapi-doc.texi',
209                                  'doc-good-qapi-commands.c', 'doc-good-qapi-commands.h',
210                                  'doc-good-qapi-emit-events.c', 'doc-good-qapi-emit-events.h',
211                                  'doc-good-qapi-events.c', 'doc-good-qapi-events.h',
212                                  'doc-good-qapi-init-commands.c', 'doc-good-qapi-init-commands.h',
213                                  'doc-good-qapi-introspect.c', 'doc-good-qapi-introspect.h',
214                                  'doc-good-qapi-types.c', 'doc-good-qapi-types.h',
215                                  'doc-good-qapi-visit.c', 'doc-good-qapi-visit.h' ],
216                         input: files('doc-good.json'),
217                         command: [ qapi_gen, '-o', meson.current_build_dir(),
218                                    '-p', 'doc-good-', '@INPUT0@' ],
219                         depend_files: qapi_gen_depends)
220
221# "full_path()" needed here to work around
222# https://github.com/mesonbuild/meson/issues/7585
223test('QAPI doc', diff, args: ['-b', '-u', files('doc-good.texi'), qapi_doc[0].full_path()],
224     depends: qapi_doc,
225     suite: ['qapi-schema', 'qapi-doc'])
226