1279588d4SMarc-André Lureaupy3 = import('python').find_installation() 2279588d4SMarc-André Lureau 3a9726a90SMarc-André Lureauqht_bench = executable('qht-bench', 4279588d4SMarc-André Lureau sources: 'qht-bench.c', 5a9726a90SMarc-André Lureau dependencies: [qemuutil]) 6a9726a90SMarc-André Lureau 7*a52f4a7aSMarc-André Lureauexecutable('atomic_add-bench', 8*a52f4a7aSMarc-André Lureau sources: files('atomic_add-bench.c'), 9*a52f4a7aSMarc-André Lureau dependencies: [qemuutil], 10*a52f4a7aSMarc-André Lureau build_by_default: false) 11*a52f4a7aSMarc-André Lureau 12*a52f4a7aSMarc-André Lureauexecutable('atomic64-bench', 13*a52f4a7aSMarc-André Lureau sources: files('atomic64-bench.c'), 14*a52f4a7aSMarc-André Lureau dependencies: [qemuutil], 15*a52f4a7aSMarc-André Lureau build_by_default: false) 16*a52f4a7aSMarc-André Lureau 1737e27776SMarc-André Lureautest_qapi_outputs = [ 1837e27776SMarc-André Lureau 'qapi-builtin-types.c', 1937e27776SMarc-André Lureau 'qapi-builtin-types.h', 2037e27776SMarc-André Lureau 'qapi-builtin-visit.c', 2137e27776SMarc-André Lureau 'qapi-builtin-visit.h', 2237e27776SMarc-André Lureau 'test-qapi-commands-sub-sub-module.c', 2337e27776SMarc-André Lureau 'test-qapi-commands-sub-sub-module.h', 2437e27776SMarc-André Lureau 'test-qapi-commands.c', 2537e27776SMarc-André Lureau 'test-qapi-commands.h', 2637e27776SMarc-André Lureau 'test-qapi-emit-events.c', 2737e27776SMarc-André Lureau 'test-qapi-emit-events.h', 2837e27776SMarc-André Lureau 'test-qapi-events-sub-sub-module.c', 2937e27776SMarc-André Lureau 'test-qapi-events-sub-sub-module.h', 3037e27776SMarc-André Lureau 'test-qapi-events.c', 3137e27776SMarc-André Lureau 'test-qapi-events.h', 3237e27776SMarc-André Lureau 'test-qapi-init-commands.c', 3337e27776SMarc-André Lureau 'test-qapi-init-commands.h', 3437e27776SMarc-André Lureau 'test-qapi-introspect.c', 3537e27776SMarc-André Lureau 'test-qapi-introspect.h', 3637e27776SMarc-André Lureau 'test-qapi-types-sub-sub-module.c', 3737e27776SMarc-André Lureau 'test-qapi-types-sub-sub-module.h', 3837e27776SMarc-André Lureau 'test-qapi-types.c', 3937e27776SMarc-André Lureau 'test-qapi-types.h', 4037e27776SMarc-André Lureau 'test-qapi-visit-sub-sub-module.c', 4137e27776SMarc-André Lureau 'test-qapi-visit-sub-sub-module.h', 4237e27776SMarc-André Lureau 'test-qapi-visit.c', 4337e27776SMarc-André Lureau 'test-qapi-visit.h', 4437e27776SMarc-André Lureau] 4537e27776SMarc-André Lureau 4637e27776SMarc-André Lureautest_qapi_files = custom_target('Test QAPI files', 4737e27776SMarc-André Lureau output: test_qapi_outputs, 4837e27776SMarc-André Lureau input: files('qapi-schema/qapi-schema-test.json', 4937e27776SMarc-André Lureau 'qapi-schema/include/sub-module.json', 5037e27776SMarc-André Lureau 'qapi-schema/sub-sub-module.json'), 5137e27776SMarc-André Lureau command: [ qapi_gen, '-o', meson.current_build_dir(), 5237e27776SMarc-André Lureau '-b', '-p', 'test-', '@INPUT0@' ], 5337e27776SMarc-André Lureau depend_files: qapi_gen_depends) 5437e27776SMarc-André Lureau 5537e27776SMarc-André Lureau# meson doesn't like generated output in other directories 5637e27776SMarc-André Lureau# perhaps change qapi_gen to replace / with _, like Meson itself does? 5737e27776SMarc-André Lureausubdir('include') 5837e27776SMarc-André Lureau 5937e27776SMarc-André Lureaulibtestqapi = static_library('testqapi', sources: [test_qapi_files, test_qapi_outputs_extra]) 6037e27776SMarc-André Lureautestqapi = declare_dependency(link_with: libtestqapi) 6137e27776SMarc-André Lureau 62279588d4SMarc-André Lureautestblock = declare_dependency(dependencies: [block], sources: 'iothread.c') 63279588d4SMarc-André Lureau 64279588d4SMarc-André Lureautests = { 65279588d4SMarc-André Lureau 'check-block-qdict': [], 66279588d4SMarc-André Lureau 'check-qdict': [], 67279588d4SMarc-André Lureau 'check-qnum': [], 68279588d4SMarc-André Lureau 'check-qstring': [], 69279588d4SMarc-André Lureau 'check-qlist': [], 70279588d4SMarc-André Lureau 'check-qnull': [], 71279588d4SMarc-André Lureau 'check-qobject': [], 72279588d4SMarc-André Lureau 'check-qjson': [], 73279588d4SMarc-André Lureau 'check-qlit': [], 74279588d4SMarc-André Lureau 'test-qobject-output-visitor': [testqapi], 75279588d4SMarc-André Lureau 'test-clone-visitor': [testqapi], 76279588d4SMarc-André Lureau 'test-qobject-input-visitor': [testqapi], 77279588d4SMarc-André Lureau 'test-string-input-visitor': [testqapi], 78279588d4SMarc-André Lureau 'test-string-output-visitor': [testqapi], 79279588d4SMarc-André Lureau 'test-qmp-event': [testqapi], 80279588d4SMarc-André Lureau 'test-opts-visitor': [testqapi], 81279588d4SMarc-André Lureau 'test-visitor-serialization': [testqapi], 82279588d4SMarc-André Lureau 'test-bitmap': [], 83279588d4SMarc-André Lureau # all code tested by test-x86-cpuid is inside topology.h 84279588d4SMarc-André Lureau 'test-x86-cpuid': [], 85279588d4SMarc-André Lureau 'test-cutils': [], 86279588d4SMarc-André Lureau 'test-shift128': [], 87279588d4SMarc-André Lureau 'test-mul64': [], 88279588d4SMarc-André Lureau # all code tested by test-int128 is inside int128.h 89279588d4SMarc-André Lureau 'test-int128': [], 90279588d4SMarc-André Lureau 'rcutorture': [], 91279588d4SMarc-André Lureau 'test-rcu-list': [], 92279588d4SMarc-André Lureau 'test-rcu-simpleq': [], 93279588d4SMarc-André Lureau 'test-rcu-tailq': [], 94279588d4SMarc-André Lureau 'test-rcu-slist': [], 95279588d4SMarc-André Lureau 'test-qdist': [], 96279588d4SMarc-André Lureau 'test-qht': [], 97279588d4SMarc-André Lureau 'test-bitops': [], 98279588d4SMarc-André Lureau 'test-bitcnt': [], 99279588d4SMarc-André Lureau 'test-qgraph': ['qtest/libqos/qgraph.c'], 100279588d4SMarc-André Lureau 'check-qom-interface': [qom], 101279588d4SMarc-André Lureau 'check-qom-proplist': [qom], 102279588d4SMarc-André Lureau 'test-qemu-opts': [], 103279588d4SMarc-André Lureau 'test-keyval': [testqapi], 104279588d4SMarc-André Lureau 'test-logging': [], 105279588d4SMarc-André Lureau 'test-uuid': [], 106279588d4SMarc-André Lureau 'ptimer-test': ['ptimer-test-stubs.c', meson.source_root() / 'hw/core/ptimer.c'], 107279588d4SMarc-André Lureau 'test-qapi-util': [], 108279588d4SMarc-André Lureau} 109279588d4SMarc-André Lureau 110279588d4SMarc-André Lureautest_deps = { 111279588d4SMarc-André Lureau 'test-qht-par': qht_bench, 112279588d4SMarc-André Lureau} 113279588d4SMarc-André Lureau 114279588d4SMarc-André Lureauif have_block 115279588d4SMarc-André Lureau tests += { 116279588d4SMarc-André Lureau 'test-coroutine': [testblock], 117279588d4SMarc-André Lureau 'test-aio': [testblock], 118279588d4SMarc-André Lureau 'test-aio-multithread': [testblock], 119279588d4SMarc-André Lureau 'test-throttle': [testblock], 120279588d4SMarc-André Lureau 'test-thread-pool': [testblock], 121279588d4SMarc-André Lureau 'test-hbitmap': [testblock], 122279588d4SMarc-André Lureau 'test-bdrv-drain': [testblock], 123279588d4SMarc-André Lureau 'test-bdrv-graph-mod': [testblock], 124279588d4SMarc-André Lureau 'test-blockjob': [testblock], 125279588d4SMarc-André Lureau 'test-blockjob-txn': [testblock], 126279588d4SMarc-André Lureau 'test-block-backend': [testblock], 127279588d4SMarc-André Lureau 'test-block-iothread': [testblock], 128279588d4SMarc-André Lureau 'test-write-threshold': [testblock], 129279588d4SMarc-André Lureau 'test-crypto-hash': [crypto], 130279588d4SMarc-André Lureau 'test-crypto-hmac': [crypto], 131279588d4SMarc-André Lureau 'test-crypto-cipher': [crypto], 132279588d4SMarc-André Lureau 'test-crypto-secret': [crypto, keyutils], 133279588d4SMarc-André Lureau 'test-authz-simple': [authz], 134279588d4SMarc-André Lureau 'test-authz-list': [authz], 135279588d4SMarc-André Lureau 'test-authz-listfile': [authz], 136279588d4SMarc-André Lureau 'test-io-task': [testblock], 137279588d4SMarc-André Lureau 'test-io-channel-socket': ['socket-helpers.c', 'io-channel-helpers.c', io], 138279588d4SMarc-André Lureau 'test-io-channel-file': ['io-channel-helpers.c', io], 139279588d4SMarc-André Lureau 'test-io-channel-command': ['io-channel-helpers.c', io], 140279588d4SMarc-André Lureau 'test-io-channel-buffer': ['io-channel-helpers.c', io], 141279588d4SMarc-André Lureau 'test-crypto-ivgen': [io], 142279588d4SMarc-André Lureau 'test-crypto-afsplit': [io], 143279588d4SMarc-André Lureau 'test-crypto-block': [io], 144279588d4SMarc-André Lureau } 145279588d4SMarc-André Lureau if 'CONFIG_GNUTLS' in config_host and \ 146279588d4SMarc-André Lureau 'CONFIG_TASN1' in config_host 147279588d4SMarc-André Lureau tests += { 148279588d4SMarc-André Lureau 'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 149279588d4SMarc-André Lureau tasn1, crypto], 150279588d4SMarc-André Lureau 'test-crypto-tlssession': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c', 151279588d4SMarc-André Lureau tasn1, crypto], 152279588d4SMarc-André Lureau 'test-io-channel-tls': ['io-channel-helpers.c', 'crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 153279588d4SMarc-André Lureau tasn1, io, crypto]} 154279588d4SMarc-André Lureau endif 155279588d4SMarc-André Lureau if 'CONFIG_AUTH_PAM' in config_host 156279588d4SMarc-André Lureau tests += {'test-authz-pam': [authz]} 157279588d4SMarc-André Lureau endif 158279588d4SMarc-André Lureau if 'CONFIG_QEMU_PRIVATE_XTS' in config_host 159279588d4SMarc-André Lureau tests += {'test-crypto-xts': [crypto, io]} 160279588d4SMarc-André Lureau endif 161279588d4SMarc-André Lureau if 'CONFIG_POSIX' in config_host 162279588d4SMarc-André Lureau tests += {'test-image-locking': [testblock]} 163279588d4SMarc-André Lureau endif 164279588d4SMarc-André Lureau if 'CONFIG_REPLICATION' in config_host 165279588d4SMarc-André Lureau tests += {'test-replication': [testblock]} 166279588d4SMarc-André Lureau endif 167279588d4SMarc-André Lureau if 'CONFIG_NETTLE' in config_host or 'CONFIG_GCRYPT' in config_host 168279588d4SMarc-André Lureau tests += {'test-crypto-pbkdf': [io]} 169279588d4SMarc-André Lureau endif 170279588d4SMarc-André Lureauendif 171279588d4SMarc-André Lureau 172279588d4SMarc-André Lureauif have_system 173279588d4SMarc-André Lureau tests += { 174279588d4SMarc-André Lureau 'test-iov': [], 175279588d4SMarc-André Lureau 'test-qmp-cmds': [testqapi], 176279588d4SMarc-André Lureau 'test-xbzrle': [migration], 177279588d4SMarc-André Lureau 'test-timed-average': [], 178279588d4SMarc-André Lureau 'test-util-sockets': ['socket-helpers.c'], 179279588d4SMarc-André Lureau 'test-base64': [], 180279588d4SMarc-André Lureau 'test-bufferiszero': [], 181279588d4SMarc-André Lureau 'test-vmstate': [migration, io] 182279588d4SMarc-André Lureau } 183279588d4SMarc-André Lureau if 'CONFIG_INOTIFY1' in config_host 184279588d4SMarc-André Lureau tests += {'test-util-filemonitor': []} 185279588d4SMarc-André Lureau endif 186279588d4SMarc-André Lureau 187279588d4SMarc-André Lureau # Some tests: test-char, test-qdev-global-props, and test-qga, 188279588d4SMarc-André Lureau # are not runnable under TSan due to a known issue. 189279588d4SMarc-André Lureau # https://github.com/google/sanitizers/issues/1116 190279588d4SMarc-André Lureau if 'CONFIG_TSAN' not in config_host 191279588d4SMarc-André Lureau tests += { 192279588d4SMarc-André Lureau 'test-char': ['socket-helpers.c', qom, io, chardev], 193279588d4SMarc-André Lureau 'test-qdev-global-props': [qom, hwcore, testqapi] 194279588d4SMarc-André Lureau } 195279588d4SMarc-André Lureau endif 196279588d4SMarc-André Lureauendif 197279588d4SMarc-André Lureau 198279588d4SMarc-André Lureauif 'CONFIG_TSAN' not in config_host and \ 199279588d4SMarc-André Lureau 'CONFIG_GUEST_AGENT' in config_host and \ 200279588d4SMarc-André Lureau 'CONFIG_LINUX' in config_host 201279588d4SMarc-André Lureau tests += {'test-qga': ['qtest/libqtest.c']} 202279588d4SMarc-André Lureau test_deps += {'test-qga': qga} 203279588d4SMarc-André Lureauendif 204279588d4SMarc-André Lureau 205279588d4SMarc-André Lureautest_env = environment() 206279588d4SMarc-André Lureautest_env.set('G_TEST_SRCDIR', meson.current_source_dir()) 207279588d4SMarc-André Lureautest_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) 208279588d4SMarc-André Lureau 209279588d4SMarc-André Lureauforeach test_name, extra: tests 210279588d4SMarc-André Lureau src = [test_name + '.c'] 211279588d4SMarc-André Lureau deps = [qemuutil] 212279588d4SMarc-André Lureau if extra.length() > 0 213279588d4SMarc-André Lureau # use a sourceset to quickly separate sources and deps 214279588d4SMarc-André Lureau test_ss = ss.source_set() 215279588d4SMarc-André Lureau test_ss.add(extra) 216279588d4SMarc-André Lureau src += test_ss.all_sources() 217279588d4SMarc-André Lureau deps += test_ss.all_dependencies() 218279588d4SMarc-André Lureau endif 219279588d4SMarc-André Lureau exe = executable(test_name, src, dependencies: deps) 220279588d4SMarc-André Lureau 221279588d4SMarc-André Lureau test(test_name, exe, 222279588d4SMarc-André Lureau depends: test_deps.get(test_name, []), 223279588d4SMarc-André Lureau env: test_env, 224279588d4SMarc-André Lureau args: ['--tap', '-k'], 225279588d4SMarc-André Lureau protocol: 'tap', 226279588d4SMarc-André Lureau suite: ['unit']) 227279588d4SMarc-André Lureauendforeach 228279588d4SMarc-André Lureau 22989d4dc8fSMarc-André Lureau 23089d4dc8fSMarc-André Lureauif have_tools and 'CONFIG_VHOST_USER' in config_host 23189d4dc8fSMarc-André Lureau executable('vhost-user-bridge', 23289d4dc8fSMarc-André Lureau sources: files('vhost-user-bridge.c'), 23389d4dc8fSMarc-André Lureau link_with: [libvhost_user], 23489d4dc8fSMarc-André Lureau dependencies: [qemuutil], 23589d4dc8fSMarc-André Lureau build_by_default: false) 23689d4dc8fSMarc-André Lureauendif 23789d4dc8fSMarc-André Lureau 238d3ca592bSPaolo Bonziniif have_system and 'CONFIG_POSIX' in config_host 239d3ca592bSPaolo Bonzini subdir('qemu-iotests') 240d3ca592bSPaolo Bonziniendif 241d3ca592bSPaolo Bonzini 242ce1c1e7aSPaolo Bonzinitest('decodetree', sh, 243ce1c1e7aSPaolo Bonzini args: [ files('decode/check.sh'), config_host['PYTHON'], files('../scripts/decodetree.py') ], 244ce1c1e7aSPaolo Bonzini workdir: meson.current_source_dir() / 'decode', 245ce1c1e7aSPaolo Bonzini suite: 'decodetree') 2463941996bSPaolo Bonzini 2473941996bSPaolo Bonziniif 'CONFIG_TCG' in config_host 2483941996bSPaolo Bonzini subdir('fp') 249ffac93dfSPaolo Bonzini if 'CONFIG_PLUGIN' in config_host 250ffac93dfSPaolo Bonzini subdir('plugin') 251ffac93dfSPaolo Bonzini endif 2523941996bSPaolo Bonziniendif 2533afe7ab0SPaolo Bonzini 2543afe7ab0SPaolo Bonzinisubdir('qapi-schema') 255a2ce7dbdSPaolo Bonzinisubdir('qtest') 256