summaryrefslogtreecommitdiffstats
path: root/tests/unit/meson.build
diff options
context:
space:
mode:
authorPeter Maydell2021-03-14 16:13:53 +0100
committerPeter Maydell2021-03-14 16:13:53 +0100
commit757acb9a8295e8be4a37b2cfc1cd947e357fd29c (patch)
tree881fdcb812a8b8d067d5cb59832b3bb31ce9bcf9 /tests/unit/meson.build
parentMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20210314'... (diff)
parentREADME: Add Documentation blurb (diff)
downloadqemu-757acb9a8295e8be4a37b2cfc1cd947e357fd29c.tar.gz
qemu-757acb9a8295e8be4a37b2cfc1cd947e357fd29c.tar.xz
qemu-757acb9a8295e8be4a37b2cfc1cd947e357fd29c.zip
Merge remote-tracking branch 'remotes/thuth-gitlab/tags/pull-request-2021-03-12' into staging
* Move unit and bench tests into separate directories * Clean-up and improve gitlab-ci jobs * Drop the non-working "check-speed" makefile target * Minor documentation updates # gpg: Signature made Fri 12 Mar 2021 17:18:45 GMT # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * remotes/thuth-gitlab/tags/pull-request-2021-03-12: README: Add Documentation blurb MAINTAINERS: Merge the Gitlab-CI section into the generic CI section tests: remove "make check-speed" in favor of "make bench" gitlab-ci.yml: Merge check-crypto-old jobs into the build-crypto-old jobs gitlab-ci.yml: Merge one of the coroutine jobs with the tcg-disabled job gitlab-ci.yml: Add some missing dependencies to the jobs gitlab-ci.yml: Move build-tools-and-docs-debian to a better place tests: Move benchmarks into a separate folder tests: Move unit tests into a separate directory Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/unit/meson.build')
-rw-r--r--tests/unit/meson.build184
1 files changed, 184 insertions, 0 deletions
diff --git a/tests/unit/meson.build b/tests/unit/meson.build
new file mode 100644
index 0000000000..4bfe4627ba
--- /dev/null
+++ b/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