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