aboutsummaryrefslogtreecommitdiff
path: root/tests/meson.build
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2020-08-28 15:07:19 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-09-08 07:17:09 +0200
commit37e2777670dcf25f65929a871f246c6c012d8b03 (patch)
tree63cf35cd4ead7cfea67e81de1a6cff71512b54ca /tests/meson.build
parentc138156ba55cd7e1b8b45a0e49f62f97d92a9e64 (diff)
meson: build qapi tests library
- builds QAPI builtins types/visitor to fix a linking issue with unresolved symbols in the static library. - work around a meson limitation on generated file output directories. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200828110734.1638685-2-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/meson.build')
-rw-r--r--tests/meson.build45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/meson.build b/tests/meson.build
index fe2c6d8e6b..ab09a8d845 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,3 +1,48 @@
+test_qapi_outputs = [
+ 'qapi-builtin-types.c',
+ 'qapi-builtin-types.h',
+ 'qapi-builtin-visit.c',
+ 'qapi-builtin-visit.h',
+ 'test-qapi-commands-sub-sub-module.c',
+ 'test-qapi-commands-sub-sub-module.h',
+ 'test-qapi-commands.c',
+ 'test-qapi-commands.h',
+ 'test-qapi-emit-events.c',
+ 'test-qapi-emit-events.h',
+ 'test-qapi-events-sub-sub-module.c',
+ 'test-qapi-events-sub-sub-module.h',
+ 'test-qapi-events.c',
+ 'test-qapi-events.h',
+ 'test-qapi-init-commands.c',
+ 'test-qapi-init-commands.h',
+ 'test-qapi-introspect.c',
+ 'test-qapi-introspect.h',
+ 'test-qapi-types-sub-sub-module.c',
+ 'test-qapi-types-sub-sub-module.h',
+ 'test-qapi-types.c',
+ 'test-qapi-types.h',
+ 'test-qapi-visit-sub-sub-module.c',
+ 'test-qapi-visit-sub-sub-module.h',
+ 'test-qapi-visit.c',
+ 'test-qapi-visit.h',
+]
+
+test_qapi_files = custom_target('Test QAPI files',
+ output: test_qapi_outputs,
+ input: files('qapi-schema/qapi-schema-test.json',
+ 'qapi-schema/include/sub-module.json',
+ 'qapi-schema/sub-sub-module.json'),
+ command: [ qapi_gen, '-o', meson.current_build_dir(),
+ '-b', '-p', 'test-', '@INPUT0@' ],
+ depend_files: qapi_gen_depends)
+
+# meson doesn't like generated output in other directories
+# perhaps change qapi_gen to replace / with _, like Meson itself does?
+subdir('include')
+
+libtestqapi = static_library('testqapi', sources: [test_qapi_files, test_qapi_outputs_extra])
+testqapi = declare_dependency(link_with: libtestqapi)
+
if have_system and 'CONFIG_POSIX' in config_host
subdir('qemu-iotests')
endif