Update copyright dates to 2022
[qemu.git] / tests / meson.build
blob94a425d94a3d3310db0165ddc70356b0b0a0b8a5
1 py3 = import('python').find_installation()
3 subdir('bench')
5 test_qapi_outputs = [
6   'qapi-builtin-types.c',
7   'qapi-builtin-types.h',
8   'qapi-builtin-visit.c',
9   'qapi-builtin-visit.h',
10   'test-qapi-commands-sub-sub-module.c',
11   'test-qapi-commands-sub-sub-module.h',
12   'test-qapi-commands.c',
13   'test-qapi-commands.h',
14   'test-qapi-emit-events.c',
15   'test-qapi-emit-events.h',
16   'test-qapi-events-sub-sub-module.c',
17   'test-qapi-events-sub-sub-module.h',
18   'test-qapi-events.c',
19   'test-qapi-events.h',
20   'test-qapi-init-commands.c',
21   'test-qapi-init-commands.h',
22   'test-qapi-introspect.c',
23   'test-qapi-introspect.h',
24   'test-qapi-types-sub-sub-module.c',
25   'test-qapi-types-sub-sub-module.h',
26   'test-qapi-types.c',
27   'test-qapi-types.h',
28   'test-qapi-visit-sub-sub-module.c',
29   'test-qapi-visit-sub-sub-module.h',
30   'test-qapi-visit.c',
31   'test-qapi-visit.h',
34 # Problem: to generate trace events, we'd have to add the .trace-events
35 # file to qapi_trace_events like we do in qapi/meson.build.  Since
36 # qapi_trace_events is used by trace/meson.build, we'd have to move
37 # subdir('tests') above subdir('trace') in the top-level meson.build.
38 # Can't, because it would break the dependency of qga on qemuutil (which
39 # depends on trace_ss).  Not worth solving now; simply suppress trace
40 # event generation instead.
41 test_qapi_files = custom_target('Test QAPI files',
42                                 output: test_qapi_outputs,
43                                 input: files('qapi-schema/qapi-schema-test.json',
44                                              'qapi-schema/include/sub-module.json',
45                                              'qapi-schema/sub-sub-module.json'),
46                                 command: [ qapi_gen, '-o', meson.current_build_dir(),
47                                            '-b', '-p', 'test-', '@INPUT0@',
48                                            '--suppress-tracing' ],
49                                 depend_files: qapi_gen_depends)
51 # meson doesn't like generated output in other directories
52 # perhaps change qapi_gen to replace / with _, like Meson itself does?
53 subdir('include')
55 test_qapi_sources = []
56 test_qapi_headers = []
57 i = 0
58 foreach o: test_qapi_files.to_list() + test_qapi_files_extra.to_list()
59   if o.full_path().endswith('.h')
60     test_qapi_headers += o
61   endif
62   test_qapi_sources += o
63 endforeach
65 libtestqapi = static_library('testqapi', sources: [genh, test_qapi_sources])
66 testqapi = declare_dependency(link_with: libtestqapi, sources: [genh, test_qapi_headers])
68 test_deps = {
69   'test-qht-par': qht_bench,
72 if have_tools and 'CONFIG_VHOST_USER' in config_host and 'CONFIG_LINUX' in config_host
73   executable('vhost-user-bridge',
74              sources: files('vhost-user-bridge.c'),
75              dependencies: [qemuutil, vhost_user])
76 endif
78 test('decodetree', sh,
79      args: [ files('decode/check.sh'), config_host['PYTHON'], files('../scripts/decodetree.py') ],
80      workdir: meson.current_source_dir() / 'decode',
81      suite: 'decodetree')
83 if 'CONFIG_TCG' in config_all
84   subdir('fp')
85 endif
87 if not get_option('tcg').disabled()
88   if 'CONFIG_PLUGIN' in config_host
89     subdir('plugin')
90   endif
91 endif
93 subdir('unit')
94 subdir('qapi-schema')
95 subdir('qtest')
96 subdir('migration')