]> git.proxmox.com Git - mirror_qemu.git/blame - tests/unit/meson.build
Merge tag 'pull-target-arm-20240126' of https://git.linaro.org/people/pmaydell/qemu...
[mirror_qemu.git] / tests / unit / meson.build
CommitLineData
da668aa1
TH
1
2testblock = declare_dependency(dependencies: [block], sources: 'iothread.c')
3
4tests = {
5 'check-block-qdict': [],
6 'check-qdict': [],
7 'check-qnum': [],
8 'check-qstring': [],
9 'check-qlist': [],
10 'check-qnull': [],
11 'check-qobject': [],
12 'check-qjson': [],
13 'check-qlit': [],
6bbee5db 14 'test-error-report': [],
da668aa1
TH
15 'test-qobject-output-visitor': [testqapi],
16 'test-clone-visitor': [testqapi],
17 'test-qobject-input-visitor': [testqapi],
18fa3ebc 18 'test-forward-visitor': [testqapi],
da668aa1
TH
19 'test-string-input-visitor': [testqapi],
20 'test-string-output-visitor': [testqapi],
21 'test-opts-visitor': [testqapi],
22 'test-visitor-serialization': [testqapi],
23 'test-bitmap': [],
71177490 24 'test-resv-mem': [],
af4c26e6
ZL
25 # all code tested by test-x86-topo is inside topology.h
26 'test-x86-topo': [],
da668aa1 27 'test-cutils': [],
02346297 28 'test-div128': [],
da668aa1
TH
29 'test-shift128': [],
30 'test-mul64': [],
31 # all code tested by test-int128 is inside int128.h
32 'test-int128': [],
33 'rcutorture': [],
34 'test-rcu-list': [],
35 'test-rcu-simpleq': [],
36 'test-rcu-tailq': [],
37 'test-rcu-slist': [],
38 'test-qdist': [],
39 'test-qht': [],
e3feb2cc 40 'test-qtree': [],
da668aa1
TH
41 'test-bitops': [],
42 'test-bitcnt': [],
43 'test-qgraph': ['../qtest/libqos/qgraph.c'],
44 'check-qom-interface': [qom],
45 'check-qom-proplist': [qom],
46 'test-qemu-opts': [],
47 'test-keyval': [testqapi],
48 'test-logging': [],
49 'test-uuid': [],
654d6b04 50 'ptimer-test': ['ptimer-test-stubs.c', meson.project_source_root() / 'hw/core/ptimer.c'],
da668aa1 51 'test-qapi-util': [],
0d99d37a 52 'test-interval-tree': [],
3ef7ff83 53 'test-xs-node': [qom],
faefdba8 54 'test-virtio-dmabuf': [meson.project_source_root() / 'hw/display/virtio-dmabuf.c'],
da668aa1
TH
55}
56
57if have_system or have_tools
58 tests += {
59 'test-qmp-event': [testqapi],
60 }
d2ea8dac
DB
61
62 if seccomp.found()
8d7f2e76 63 tests += {'test-seccomp': ['../../system/qemu-seccomp.c', seccomp]}
d2ea8dac 64 endif
da668aa1
TH
65endif
66
67if have_block
68 tests += {
69 'test-coroutine': [testblock],
70 'test-aio': [testblock],
71 'test-aio-multithread': [testblock],
72 'test-throttle': [testblock],
73 'test-thread-pool': [testblock],
74 'test-hbitmap': [testblock],
75 'test-bdrv-drain': [testblock],
76 'test-bdrv-graph-mod': [testblock],
77 'test-blockjob': [testblock],
78 'test-blockjob-txn': [testblock],
79 'test-block-backend': [testblock],
80 'test-block-iothread': [testblock],
81 'test-write-threshold': [testblock],
82 'test-crypto-hash': [crypto],
83 'test-crypto-hmac': [crypto],
84 'test-crypto-cipher': [crypto],
689309c4 85 'test-crypto-akcipher': [crypto],
da668aa1 86 'test-crypto-secret': [crypto, keyutils],
99d423f1 87 'test-crypto-der': [crypto],
da668aa1
TH
88 'test-authz-simple': [authz],
89 'test-authz-list': [authz],
90 'test-authz-listfile': [authz],
91 'test-io-task': [testblock],
92 'test-io-channel-socket': ['socket-helpers.c', 'io-channel-helpers.c', io],
93 'test-io-channel-file': ['io-channel-helpers.c', io],
94 'test-io-channel-command': ['io-channel-helpers.c', io],
95 'test-io-channel-buffer': ['io-channel-helpers.c', io],
87e42764 96 'test-io-channel-null': [io],
da668aa1
TH
97 'test-crypto-ivgen': [io],
98 'test-crypto-afsplit': [io],
99 'test-crypto-block': [io],
100 }
57612511 101 if gnutls.found() and \
ba7ed407 102 tasn1.found() and \
d0cda6f4 103 host_os != 'windows'
da668aa1
TH
104 tests += {
105 'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',
106 tasn1, crypto, gnutls],
107 'test-crypto-tlssession': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c',
108 tasn1, crypto, gnutls],
109 'test-io-channel-tls': ['io-channel-helpers.c', 'crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',
110 tasn1, io, crypto, gnutls]}
111 endif
05e391ae 112 if pam.found()
da668aa1
TH
113 tests += {'test-authz-pam': [authz]}
114 endif
57612511 115 if xts == 'private'
da668aa1
TH
116 tests += {'test-crypto-xts': [crypto, io]}
117 endif
d0cda6f4 118 if host_os != 'windows'
844a12a6
SH
119 tests += {
120 'test-image-locking': [testblock],
121 'test-nested-aio-poll': [testblock],
122 }
da668aa1 123 endif
406523f6 124 if config_host_data.get('CONFIG_REPLICATION')
da668aa1
TH
125 tests += {'test-replication': [testblock]}
126 endif
57612511 127 if nettle.found() or gcrypt.found()
da668aa1
TH
128 tests += {'test-crypto-pbkdf': [io]}
129 endif
da668aa1
TH
130endif
131
132if have_system
133 tests += {
134 'test-iov': [],
135 'test-qmp-cmds': [testqapi],
136 'test-xbzrle': [migration],
137 'test-timed-average': [],
138 'test-util-sockets': ['socket-helpers.c'],
139 'test-base64': [],
140 'test-bufferiszero': [],
62b6323d 141 'test-smp-parse': [qom, meson.project_source_root() / 'hw/core/machine-smp.c'],
d3a0bb77
LS
142 'test-vmstate': [migration, io],
143 'test-yank': ['socket-helpers.c', qom, io, chardev]
da668aa1 144 }
9d30c78c 145 if config_host_data.get('CONFIG_INOTIFY1')
da668aa1
TH
146 tests += {'test-util-filemonitor': []}
147 endif
148
149 # Some tests: test-char, test-qdev-global-props, and test-qga,
150 # are not runnable under TSan due to a known issue.
151 # https://github.com/google/sanitizers/issues/1116
34f983d8 152 if not get_option('tsan')
d0cda6f4 153 if host_os != 'windows'
da668aa1
TH
154 tests += {
155 'test-char': ['socket-helpers.c', qom, io, chardev]
156 }
157 endif
158
159 tests += {
9d587100 160 'test-qdev-global-props': [qom, hwcore]
da668aa1
TH
161 }
162 endif
163endif
164
d0cda6f4 165if have_ga and host_os == 'linux'
c6d3bcb4 166 tests += {'test-qga': ['../qtest/libqmp.c']}
da668aa1
TH
167 test_deps += {'test-qga': qga}
168endif
169
170test_env = environment()
171test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
172test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
173
174slow_tests = {
c45f8f1a 175 'test-aio-multithread' : 120,
e1b363e3 176 'test-crypto-block' : 300,
da668aa1 177 'test-crypto-tlscredsx509': 45,
63b18312
KW
178 'test-crypto-tlssession': 45,
179 'test-replication': 60,
da668aa1
TH
180}
181
182foreach test_name, extra: tests
183 src = [test_name + '.c']
184 deps = [qemuutil]
185 if extra.length() > 0
186 # use a sourceset to quickly separate sources and deps
187 test_ss = ss.source_set()
188 test_ss.add(extra)
189 src += test_ss.all_sources()
190 deps += test_ss.all_dependencies()
191 endif
192 exe = executable(test_name, src, genh, dependencies: deps)
193
194 test(test_name, exe,
195 depends: test_deps.get(test_name, []),
196 env: test_env,
197 args: ['--tap', '-k'],
198 protocol: 'tap',
199 timeout: slow_tests.get(test_name, 30),
200 priority: slow_tests.get(test_name, 30),
201 suite: ['unit'])
202endforeach