tests: Move unit tests into a separate directory
The main tests directory still looks very crowded, and it's not clear which files are part of a unit tests and which belong to a different test subsystem. Let's clean up the mess and move the unit tests to a separate directory. Message-Id: <20210310063314.1049838-1-thuth@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
363fc96305
commit
da668aa15b
68
MAINTAINERS
68
MAINTAINERS
@ -1537,7 +1537,7 @@ F: include/hw/southbridge/piix.h
|
|||||||
F: hw/misc/sga.c
|
F: hw/misc/sga.c
|
||||||
F: hw/isa/apm.c
|
F: hw/isa/apm.c
|
||||||
F: include/hw/isa/apm.h
|
F: include/hw/isa/apm.h
|
||||||
F: tests/test-x86-cpuid.c
|
F: tests/unit/test-x86-cpuid.c
|
||||||
F: tests/qtest/test-x86-cpuid-compat.c
|
F: tests/qtest/test-x86-cpuid-compat.c
|
||||||
|
|
||||||
PC Chipset
|
PC Chipset
|
||||||
@ -2212,7 +2212,7 @@ F: qemu-io*
|
|||||||
F: tests/qemu-iotests/
|
F: tests/qemu-iotests/
|
||||||
F: util/qemu-progress.c
|
F: util/qemu-progress.c
|
||||||
F: qobject/block-qdict.c
|
F: qobject/block-qdict.c
|
||||||
F: tests/check-block-qdict.c
|
F: tests/unit/check-block-qdict.c
|
||||||
T: git https://repo.or.cz/qemu/kevin.git block
|
T: git https://repo.or.cz/qemu/kevin.git block
|
||||||
|
|
||||||
Storage daemon
|
Storage daemon
|
||||||
@ -2238,7 +2238,7 @@ F: migration/block*
|
|||||||
F: include/block/aio.h
|
F: include/block/aio.h
|
||||||
F: include/block/aio-wait.h
|
F: include/block/aio-wait.h
|
||||||
F: scripts/qemugdb/aio.py
|
F: scripts/qemugdb/aio.py
|
||||||
F: tests/test-fdmon-epoll.c
|
F: tests/unit/test-fdmon-epoll.c
|
||||||
T: git https://github.com/stefanha/qemu.git block
|
T: git https://github.com/stefanha/qemu.git block
|
||||||
|
|
||||||
Block SCSI subsystem
|
Block SCSI subsystem
|
||||||
@ -2298,7 +2298,7 @@ F: block/dirty-bitmap.c
|
|||||||
F: block/qcow2-bitmap.c
|
F: block/qcow2-bitmap.c
|
||||||
F: migration/block-dirty-bitmap.c
|
F: migration/block-dirty-bitmap.c
|
||||||
F: util/hbitmap.c
|
F: util/hbitmap.c
|
||||||
F: tests/test-hbitmap.c
|
F: tests/unit/test-hbitmap.c
|
||||||
F: docs/interop/bitmaps.rst
|
F: docs/interop/bitmaps.rst
|
||||||
T: git https://repo.or.cz/qemu/ericb.git bitmaps
|
T: git https://repo.or.cz/qemu/ericb.git bitmaps
|
||||||
|
|
||||||
@ -2319,8 +2319,8 @@ Command line option argument parsing
|
|||||||
M: Markus Armbruster <armbru@redhat.com>
|
M: Markus Armbruster <armbru@redhat.com>
|
||||||
S: Supported
|
S: Supported
|
||||||
F: include/qemu/option.h
|
F: include/qemu/option.h
|
||||||
F: tests/test-keyval.c
|
F: tests/unit/test-keyval.c
|
||||||
F: tests/test-qemu-opts.c
|
F: tests/unit/test-qemu-opts.c
|
||||||
F: util/keyval.c
|
F: util/keyval.c
|
||||||
F: util/qemu-option.c
|
F: util/qemu-option.c
|
||||||
|
|
||||||
@ -2438,8 +2438,8 @@ Read, Copy, Update (RCU)
|
|||||||
M: Paolo Bonzini <pbonzini@redhat.com>
|
M: Paolo Bonzini <pbonzini@redhat.com>
|
||||||
S: Maintained
|
S: Maintained
|
||||||
F: include/qemu/rcu*.h
|
F: include/qemu/rcu*.h
|
||||||
F: tests/rcutorture.c
|
F: tests/unit/rcutorture.c
|
||||||
F: tests/test-rcu-*.c
|
F: tests/unit/test-rcu-*.c
|
||||||
F: util/rcu.c
|
F: util/rcu.c
|
||||||
|
|
||||||
Human Monitor (HMP)
|
Human Monitor (HMP)
|
||||||
@ -2517,10 +2517,10 @@ F: include/qapi/
|
|||||||
X: include/qapi/qmp/
|
X: include/qapi/qmp/
|
||||||
F: include/qapi/qmp/dispatch.h
|
F: include/qapi/qmp/dispatch.h
|
||||||
F: tests/qapi-schema/
|
F: tests/qapi-schema/
|
||||||
F: tests/test-*-visitor.c
|
F: tests/unit/test-*-visitor.c
|
||||||
F: tests/test-qapi-*.c
|
F: tests/unit/test-qapi-*.c
|
||||||
F: tests/test-qmp-*.c
|
F: tests/unit/test-qmp-*.c
|
||||||
F: tests/test-visitor-serialization.c
|
F: tests/unit/test-visitor-serialization.c
|
||||||
F: scripts/qapi-gen.py
|
F: scripts/qapi-gen.py
|
||||||
F: scripts/qapi/*
|
F: scripts/qapi/*
|
||||||
F: docs/sphinx/qapidoc.py
|
F: docs/sphinx/qapidoc.py
|
||||||
@ -2541,14 +2541,14 @@ F: qobject/
|
|||||||
F: include/qapi/qmp/
|
F: include/qapi/qmp/
|
||||||
X: include/qapi/qmp/dispatch.h
|
X: include/qapi/qmp/dispatch.h
|
||||||
F: scripts/coccinelle/qobject.cocci
|
F: scripts/coccinelle/qobject.cocci
|
||||||
F: tests/check-qdict.c
|
F: tests/unit/check-qdict.c
|
||||||
F: tests/check-qjson.c
|
F: tests/unit/check-qjson.c
|
||||||
F: tests/check-qlist.c
|
F: tests/unit/check-qlist.c
|
||||||
F: tests/check-qlit.c
|
F: tests/unit/check-qlit.c
|
||||||
F: tests/check-qnull.c
|
F: tests/unit/check-qnull.c
|
||||||
F: tests/check-qnum.c
|
F: tests/unit/check-qnum.c
|
||||||
F: tests/check-qobject.c
|
F: tests/unit/check-qobject.c
|
||||||
F: tests/check-qstring.c
|
F: tests/unit/check-qstring.c
|
||||||
F: tests/data/qobject/qdict.txt
|
F: tests/data/qobject/qdict.txt
|
||||||
T: git https://repo.or.cz/qemu/armbru.git qapi-next
|
T: git https://repo.or.cz/qemu/armbru.git qapi-next
|
||||||
|
|
||||||
@ -2559,7 +2559,7 @@ F: qga/
|
|||||||
F: docs/interop/qemu-ga.rst
|
F: docs/interop/qemu-ga.rst
|
||||||
F: docs/interop/qemu-ga-ref.rst
|
F: docs/interop/qemu-ga-ref.rst
|
||||||
F: scripts/qemu-guest-agent/
|
F: scripts/qemu-guest-agent/
|
||||||
F: tests/test-qga.c
|
F: tests/unit/test-qga.c
|
||||||
T: git https://github.com/mdroth/qemu.git qga
|
T: git https://github.com/mdroth/qemu.git qga
|
||||||
|
|
||||||
QOM
|
QOM
|
||||||
@ -2580,9 +2580,9 @@ F: scripts/coccinelle/qom-parent-type.cocci
|
|||||||
F: softmmu/qdev-monitor.c
|
F: softmmu/qdev-monitor.c
|
||||||
F: stubs/qdev.c
|
F: stubs/qdev.c
|
||||||
F: qom/
|
F: qom/
|
||||||
F: tests/check-qom-interface.c
|
F: tests/unit/check-qom-interface.c
|
||||||
F: tests/check-qom-proplist.c
|
F: tests/unit/check-qom-proplist.c
|
||||||
F: tests/test-qdev-global-props.c
|
F: tests/unit/test-qdev-global-props.c
|
||||||
|
|
||||||
QOM boilerplate conversion script
|
QOM boilerplate conversion script
|
||||||
M: Eduardo Habkost <ehabkost@redhat.com>
|
M: Eduardo Habkost <ehabkost@redhat.com>
|
||||||
@ -2721,10 +2721,10 @@ S: Maintained
|
|||||||
F: crypto/
|
F: crypto/
|
||||||
F: include/crypto/
|
F: include/crypto/
|
||||||
F: qapi/crypto.json
|
F: qapi/crypto.json
|
||||||
F: tests/test-crypto-*
|
F: tests/unit/test-crypto-*
|
||||||
F: tests/benchmark-crypto-*
|
F: tests/benchmark-crypto-*
|
||||||
F: tests/crypto-tls-*
|
F: tests/unit/crypto-tls-*
|
||||||
F: tests/pkix_asn1_tab.c
|
F: tests/unit/pkix_asn1_tab.c
|
||||||
F: qemu.sasl
|
F: qemu.sasl
|
||||||
|
|
||||||
Coroutines
|
Coroutines
|
||||||
@ -2733,7 +2733,7 @@ M: Kevin Wolf <kwolf@redhat.com>
|
|||||||
S: Maintained
|
S: Maintained
|
||||||
F: util/*coroutine*
|
F: util/*coroutine*
|
||||||
F: include/qemu/coroutine*
|
F: include/qemu/coroutine*
|
||||||
F: tests/test-coroutine.c
|
F: tests/unit/test-coroutine.c
|
||||||
|
|
||||||
Buffers
|
Buffers
|
||||||
M: Daniel P. Berrange <berrange@redhat.com>
|
M: Daniel P. Berrange <berrange@redhat.com>
|
||||||
@ -2746,7 +2746,7 @@ M: Daniel P. Berrange <berrange@redhat.com>
|
|||||||
S: Maintained
|
S: Maintained
|
||||||
F: io/
|
F: io/
|
||||||
F: include/io/
|
F: include/io/
|
||||||
F: tests/test-io-*
|
F: tests/unit/test-io-*
|
||||||
|
|
||||||
User authorization
|
User authorization
|
||||||
M: Daniel P. Berrange <berrange@redhat.com>
|
M: Daniel P. Berrange <berrange@redhat.com>
|
||||||
@ -2754,7 +2754,7 @@ S: Maintained
|
|||||||
F: authz/
|
F: authz/
|
||||||
F: qapi/authz.json
|
F: qapi/authz.json
|
||||||
F: include/authz/
|
F: include/authz/
|
||||||
F: tests/test-authz-*
|
F: tests/unit/test-authz-*
|
||||||
|
|
||||||
Sockets
|
Sockets
|
||||||
M: Daniel P. Berrange <berrange@redhat.com>
|
M: Daniel P. Berrange <berrange@redhat.com>
|
||||||
@ -2769,7 +2769,7 @@ M: Daniel P. Berrange <berrange@redhat.com>
|
|||||||
S: Odd Fixes
|
S: Odd Fixes
|
||||||
F: util/filemonitor*.c
|
F: util/filemonitor*.c
|
||||||
F: include/qemu/filemonitor.h
|
F: include/qemu/filemonitor.h
|
||||||
F: tests/test-util-filemonitor.c
|
F: tests/unit/test-util-filemonitor.c
|
||||||
|
|
||||||
Throttling infrastructure
|
Throttling infrastructure
|
||||||
M: Alberto Garcia <berto@igalia.com>
|
M: Alberto Garcia <berto@igalia.com>
|
||||||
@ -2779,7 +2779,7 @@ F: include/block/throttle-groups.h
|
|||||||
F: include/qemu/throttle*.h
|
F: include/qemu/throttle*.h
|
||||||
F: util/throttle.c
|
F: util/throttle.c
|
||||||
F: docs/throttle.txt
|
F: docs/throttle.txt
|
||||||
F: tests/test-throttle.c
|
F: tests/unit/test-throttle.c
|
||||||
L: qemu-block@nongnu.org
|
L: qemu-block@nongnu.org
|
||||||
|
|
||||||
UUID
|
UUID
|
||||||
@ -2787,7 +2787,7 @@ M: Fam Zheng <fam@euphon.net>
|
|||||||
S: Supported
|
S: Supported
|
||||||
F: util/uuid.c
|
F: util/uuid.c
|
||||||
F: include/qemu/uuid.h
|
F: include/qemu/uuid.h
|
||||||
F: tests/test-uuid.c
|
F: tests/unit/test-uuid.c
|
||||||
|
|
||||||
Yank feature
|
Yank feature
|
||||||
M: Lukas Straub <lukasstraub2@web.de>
|
M: Lukas Straub <lukasstraub2@web.de>
|
||||||
@ -3237,7 +3237,7 @@ M: Xie Changlong <xiechanglong.d@gmail.com>
|
|||||||
S: Supported
|
S: Supported
|
||||||
F: replication*
|
F: replication*
|
||||||
F: block/replication.c
|
F: block/replication.c
|
||||||
F: tests/test-replication.c
|
F: tests/unit/test-replication.c
|
||||||
F: docs/block-replication.txt
|
F: docs/block-replication.txt
|
||||||
|
|
||||||
PVRDMA
|
PVRDMA
|
||||||
|
@ -69,59 +69,6 @@ endforeach
|
|||||||
libtestqapi = static_library('testqapi', sources: [genh, test_qapi_sources])
|
libtestqapi = static_library('testqapi', sources: [genh, test_qapi_sources])
|
||||||
testqapi = declare_dependency(link_with: libtestqapi, sources: [genh, test_qapi_headers])
|
testqapi = declare_dependency(link_with: libtestqapi, sources: [genh, test_qapi_headers])
|
||||||
|
|
||||||
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': [],
|
|
||||||
'test-qobject-output-visitor': [testqapi],
|
|
||||||
'test-clone-visitor': [testqapi],
|
|
||||||
'test-qobject-input-visitor': [testqapi],
|
|
||||||
'test-string-input-visitor': [testqapi],
|
|
||||||
'test-string-output-visitor': [testqapi],
|
|
||||||
'test-opts-visitor': [testqapi],
|
|
||||||
'test-visitor-serialization': [testqapi],
|
|
||||||
'test-bitmap': [],
|
|
||||||
# all code tested by test-x86-cpuid is inside topology.h
|
|
||||||
'test-x86-cpuid': [],
|
|
||||||
'test-cutils': [],
|
|
||||||
'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': [],
|
|
||||||
'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-uuid': [],
|
|
||||||
'ptimer-test': ['ptimer-test-stubs.c', meson.source_root() / 'hw/core/ptimer.c'],
|
|
||||||
'test-qapi-util': [],
|
|
||||||
}
|
|
||||||
|
|
||||||
if have_system or have_tools
|
|
||||||
tests += {
|
|
||||||
'test-qmp-event': [testqapi],
|
|
||||||
}
|
|
||||||
endif
|
|
||||||
|
|
||||||
test_deps = {
|
test_deps = {
|
||||||
'test-qht-par': qht_bench,
|
'test-qht-par': qht_bench,
|
||||||
}
|
}
|
||||||
@ -129,65 +76,6 @@ test_deps = {
|
|||||||
benchs = {}
|
benchs = {}
|
||||||
|
|
||||||
if have_block
|
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],
|
|
||||||
'test-crypto-secret': [crypto, keyutils],
|
|
||||||
'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],
|
|
||||||
'test-crypto-ivgen': [io],
|
|
||||||
'test-crypto-afsplit': [io],
|
|
||||||
'test-crypto-block': [io],
|
|
||||||
}
|
|
||||||
if 'CONFIG_GNUTLS' in config_host and \
|
|
||||||
'CONFIG_TASN1' in config_host and \
|
|
||||||
'CONFIG_POSIX' in config_host
|
|
||||||
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
|
|
||||||
if 'CONFIG_AUTH_PAM' in config_host
|
|
||||||
tests += {'test-authz-pam': [authz]}
|
|
||||||
endif
|
|
||||||
if 'CONFIG_QEMU_PRIVATE_XTS' in config_host
|
|
||||||
tests += {'test-crypto-xts': [crypto, io]}
|
|
||||||
endif
|
|
||||||
if 'CONFIG_POSIX' in config_host
|
|
||||||
tests += {'test-image-locking': [testblock]}
|
|
||||||
endif
|
|
||||||
if 'CONFIG_REPLICATION' in config_host
|
|
||||||
tests += {'test-replication': [testblock]}
|
|
||||||
endif
|
|
||||||
if 'CONFIG_NETTLE' in config_host or 'CONFIG_GCRYPT' in config_host
|
|
||||||
tests += {'test-crypto-pbkdf': [io]}
|
|
||||||
endif
|
|
||||||
if 'CONFIG_EPOLL_CREATE1' in config_host
|
|
||||||
tests += {'test-fdmon-epoll': [testblock]}
|
|
||||||
endif
|
|
||||||
benchs += {
|
benchs += {
|
||||||
'benchmark-crypto-hash': [crypto],
|
'benchmark-crypto-hash': [crypto],
|
||||||
'benchmark-crypto-hmac': [crypto],
|
'benchmark-crypto-hmac': [crypto],
|
||||||
@ -195,75 +83,6 @@ if have_block
|
|||||||
}
|
}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if have_system
|
|
||||||
tests += {
|
|
||||||
'test-iov': [],
|
|
||||||
'test-qmp-cmds': [testqapi],
|
|
||||||
'test-xbzrle': [migration],
|
|
||||||
'test-timed-average': [],
|
|
||||||
'test-util-sockets': ['socket-helpers.c'],
|
|
||||||
'test-base64': [],
|
|
||||||
'test-bufferiszero': [],
|
|
||||||
'test-vmstate': [migration, io]
|
|
||||||
}
|
|
||||||
if 'CONFIG_INOTIFY1' in config_host
|
|
||||||
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
|
|
||||||
if 'CONFIG_TSAN' not in config_host
|
|
||||||
if 'CONFIG_POSIX' in config_host
|
|
||||||
tests += {
|
|
||||||
'test-char': ['socket-helpers.c', qom, io, chardev]
|
|
||||||
}
|
|
||||||
endif
|
|
||||||
|
|
||||||
tests += {
|
|
||||||
'test-qdev-global-props': [qom, hwcore, testqapi]
|
|
||||||
}
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if 'CONFIG_TSAN' not in config_host and \
|
|
||||||
'CONFIG_GUEST_AGENT' in config_host and \
|
|
||||||
'CONFIG_LINUX' in config_host
|
|
||||||
tests += {'test-qga': ['qtest/libqtest.c']}
|
|
||||||
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 = {
|
|
||||||
'test-crypto-tlscredsx509': 45,
|
|
||||||
'test-crypto-tlssession': 45
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
foreach bench_name, deps: benchs
|
foreach bench_name, deps: benchs
|
||||||
exe = executable(bench_name, bench_name + '.c',
|
exe = executable(bench_name, bench_name + '.c',
|
||||||
dependencies: [qemuutil] + deps)
|
dependencies: [qemuutil] + deps)
|
||||||
@ -299,6 +118,7 @@ if not get_option('tcg').disabled()
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
subdir('unit')
|
||||||
subdir('qapi-schema')
|
subdir('qapi-schema')
|
||||||
subdir('qtest')
|
subdir('qtest')
|
||||||
subdir('migration')
|
subdir('migration')
|
||||||
|
184
tests/unit/meson.build
Normal file
184
tests/unit/meson.build
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
|
||||||
|
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': [],
|
||||||
|
'test-qobject-output-visitor': [testqapi],
|
||||||
|
'test-clone-visitor': [testqapi],
|
||||||
|
'test-qobject-input-visitor': [testqapi],
|
||||||
|
'test-string-input-visitor': [testqapi],
|
||||||
|
'test-string-output-visitor': [testqapi],
|
||||||
|
'test-opts-visitor': [testqapi],
|
||||||
|
'test-visitor-serialization': [testqapi],
|
||||||
|
'test-bitmap': [],
|
||||||
|
# all code tested by test-x86-cpuid is inside topology.h
|
||||||
|
'test-x86-cpuid': [],
|
||||||
|
'test-cutils': [],
|
||||||
|
'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': [],
|
||||||
|
'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-uuid': [],
|
||||||
|
'ptimer-test': ['ptimer-test-stubs.c', meson.source_root() / 'hw/core/ptimer.c'],
|
||||||
|
'test-qapi-util': [],
|
||||||
|
}
|
||||||
|
|
||||||
|
if have_system or have_tools
|
||||||
|
tests += {
|
||||||
|
'test-qmp-event': [testqapi],
|
||||||
|
}
|
||||||
|
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],
|
||||||
|
'test-crypto-secret': [crypto, keyutils],
|
||||||
|
'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],
|
||||||
|
'test-crypto-ivgen': [io],
|
||||||
|
'test-crypto-afsplit': [io],
|
||||||
|
'test-crypto-block': [io],
|
||||||
|
}
|
||||||
|
if 'CONFIG_GNUTLS' in config_host and \
|
||||||
|
'CONFIG_TASN1' in config_host and \
|
||||||
|
'CONFIG_POSIX' in config_host
|
||||||
|
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
|
||||||
|
if 'CONFIG_AUTH_PAM' in config_host
|
||||||
|
tests += {'test-authz-pam': [authz]}
|
||||||
|
endif
|
||||||
|
if 'CONFIG_QEMU_PRIVATE_XTS' in config_host
|
||||||
|
tests += {'test-crypto-xts': [crypto, io]}
|
||||||
|
endif
|
||||||
|
if 'CONFIG_POSIX' in config_host
|
||||||
|
tests += {'test-image-locking': [testblock]}
|
||||||
|
endif
|
||||||
|
if 'CONFIG_REPLICATION' in config_host
|
||||||
|
tests += {'test-replication': [testblock]}
|
||||||
|
endif
|
||||||
|
if 'CONFIG_NETTLE' in config_host or 'CONFIG_GCRYPT' in config_host
|
||||||
|
tests += {'test-crypto-pbkdf': [io]}
|
||||||
|
endif
|
||||||
|
if 'CONFIG_EPOLL_CREATE1' in config_host
|
||||||
|
tests += {'test-fdmon-epoll': [testblock]}
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if have_system
|
||||||
|
tests += {
|
||||||
|
'test-iov': [],
|
||||||
|
'test-qmp-cmds': [testqapi],
|
||||||
|
'test-xbzrle': [migration],
|
||||||
|
'test-timed-average': [],
|
||||||
|
'test-util-sockets': ['socket-helpers.c'],
|
||||||
|
'test-base64': [],
|
||||||
|
'test-bufferiszero': [],
|
||||||
|
'test-vmstate': [migration, io]
|
||||||
|
}
|
||||||
|
if 'CONFIG_INOTIFY1' in config_host
|
||||||
|
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
|
||||||
|
if 'CONFIG_TSAN' not in config_host
|
||||||
|
if 'CONFIG_POSIX' in config_host
|
||||||
|
tests += {
|
||||||
|
'test-char': ['socket-helpers.c', qom, io, chardev]
|
||||||
|
}
|
||||||
|
endif
|
||||||
|
|
||||||
|
tests += {
|
||||||
|
'test-qdev-global-props': [qom, hwcore, testqapi]
|
||||||
|
}
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if 'CONFIG_TSAN' not in config_host and \
|
||||||
|
'CONFIG_GUEST_AGENT' in config_host and \
|
||||||
|
'CONFIG_LINUX' in config_host
|
||||||
|
tests += {'test-qga': ['../qtest/libqtest.c']}
|
||||||
|
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 = {
|
||||||
|
'test-crypto-tlscredsx509': 45,
|
||||||
|
'test-crypto-tlssession': 45
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include "tests/crypto-tls-x509-helpers.h"
|
#include "crypto-tls-x509-helpers.h"
|
||||||
|
|
||||||
#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
|
#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
|
||||||
|
|
@ -4,7 +4,7 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
|
||||||
#include "qtest/libqos/libqtest.h"
|
#include "../qtest/libqos/libqtest.h"
|
||||||
#include "qapi/qmp/qdict.h"
|
#include "qapi/qmp/qdict.h"
|
||||||
#include "qapi/qmp/qlist.h"
|
#include "qapi/qmp/qlist.h"
|
||||||
|
|
@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include "qtest/libqos/qgraph.h"
|
#include "../qtest/libqos/qgraph.h"
|
||||||
#include "qtest/libqos/qgraph_internal.h"
|
#include "../qtest/libqos/qgraph_internal.h"
|
||||||
|
|
||||||
#define MACHINE_PC "x86_64/pc"
|
#define MACHINE_PC "x86_64/pc"
|
||||||
#define MACHINE_RASPI2 "arm/raspi2"
|
#define MACHINE_RASPI2 "arm/raspi2"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user