Skip to content

Commit

Permalink
tests/unit: match some unit tests to corresponding feature switches
Browse files Browse the repository at this point in the history
Try not to test code that is not used by user mode emulation, or by the
block layer, unless they are being compiled; and fix test-timed-average
which was not compiled with --disable-system --enable-tools.

This is by no means complete, it only touches the more blatantly
wrong cases.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240408155330.522792-5-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Apr 18, 2024
1 parent bb23c33 commit 34dca3f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/unit/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ tests = {
'test-forward-visitor': [testqapi],
'test-string-input-visitor': [testqapi],
'test-string-output-visitor': [testqapi],
'test-opts-visitor': [testqapi],
'test-visitor-serialization': [testqapi],
'test-bitmap': [],
'test-resv-mem': [],
Expand Down Expand Up @@ -46,12 +45,8 @@ tests = {
'test-qemu-opts': [],
'test-keyval': [testqapi],
'test-logging': [],
'test-uuid': [],
'ptimer-test': ['ptimer-test-stubs.c', meson.project_source_root() / 'hw/core/ptimer.c'],
'test-qapi-util': [],
'test-interval-tree': [],
'test-xs-node': [qom],
'test-virtio-dmabuf': [meson.project_source_root() / 'hw/display/virtio-dmabuf.c'],
}

if have_system or have_tools
Expand Down Expand Up @@ -97,6 +92,8 @@ if have_block
'test-crypto-ivgen': [io],
'test-crypto-afsplit': [io],
'test-crypto-block': [io],
'test-timed-average': [],
'test-uuid': [],
}
if gnutls.found() and \
tasn1.found() and \
Expand Down Expand Up @@ -131,10 +128,13 @@ endif

if have_system
tests += {
'ptimer-test': ['ptimer-test-stubs.c', meson.project_source_root() / 'hw/core/ptimer.c'],
'test-iov': [],
'test-opts-visitor': [testqapi],
'test-xs-node': [qom],
'test-virtio-dmabuf': [meson.project_source_root() / 'hw/display/virtio-dmabuf.c'],
'test-qmp-cmds': [testqapi],
'test-xbzrle': [migration],
'test-timed-average': [],
'test-util-sockets': ['socket-helpers.c'],
'test-base64': [],
'test-bufferiszero': [],
Expand Down

0 comments on commit 34dca3f

Please sign in to comment.