Browse Source

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>
pull/113/head
Thomas Huth 5 years ago
parent
commit
da668aa15b
  1. 68
      MAINTAINERS
  2. 182
      tests/meson.build
  3. 0
      tests/unit/check-block-qdict.c
  4. 0
      tests/unit/check-qdict.c
  5. 0
      tests/unit/check-qjson.c
  6. 0
      tests/unit/check-qlist.c
  7. 0
      tests/unit/check-qlit.c
  8. 0
      tests/unit/check-qnull.c
  9. 0
      tests/unit/check-qnum.c
  10. 0
      tests/unit/check-qobject.c
  11. 0
      tests/unit/check-qom-interface.c
  12. 0
      tests/unit/check-qom-proplist.c
  13. 0
      tests/unit/check-qstring.c
  14. 0
      tests/unit/crypto-tls-psk-helpers.c
  15. 0
      tests/unit/crypto-tls-psk-helpers.h
  16. 0
      tests/unit/crypto-tls-x509-helpers.c
  17. 0
      tests/unit/crypto-tls-x509-helpers.h
  18. 0
      tests/unit/io-channel-helpers.c
  19. 0
      tests/unit/io-channel-helpers.h
  20. 0
      tests/unit/iothread.c
  21. 0
      tests/unit/iothread.h
  22. 184
      tests/unit/meson.build
  23. 2
      tests/unit/pkix_asn1_tab.c
  24. 0
      tests/unit/ptimer-test-stubs.c
  25. 0
      tests/unit/ptimer-test.c
  26. 0
      tests/unit/ptimer-test.h
  27. 0
      tests/unit/rcutorture.c
  28. 0
      tests/unit/socket-helpers.c
  29. 0
      tests/unit/socket-helpers.h
  30. 0
      tests/unit/test-aio-multithread.c
  31. 0
      tests/unit/test-aio.c
  32. 0
      tests/unit/test-authz-list.c
  33. 0
      tests/unit/test-authz-listfile.c
  34. 0
      tests/unit/test-authz-pam.c
  35. 0
      tests/unit/test-authz-simple.c
  36. 0
      tests/unit/test-base64.c
  37. 0
      tests/unit/test-bdrv-drain.c
  38. 0
      tests/unit/test-bdrv-graph-mod.c
  39. 0
      tests/unit/test-bitcnt.c
  40. 0
      tests/unit/test-bitmap.c
  41. 0
      tests/unit/test-bitops.c
  42. 0
      tests/unit/test-block-backend.c
  43. 0
      tests/unit/test-block-iothread.c
  44. 0
      tests/unit/test-blockjob-txn.c
  45. 0
      tests/unit/test-blockjob.c
  46. 0
      tests/unit/test-bufferiszero.c
  47. 0
      tests/unit/test-char.c
  48. 0
      tests/unit/test-clone-visitor.c
  49. 0
      tests/unit/test-coroutine.c
  50. 0
      tests/unit/test-crypto-afsplit.c
  51. 0
      tests/unit/test-crypto-block.c
  52. 0
      tests/unit/test-crypto-cipher.c
  53. 0
      tests/unit/test-crypto-hash.c
  54. 0
      tests/unit/test-crypto-hmac.c
  55. 0
      tests/unit/test-crypto-ivgen.c
  56. 0
      tests/unit/test-crypto-pbkdf.c
  57. 0
      tests/unit/test-crypto-secret.c
  58. 0
      tests/unit/test-crypto-tlscredsx509.c
  59. 0
      tests/unit/test-crypto-tlssession.c
  60. 0
      tests/unit/test-crypto-xts.c
  61. 0
      tests/unit/test-cutils.c
  62. 0
      tests/unit/test-fdmon-epoll.c
  63. 0
      tests/unit/test-hbitmap.c
  64. 0
      tests/unit/test-image-locking.c
  65. 0
      tests/unit/test-int128.c
  66. 0
      tests/unit/test-io-channel-buffer.c
  67. 0
      tests/unit/test-io-channel-command.c
  68. 0
      tests/unit/test-io-channel-file.c
  69. 0
      tests/unit/test-io-channel-socket.c
  70. 0
      tests/unit/test-io-channel-tls.c
  71. 0
      tests/unit/test-io-task.c
  72. 0
      tests/unit/test-iov.c
  73. 0
      tests/unit/test-keyval.c
  74. 0
      tests/unit/test-logging.c
  75. 0
      tests/unit/test-mul64.c
  76. 0
      tests/unit/test-opts-visitor.c
  77. 0
      tests/unit/test-qapi-util.c
  78. 0
      tests/unit/test-qdev-global-props.c
  79. 0
      tests/unit/test-qdist.c
  80. 0
      tests/unit/test-qemu-opts.c
  81. 2
      tests/unit/test-qga.c
  82. 4
      tests/unit/test-qgraph.c
  83. 0
      tests/unit/test-qht.c
  84. 0
      tests/unit/test-qmp-cmds.c
  85. 0
      tests/unit/test-qmp-event.c
  86. 0
      tests/unit/test-qobject-input-visitor.c
  87. 0
      tests/unit/test-qobject-output-visitor.c
  88. 0
      tests/unit/test-rcu-list.c
  89. 0
      tests/unit/test-rcu-simpleq.c
  90. 0
      tests/unit/test-rcu-slist.c
  91. 0
      tests/unit/test-rcu-tailq.c
  92. 0
      tests/unit/test-replication.c
  93. 0
      tests/unit/test-shift128.c
  94. 0
      tests/unit/test-string-input-visitor.c
  95. 0
      tests/unit/test-string-output-visitor.c
  96. 0
      tests/unit/test-thread-pool.c
  97. 0
      tests/unit/test-throttle.c
  98. 0
      tests/unit/test-timed-average.c
  99. 0
      tests/unit/test-util-filemonitor.c
  100. 0
      tests/unit/test-util-sockets.c

68
MAINTAINERS

@ -1537,7 +1537,7 @@ F: include/hw/southbridge/piix.h
F: hw/misc/sga.c
F: hw/isa/apm.c
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
PC Chipset
@ -2212,7 +2212,7 @@ F: qemu-io*
F: tests/qemu-iotests/
F: util/qemu-progress.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
Storage daemon
@ -2238,7 +2238,7 @@ F: migration/block*
F: include/block/aio.h
F: include/block/aio-wait.h
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
Block SCSI subsystem
@ -2298,7 +2298,7 @@ F: block/dirty-bitmap.c
F: block/qcow2-bitmap.c
F: migration/block-dirty-bitmap.c
F: util/hbitmap.c
F: tests/test-hbitmap.c
F: tests/unit/test-hbitmap.c
F: docs/interop/bitmaps.rst
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>
S: Supported
F: include/qemu/option.h
F: tests/test-keyval.c
F: tests/test-qemu-opts.c
F: tests/unit/test-keyval.c
F: tests/unit/test-qemu-opts.c
F: util/keyval.c
F: util/qemu-option.c
@ -2438,8 +2438,8 @@ Read, Copy, Update (RCU)
M: Paolo Bonzini <pbonzini@redhat.com>
S: Maintained
F: include/qemu/rcu*.h
F: tests/rcutorture.c
F: tests/test-rcu-*.c
F: tests/unit/rcutorture.c
F: tests/unit/test-rcu-*.c
F: util/rcu.c
Human Monitor (HMP)
@ -2517,10 +2517,10 @@ F: include/qapi/
X: include/qapi/qmp/
F: include/qapi/qmp/dispatch.h
F: tests/qapi-schema/
F: tests/test-*-visitor.c
F: tests/test-qapi-*.c
F: tests/test-qmp-*.c
F: tests/test-visitor-serialization.c
F: tests/unit/test-*-visitor.c
F: tests/unit/test-qapi-*.c
F: tests/unit/test-qmp-*.c
F: tests/unit/test-visitor-serialization.c
F: scripts/qapi-gen.py
F: scripts/qapi/*
F: docs/sphinx/qapidoc.py
@ -2541,14 +2541,14 @@ F: qobject/
F: include/qapi/qmp/
X: include/qapi/qmp/dispatch.h
F: scripts/coccinelle/qobject.cocci
F: tests/check-qdict.c
F: tests/check-qjson.c
F: tests/check-qlist.c
F: tests/check-qlit.c
F: tests/check-qnull.c
F: tests/check-qnum.c
F: tests/check-qobject.c
F: tests/check-qstring.c
F: tests/unit/check-qdict.c
F: tests/unit/check-qjson.c
F: tests/unit/check-qlist.c
F: tests/unit/check-qlit.c
F: tests/unit/check-qnull.c
F: tests/unit/check-qnum.c
F: tests/unit/check-qobject.c
F: tests/unit/check-qstring.c
F: tests/data/qobject/qdict.txt
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-ref.rst
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
QOM
@ -2580,9 +2580,9 @@ F: scripts/coccinelle/qom-parent-type.cocci
F: softmmu/qdev-monitor.c
F: stubs/qdev.c
F: qom/
F: tests/check-qom-interface.c
F: tests/check-qom-proplist.c
F: tests/test-qdev-global-props.c
F: tests/unit/check-qom-interface.c
F: tests/unit/check-qom-proplist.c
F: tests/unit/test-qdev-global-props.c
QOM boilerplate conversion script
M: Eduardo Habkost <ehabkost@redhat.com>
@ -2721,10 +2721,10 @@ S: Maintained
F: crypto/
F: include/crypto/
F: qapi/crypto.json
F: tests/test-crypto-*
F: tests/unit/test-crypto-*
F: tests/benchmark-crypto-*
F: tests/crypto-tls-*
F: tests/pkix_asn1_tab.c
F: tests/unit/crypto-tls-*
F: tests/unit/pkix_asn1_tab.c
F: qemu.sasl
Coroutines
@ -2733,7 +2733,7 @@ M: Kevin Wolf <kwolf@redhat.com>
S: Maintained
F: util/*coroutine*
F: include/qemu/coroutine*
F: tests/test-coroutine.c
F: tests/unit/test-coroutine.c
Buffers
M: Daniel P. Berrange <berrange@redhat.com>
@ -2746,7 +2746,7 @@ M: Daniel P. Berrange <berrange@redhat.com>
S: Maintained
F: io/
F: include/io/
F: tests/test-io-*
F: tests/unit/test-io-*
User authorization
M: Daniel P. Berrange <berrange@redhat.com>
@ -2754,7 +2754,7 @@ S: Maintained
F: authz/
F: qapi/authz.json
F: include/authz/
F: tests/test-authz-*
F: tests/unit/test-authz-*
Sockets
M: Daniel P. Berrange <berrange@redhat.com>
@ -2769,7 +2769,7 @@ M: Daniel P. Berrange <berrange@redhat.com>
S: Odd Fixes
F: util/filemonitor*.c
F: include/qemu/filemonitor.h
F: tests/test-util-filemonitor.c
F: tests/unit/test-util-filemonitor.c
Throttling infrastructure
M: Alberto Garcia <berto@igalia.com>
@ -2779,7 +2779,7 @@ F: include/block/throttle-groups.h
F: include/qemu/throttle*.h
F: util/throttle.c
F: docs/throttle.txt
F: tests/test-throttle.c
F: tests/unit/test-throttle.c
L: qemu-block@nongnu.org
UUID
@ -2787,7 +2787,7 @@ M: Fam Zheng <fam@euphon.net>
S: Supported
F: util/uuid.c
F: include/qemu/uuid.h
F: tests/test-uuid.c
F: tests/unit/test-uuid.c
Yank feature
M: Lukas Straub <lukasstraub2@web.de>
@ -3237,7 +3237,7 @@ M: Xie Changlong <xiechanglong.d@gmail.com>
S: Supported
F: replication*
F: block/replication.c
F: tests/test-replication.c
F: tests/unit/test-replication.c
F: docs/block-replication.txt
PVRDMA

182
tests/meson.build

@ -69,59 +69,6 @@ endforeach
libtestqapi = static_library('testqapi', sources: [genh, test_qapi_sources])
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-qht-par': qht_bench,
}
@ -129,65 +76,6 @@ test_deps = {
benchs = {}
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 += {
'benchmark-crypto-hash': [crypto],
'benchmark-crypto-hmac': [crypto],
@ -195,75 +83,6 @@ if have_block
}
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
exe = executable(bench_name, bench_name + '.c',
dependencies: [qemuutil] + deps)
@ -299,6 +118,7 @@ if not get_option('tcg').disabled()
endif
endif
subdir('unit')
subdir('qapi-schema')
subdir('qtest')
subdir('migration')

0
tests/check-block-qdict.c → tests/unit/check-block-qdict.c

0
tests/check-qdict.c → tests/unit/check-qdict.c

0
tests/check-qjson.c → tests/unit/check-qjson.c

0
tests/check-qlist.c → tests/unit/check-qlist.c

0
tests/check-qlit.c → tests/unit/check-qlit.c

0
tests/check-qnull.c → tests/unit/check-qnull.c

0
tests/check-qnum.c → tests/unit/check-qnum.c

0
tests/check-qobject.c → tests/unit/check-qobject.c

0
tests/check-qom-interface.c → tests/unit/check-qom-interface.c

0
tests/check-qom-proplist.c → tests/unit/check-qom-proplist.c

0
tests/check-qstring.c → tests/unit/check-qstring.c

0
tests/crypto-tls-psk-helpers.c → tests/unit/crypto-tls-psk-helpers.c

0
tests/crypto-tls-psk-helpers.h → tests/unit/crypto-tls-psk-helpers.h

0
tests/crypto-tls-x509-helpers.c → tests/unit/crypto-tls-x509-helpers.c

0
tests/crypto-tls-x509-helpers.h → tests/unit/crypto-tls-x509-helpers.h

0
tests/io-channel-helpers.c → tests/unit/io-channel-helpers.c

0
tests/io-channel-helpers.h → tests/unit/io-channel-helpers.h

0
tests/iothread.c → tests/unit/iothread.c

0
tests/iothread.h → tests/unit/iothread.h

184
tests/unit/meson.build

@ -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

2
tests/pkix_asn1_tab.c → tests/unit/pkix_asn1_tab.c

@ -4,7 +4,7 @@
*/
#include "qemu/osdep.h"
#include "tests/crypto-tls-x509-helpers.h"
#include "crypto-tls-x509-helpers.h"
#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT

0
tests/ptimer-test-stubs.c → tests/unit/ptimer-test-stubs.c

0
tests/ptimer-test.c → tests/unit/ptimer-test.c

0
tests/ptimer-test.h → tests/unit/ptimer-test.h

0
tests/rcutorture.c → tests/unit/rcutorture.c

0
tests/socket-helpers.c → tests/unit/socket-helpers.c

0
tests/socket-helpers.h → tests/unit/socket-helpers.h

0
tests/test-aio-multithread.c → tests/unit/test-aio-multithread.c

0
tests/test-aio.c → tests/unit/test-aio.c

0
tests/test-authz-list.c → tests/unit/test-authz-list.c

0
tests/test-authz-listfile.c → tests/unit/test-authz-listfile.c

0
tests/test-authz-pam.c → tests/unit/test-authz-pam.c

0
tests/test-authz-simple.c → tests/unit/test-authz-simple.c

0
tests/test-base64.c → tests/unit/test-base64.c

0
tests/test-bdrv-drain.c → tests/unit/test-bdrv-drain.c

0
tests/test-bdrv-graph-mod.c → tests/unit/test-bdrv-graph-mod.c

0
tests/test-bitcnt.c → tests/unit/test-bitcnt.c

0
tests/test-bitmap.c → tests/unit/test-bitmap.c

0
tests/test-bitops.c → tests/unit/test-bitops.c

0
tests/test-block-backend.c → tests/unit/test-block-backend.c

0
tests/test-block-iothread.c → tests/unit/test-block-iothread.c

0
tests/test-blockjob-txn.c → tests/unit/test-blockjob-txn.c

0
tests/test-blockjob.c → tests/unit/test-blockjob.c

0
tests/test-bufferiszero.c → tests/unit/test-bufferiszero.c

0
tests/test-char.c → tests/unit/test-char.c

0
tests/test-clone-visitor.c → tests/unit/test-clone-visitor.c

0
tests/test-coroutine.c → tests/unit/test-coroutine.c

0
tests/test-crypto-afsplit.c → tests/unit/test-crypto-afsplit.c

0
tests/test-crypto-block.c → tests/unit/test-crypto-block.c

0
tests/test-crypto-cipher.c → tests/unit/test-crypto-cipher.c

0
tests/test-crypto-hash.c → tests/unit/test-crypto-hash.c

0
tests/test-crypto-hmac.c → tests/unit/test-crypto-hmac.c

0
tests/test-crypto-ivgen.c → tests/unit/test-crypto-ivgen.c

0
tests/test-crypto-pbkdf.c → tests/unit/test-crypto-pbkdf.c

0
tests/test-crypto-secret.c → tests/unit/test-crypto-secret.c

0
tests/test-crypto-tlscredsx509.c → tests/unit/test-crypto-tlscredsx509.c

0
tests/test-crypto-tlssession.c → tests/unit/test-crypto-tlssession.c

0
tests/test-crypto-xts.c → tests/unit/test-crypto-xts.c

0
tests/test-cutils.c → tests/unit/test-cutils.c

0
tests/test-fdmon-epoll.c → tests/unit/test-fdmon-epoll.c

0
tests/test-hbitmap.c → tests/unit/test-hbitmap.c

0
tests/test-image-locking.c → tests/unit/test-image-locking.c

0
tests/test-int128.c → tests/unit/test-int128.c

0
tests/test-io-channel-buffer.c → tests/unit/test-io-channel-buffer.c

0
tests/test-io-channel-command.c → tests/unit/test-io-channel-command.c

0
tests/test-io-channel-file.c → tests/unit/test-io-channel-file.c

0
tests/test-io-channel-socket.c → tests/unit/test-io-channel-socket.c

0
tests/test-io-channel-tls.c → tests/unit/test-io-channel-tls.c

0
tests/test-io-task.c → tests/unit/test-io-task.c

0
tests/test-iov.c → tests/unit/test-iov.c

0
tests/test-keyval.c → tests/unit/test-keyval.c

0
tests/test-logging.c → tests/unit/test-logging.c

0
tests/test-mul64.c → tests/unit/test-mul64.c

0
tests/test-opts-visitor.c → tests/unit/test-opts-visitor.c

0
tests/test-qapi-util.c → tests/unit/test-qapi-util.c

0
tests/test-qdev-global-props.c → tests/unit/test-qdev-global-props.c

0
tests/test-qdist.c → tests/unit/test-qdist.c

0
tests/test-qemu-opts.c → tests/unit/test-qemu-opts.c

2
tests/test-qga.c → tests/unit/test-qga.c

@ -4,7 +4,7 @@
#include <sys/socket.h>
#include <sys/un.h>
#include "qtest/libqos/libqtest.h"
#include "../qtest/libqos/libqtest.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qlist.h"

4
tests/test-qgraph.c → tests/unit/test-qgraph.c

@ -17,8 +17,8 @@
*/
#include "qemu/osdep.h"
#include "qtest/libqos/qgraph.h"
#include "qtest/libqos/qgraph_internal.h"
#include "../qtest/libqos/qgraph.h"
#include "../qtest/libqos/qgraph_internal.h"
#define MACHINE_PC "x86_64/pc"
#define MACHINE_RASPI2 "arm/raspi2"

0
tests/test-qht.c → tests/unit/test-qht.c

0
tests/test-qmp-cmds.c → tests/unit/test-qmp-cmds.c

0
tests/test-qmp-event.c → tests/unit/test-qmp-event.c

0
tests/test-qobject-input-visitor.c → tests/unit/test-qobject-input-visitor.c

0
tests/test-qobject-output-visitor.c → tests/unit/test-qobject-output-visitor.c

0
tests/test-rcu-list.c → tests/unit/test-rcu-list.c

0
tests/test-rcu-simpleq.c → tests/unit/test-rcu-simpleq.c

0
tests/test-rcu-slist.c → tests/unit/test-rcu-slist.c

0
tests/test-rcu-tailq.c → tests/unit/test-rcu-tailq.c

0
tests/test-replication.c → tests/unit/test-replication.c

0
tests/test-shift128.c → tests/unit/test-shift128.c

0
tests/test-string-input-visitor.c → tests/unit/test-string-input-visitor.c

0
tests/test-string-output-visitor.c → tests/unit/test-string-output-visitor.c

0
tests/test-thread-pool.c → tests/unit/test-thread-pool.c

0
tests/test-throttle.c → tests/unit/test-throttle.c

0
tests/test-timed-average.c → tests/unit/test-timed-average.c

0
tests/test-util-filemonitor.c → tests/unit/test-util-filemonitor.c

0
tests/test-util-sockets.c → tests/unit/test-util-sockets.c

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save