2021-03-10 09:33:14 +03:00
|
|
|
|
|
|
|
testblock = declare_dependency(dependencies: [block], sources: 'iothread.c')
|
|
|
|
|
|
|
|
tests = {
|
|
|
|
'check-block-qdict': [],
|
|
|
|
'check-qdict': [],
|
|
|
|
'check-qnum': [],
|
|
|
|
'check-qstring': [],
|
|
|
|
'check-qlist': [],
|
|
|
|
'check-qnull': [],
|
|
|
|
'check-qobject': [],
|
|
|
|
'check-qjson': [],
|
|
|
|
'check-qlit': [],
|
2023-02-21 15:47:49 +03:00
|
|
|
'test-error-report': [],
|
2021-03-10 09:33:14 +03:00
|
|
|
'test-qobject-output-visitor': [testqapi],
|
|
|
|
'test-clone-visitor': [testqapi],
|
|
|
|
'test-qobject-input-visitor': [testqapi],
|
2021-07-18 09:49:22 +03:00
|
|
|
'test-forward-visitor': [testqapi],
|
2021-03-10 09:33:14 +03:00
|
|
|
'test-string-input-visitor': [testqapi],
|
|
|
|
'test-string-output-visitor': [testqapi],
|
|
|
|
'test-visitor-serialization': [testqapi],
|
|
|
|
'test-bitmap': [],
|
2023-10-19 16:45:18 +03:00
|
|
|
'test-resv-mem': [],
|
2023-10-24 12:03:05 +03:00
|
|
|
# all code tested by test-x86-topo is inside topology.h
|
|
|
|
'test-x86-topo': [],
|
2021-03-10 09:33:14 +03:00
|
|
|
'test-cutils': [],
|
2021-10-25 22:11:39 +03:00
|
|
|
'test-div128': [],
|
2021-03-10 09:33:14 +03:00
|
|
|
'test-shift128': [],
|
|
|
|
'test-mul64': [],
|
|
|
|
# all code tested by test-int128 is inside int128.h
|
|
|
|
'test-int128': [],
|
|
|
|
'rcutorture': [],
|
|
|
|
'test-rcu-list': [],
|
|
|
|
'test-rcu-simpleq': [],
|
|
|
|
'test-rcu-tailq': [],
|
|
|
|
'test-rcu-slist': [],
|
|
|
|
'test-qdist': [],
|
|
|
|
'test-qht': [],
|
2023-02-05 19:37:57 +03:00
|
|
|
'test-qtree': [],
|
2021-03-10 09:33:14 +03:00
|
|
|
'test-bitops': [],
|
|
|
|
'test-bitcnt': [],
|
|
|
|
'test-qgraph': ['../qtest/libqos/qgraph.c'],
|
|
|
|
'check-qom-interface': [qom],
|
|
|
|
'check-qom-proplist': [qom],
|
|
|
|
'test-qemu-opts': [],
|
|
|
|
'test-keyval': [testqapi],
|
|
|
|
'test-logging': [],
|
|
|
|
'test-qapi-util': [],
|
2022-09-17 15:05:54 +03:00
|
|
|
'test-interval-tree': [],
|
2021-03-10 09:33:14 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if have_system or have_tools
|
|
|
|
tests += {
|
|
|
|
'test-qmp-event': [testqapi],
|
|
|
|
}
|
2021-07-29 15:15:43 +03:00
|
|
|
|
|
|
|
if seccomp.found()
|
2023-10-04 12:06:28 +03:00
|
|
|
tests += {'test-seccomp': ['../../system/qemu-seccomp.c', seccomp]}
|
2021-07-29 15:15:43 +03:00
|
|
|
endif
|
2021-03-10 09:33:14 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
if have_block
|
|
|
|
tests += {
|
|
|
|
'test-coroutine': [testblock],
|
|
|
|
'test-aio': [testblock],
|
|
|
|
'test-aio-multithread': [testblock],
|
|
|
|
'test-throttle': [testblock],
|
|
|
|
'test-thread-pool': [testblock],
|
|
|
|
'test-hbitmap': [testblock],
|
|
|
|
'test-bdrv-drain': [testblock],
|
|
|
|
'test-bdrv-graph-mod': [testblock],
|
|
|
|
'test-blockjob': [testblock],
|
|
|
|
'test-blockjob-txn': [testblock],
|
|
|
|
'test-block-backend': [testblock],
|
|
|
|
'test-block-iothread': [testblock],
|
|
|
|
'test-write-threshold': [testblock],
|
|
|
|
'test-crypto-hash': [crypto],
|
|
|
|
'test-crypto-hmac': [crypto],
|
|
|
|
'test-crypto-cipher': [crypto],
|
2022-05-25 12:01:16 +03:00
|
|
|
'test-crypto-akcipher': [crypto],
|
2021-03-10 09:33:14 +03:00
|
|
|
'test-crypto-secret': [crypto, keyutils],
|
2022-05-25 12:01:13 +03:00
|
|
|
'test-crypto-der': [crypto],
|
2021-03-10 09:33:14 +03:00
|
|
|
'test-authz-simple': [authz],
|
|
|
|
'test-authz-list': [authz],
|
|
|
|
'test-authz-listfile': [authz],
|
|
|
|
'test-io-task': [testblock],
|
|
|
|
'test-io-channel-socket': ['socket-helpers.c', 'io-channel-helpers.c', io],
|
|
|
|
'test-io-channel-file': ['io-channel-helpers.c', io],
|
|
|
|
'test-io-channel-command': ['io-channel-helpers.c', io],
|
|
|
|
'test-io-channel-buffer': ['io-channel-helpers.c', io],
|
2022-06-20 14:01:45 +03:00
|
|
|
'test-io-channel-null': [io],
|
2021-03-10 09:33:14 +03:00
|
|
|
'test-crypto-ivgen': [io],
|
|
|
|
'test-crypto-afsplit': [io],
|
|
|
|
'test-crypto-block': [io],
|
2024-04-08 18:53:16 +03:00
|
|
|
'test-timed-average': [],
|
|
|
|
'test-uuid': [],
|
2021-03-10 09:33:14 +03:00
|
|
|
}
|
2021-06-03 12:15:26 +03:00
|
|
|
if gnutls.found() and \
|
2021-06-03 12:15:26 +03:00
|
|
|
tasn1.found() and \
|
2023-11-03 11:17:48 +03:00
|
|
|
host_os != 'windows'
|
2021-03-10 09:33:14 +03:00
|
|
|
tests += {
|
|
|
|
'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',
|
|
|
|
tasn1, crypto, gnutls],
|
|
|
|
'test-crypto-tlssession': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c',
|
|
|
|
tasn1, crypto, gnutls],
|
|
|
|
'test-io-channel-tls': ['io-channel-helpers.c', 'crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',
|
|
|
|
tasn1, io, crypto, gnutls]}
|
|
|
|
endif
|
2021-06-03 12:15:26 +03:00
|
|
|
if pam.found()
|
2021-03-10 09:33:14 +03:00
|
|
|
tests += {'test-authz-pam': [authz]}
|
|
|
|
endif
|
2021-06-03 12:15:26 +03:00
|
|
|
if xts == 'private'
|
2021-03-10 09:33:14 +03:00
|
|
|
tests += {'test-crypto-xts': [crypto, io]}
|
|
|
|
endif
|
2023-11-03 11:17:48 +03:00
|
|
|
if host_os != 'windows'
|
2023-05-02 21:41:34 +03:00
|
|
|
tests += {
|
|
|
|
'test-image-locking': [testblock],
|
|
|
|
'test-nested-aio-poll': [testblock],
|
|
|
|
}
|
2021-03-10 09:33:14 +03:00
|
|
|
endif
|
2021-10-13 12:43:54 +03:00
|
|
|
if config_host_data.get('CONFIG_REPLICATION')
|
2021-03-10 09:33:14 +03:00
|
|
|
tests += {'test-replication': [testblock]}
|
|
|
|
endif
|
2021-06-03 12:15:26 +03:00
|
|
|
if nettle.found() or gcrypt.found()
|
2021-03-10 09:33:14 +03:00
|
|
|
tests += {'test-crypto-pbkdf': [io]}
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if have_system
|
|
|
|
tests += {
|
2024-04-08 18:53:16 +03:00
|
|
|
'ptimer-test': ['ptimer-test-stubs.c', meson.project_source_root() / 'hw/core/ptimer.c'],
|
2021-03-10 09:33:14 +03:00
|
|
|
'test-iov': [],
|
2024-04-08 18:53:16 +03:00
|
|
|
'test-opts-visitor': [testqapi],
|
|
|
|
'test-xs-node': [qom],
|
|
|
|
'test-virtio-dmabuf': [meson.project_source_root() / 'hw/display/virtio-dmabuf.c'],
|
2021-03-10 09:33:14 +03:00
|
|
|
'test-qmp-cmds': [testqapi],
|
|
|
|
'test-xbzrle': [migration],
|
|
|
|
'test-util-sockets': ['socket-helpers.c'],
|
|
|
|
'test-base64': [],
|
|
|
|
'test-bufferiszero': [],
|
2022-12-19 20:09:46 +03:00
|
|
|
'test-smp-parse': [qom, meson.project_source_root() / 'hw/core/machine-smp.c'],
|
2021-03-30 21:13:35 +03:00
|
|
|
'test-vmstate': [migration, io],
|
|
|
|
'test-yank': ['socket-helpers.c', qom, io, chardev]
|
2021-03-10 09:33:14 +03:00
|
|
|
}
|
2022-01-07 16:35:14 +03:00
|
|
|
if config_host_data.get('CONFIG_INOTIFY1')
|
2021-03-10 09:33:14 +03:00
|
|
|
tests += {'test-util-filemonitor': []}
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Some tests: test-char, test-qdev-global-props, and test-qga,
|
|
|
|
# are not runnable under TSan due to a known issue.
|
|
|
|
# https://github.com/google/sanitizers/issues/1116
|
2023-01-09 17:31:51 +03:00
|
|
|
if not get_option('tsan')
|
2023-11-03 11:17:48 +03:00
|
|
|
if host_os != 'windows'
|
2021-03-10 09:33:14 +03:00
|
|
|
tests += {
|
|
|
|
'test-char': ['socket-helpers.c', qom, io, chardev]
|
|
|
|
}
|
|
|
|
endif
|
|
|
|
|
|
|
|
tests += {
|
2022-03-23 18:57:15 +03:00
|
|
|
'test-qdev-global-props': [qom, hwcore]
|
2021-03-10 09:33:14 +03:00
|
|
|
}
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2023-11-03 11:17:48 +03:00
|
|
|
if have_ga and host_os == 'linux'
|
2022-03-30 12:34:11 +03:00
|
|
|
tests += {'test-qga': ['../qtest/libqmp.c']}
|
2021-03-10 09:33:14 +03:00
|
|
|
test_deps += {'test-qga': qga}
|
|
|
|
endif
|
|
|
|
|
|
|
|
test_env = environment()
|
|
|
|
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
|
|
|
|
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
|
|
|
|
|
|
|
|
slow_tests = {
|
2023-12-15 10:03:54 +03:00
|
|
|
'test-aio-multithread' : 120,
|
2024-03-12 14:08:15 +03:00
|
|
|
'test-bufferiszero': 60,
|
2023-12-15 10:03:55 +03:00
|
|
|
'test-crypto-block' : 300,
|
2024-03-12 14:08:15 +03:00
|
|
|
'test-crypto-tlscredsx509': 90,
|
|
|
|
'test-crypto-tlssession': 90,
|
2024-01-25 19:58:03 +03:00
|
|
|
'test-replication': 60,
|
2021-03-10 09:33:14 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
foreach test_name, extra: tests
|
|
|
|
src = [test_name + '.c']
|
|
|
|
deps = [qemuutil]
|
|
|
|
if extra.length() > 0
|
|
|
|
# use a sourceset to quickly separate sources and deps
|
|
|
|
test_ss = ss.source_set()
|
|
|
|
test_ss.add(extra)
|
|
|
|
src += test_ss.all_sources()
|
|
|
|
deps += test_ss.all_dependencies()
|
|
|
|
endif
|
|
|
|
exe = executable(test_name, src, genh, dependencies: deps)
|
|
|
|
|
|
|
|
test(test_name, exe,
|
|
|
|
depends: test_deps.get(test_name, []),
|
|
|
|
env: test_env,
|
|
|
|
args: ['--tap', '-k'],
|
|
|
|
protocol: 'tap',
|
|
|
|
timeout: slow_tests.get(test_name, 30),
|
|
|
|
priority: slow_tests.get(test_name, 30),
|
|
|
|
suite: ['unit'])
|
|
|
|
endforeach
|