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