1da668aa1SThomas Huth 2da668aa1SThomas Huthtestblock = declare_dependency(dependencies: [block], sources: 'iothread.c') 3da668aa1SThomas Huth 4da668aa1SThomas Huthtests = { 5da668aa1SThomas Huth 'check-block-qdict': [], 6da668aa1SThomas Huth 'check-qdict': [], 7da668aa1SThomas Huth 'check-qnum': [], 8da668aa1SThomas Huth 'check-qstring': [], 9da668aa1SThomas Huth 'check-qlist': [], 10da668aa1SThomas Huth 'check-qnull': [], 11da668aa1SThomas Huth 'check-qobject': [], 12da668aa1SThomas Huth 'check-qjson': [], 13da668aa1SThomas Huth 'check-qlit': [], 14*6bbee5dbSMarc-André Lureau 'test-error-report': [], 15da668aa1SThomas Huth 'test-qobject-output-visitor': [testqapi], 16da668aa1SThomas Huth 'test-clone-visitor': [testqapi], 17da668aa1SThomas Huth 'test-qobject-input-visitor': [testqapi], 1818fa3ebcSPaolo Bonzini 'test-forward-visitor': [testqapi], 19da668aa1SThomas Huth 'test-string-input-visitor': [testqapi], 20da668aa1SThomas Huth 'test-string-output-visitor': [testqapi], 21da668aa1SThomas Huth 'test-opts-visitor': [testqapi], 22da668aa1SThomas Huth 'test-visitor-serialization': [testqapi], 23da668aa1SThomas Huth 'test-bitmap': [], 24da668aa1SThomas Huth # all code tested by test-x86-cpuid is inside topology.h 25da668aa1SThomas Huth 'test-x86-cpuid': [], 26da668aa1SThomas Huth 'test-cutils': [], 2702346297SLuis Pires 'test-div128': [], 28da668aa1SThomas Huth 'test-shift128': [], 29da668aa1SThomas Huth 'test-mul64': [], 30da668aa1SThomas Huth # all code tested by test-int128 is inside int128.h 31da668aa1SThomas Huth 'test-int128': [], 32da668aa1SThomas Huth 'rcutorture': [], 33da668aa1SThomas Huth 'test-rcu-list': [], 34da668aa1SThomas Huth 'test-rcu-simpleq': [], 35da668aa1SThomas Huth 'test-rcu-tailq': [], 36da668aa1SThomas Huth 'test-rcu-slist': [], 37da668aa1SThomas Huth 'test-qdist': [], 38da668aa1SThomas Huth 'test-qht': [], 39da668aa1SThomas Huth 'test-bitops': [], 40da668aa1SThomas Huth 'test-bitcnt': [], 41da668aa1SThomas Huth 'test-qgraph': ['../qtest/libqos/qgraph.c'], 42da668aa1SThomas Huth 'check-qom-interface': [qom], 43da668aa1SThomas Huth 'check-qom-proplist': [qom], 44da668aa1SThomas Huth 'test-qemu-opts': [], 45da668aa1SThomas Huth 'test-keyval': [testqapi], 46da668aa1SThomas Huth 'test-logging': [], 47da668aa1SThomas Huth 'test-uuid': [], 48654d6b04SPaolo Bonzini 'ptimer-test': ['ptimer-test-stubs.c', meson.project_source_root() / 'hw/core/ptimer.c'], 49da668aa1SThomas Huth 'test-qapi-util': [], 500d99d37aSRichard Henderson 'test-interval-tree': [], 513ef7ff83SDavid Woodhouse 'test-xs-node': [qom], 52da668aa1SThomas Huth} 53da668aa1SThomas Huth 54da668aa1SThomas Huthif have_system or have_tools 55da668aa1SThomas Huth tests += { 56da668aa1SThomas Huth 'test-qmp-event': [testqapi], 57da668aa1SThomas Huth } 58d2ea8dacSDaniel P. Berrangé 59d2ea8dacSDaniel P. Berrangé if seccomp.found() 60d2ea8dacSDaniel P. Berrangé tests += {'test-seccomp': ['../../softmmu/qemu-seccomp.c', seccomp]} 61d2ea8dacSDaniel P. Berrangé endif 62da668aa1SThomas Huthendif 63da668aa1SThomas Huth 64da668aa1SThomas Huthif have_block 65da668aa1SThomas Huth tests += { 66da668aa1SThomas Huth 'test-coroutine': [testblock], 67da668aa1SThomas Huth 'test-aio': [testblock], 68da668aa1SThomas Huth 'test-aio-multithread': [testblock], 69da668aa1SThomas Huth 'test-throttle': [testblock], 70da668aa1SThomas Huth 'test-thread-pool': [testblock], 71da668aa1SThomas Huth 'test-hbitmap': [testblock], 72da668aa1SThomas Huth 'test-bdrv-drain': [testblock], 73da668aa1SThomas Huth 'test-bdrv-graph-mod': [testblock], 74da668aa1SThomas Huth 'test-blockjob': [testblock], 75da668aa1SThomas Huth 'test-blockjob-txn': [testblock], 76da668aa1SThomas Huth 'test-block-backend': [testblock], 77da668aa1SThomas Huth 'test-block-iothread': [testblock], 78da668aa1SThomas Huth 'test-write-threshold': [testblock], 79da668aa1SThomas Huth 'test-crypto-hash': [crypto], 80da668aa1SThomas Huth 'test-crypto-hmac': [crypto], 81da668aa1SThomas Huth 'test-crypto-cipher': [crypto], 82689309c4SLei He 'test-crypto-akcipher': [crypto], 83da668aa1SThomas Huth 'test-crypto-secret': [crypto, keyutils], 8499d423f1SLei He 'test-crypto-der': [crypto], 85da668aa1SThomas Huth 'test-authz-simple': [authz], 86da668aa1SThomas Huth 'test-authz-list': [authz], 87da668aa1SThomas Huth 'test-authz-listfile': [authz], 88da668aa1SThomas Huth 'test-io-task': [testblock], 89da668aa1SThomas Huth 'test-io-channel-socket': ['socket-helpers.c', 'io-channel-helpers.c', io], 90da668aa1SThomas Huth 'test-io-channel-file': ['io-channel-helpers.c', io], 91da668aa1SThomas Huth 'test-io-channel-command': ['io-channel-helpers.c', io], 92da668aa1SThomas Huth 'test-io-channel-buffer': ['io-channel-helpers.c', io], 9387e42764SDaniel P. Berrangé 'test-io-channel-null': [io], 94da668aa1SThomas Huth 'test-crypto-ivgen': [io], 95da668aa1SThomas Huth 'test-crypto-afsplit': [io], 96da668aa1SThomas Huth 'test-crypto-block': [io], 97da668aa1SThomas Huth } 9857612511SPaolo Bonzini if gnutls.found() and \ 99ba7ed407SPaolo Bonzini tasn1.found() and \ 100da668aa1SThomas Huth 'CONFIG_POSIX' in config_host 101da668aa1SThomas Huth tests += { 102da668aa1SThomas Huth 'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 103da668aa1SThomas Huth tasn1, crypto, gnutls], 104da668aa1SThomas Huth 'test-crypto-tlssession': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c', 105da668aa1SThomas Huth tasn1, crypto, gnutls], 106da668aa1SThomas Huth 'test-io-channel-tls': ['io-channel-helpers.c', 'crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 107da668aa1SThomas Huth tasn1, io, crypto, gnutls]} 108da668aa1SThomas Huth endif 10905e391aeSPaolo Bonzini if pam.found() 110da668aa1SThomas Huth tests += {'test-authz-pam': [authz]} 111da668aa1SThomas Huth endif 11257612511SPaolo Bonzini if xts == 'private' 113da668aa1SThomas Huth tests += {'test-crypto-xts': [crypto, io]} 114da668aa1SThomas Huth endif 115da668aa1SThomas Huth if 'CONFIG_POSIX' in config_host 116da668aa1SThomas Huth tests += {'test-image-locking': [testblock]} 117da668aa1SThomas Huth endif 118406523f6SPaolo Bonzini if config_host_data.get('CONFIG_REPLICATION') 119da668aa1SThomas Huth tests += {'test-replication': [testblock]} 120da668aa1SThomas Huth endif 12157612511SPaolo Bonzini if nettle.found() or gcrypt.found() 122da668aa1SThomas Huth tests += {'test-crypto-pbkdf': [io]} 123da668aa1SThomas Huth endif 1247a82413dSPaolo Bonzini if config_host_data.get('CONFIG_EPOLL_CREATE1') 125da668aa1SThomas Huth tests += {'test-fdmon-epoll': [testblock]} 126da668aa1SThomas Huth endif 127da668aa1SThomas Huthendif 128da668aa1SThomas Huth 129da668aa1SThomas Huthif have_system 130da668aa1SThomas Huth tests += { 131da668aa1SThomas Huth 'test-iov': [], 132da668aa1SThomas Huth 'test-qmp-cmds': [testqapi], 133da668aa1SThomas Huth 'test-xbzrle': [migration], 134da668aa1SThomas Huth 'test-timed-average': [], 135da668aa1SThomas Huth 'test-util-sockets': ['socket-helpers.c'], 136da668aa1SThomas Huth 'test-base64': [], 137da668aa1SThomas Huth 'test-bufferiszero': [], 13862b6323dSPhilippe Mathieu-Daudé 'test-smp-parse': [qom, meson.project_source_root() / 'hw/core/machine-smp.c'], 139d3a0bb77SLukas Straub 'test-vmstate': [migration, io], 140d3a0bb77SLukas Straub 'test-yank': ['socket-helpers.c', qom, io, chardev] 141da668aa1SThomas Huth } 1429d30c78cSVolker Rümelin if config_host_data.get('CONFIG_INOTIFY1') 143da668aa1SThomas Huth tests += {'test-util-filemonitor': []} 144da668aa1SThomas Huth endif 145da668aa1SThomas Huth 146da668aa1SThomas Huth # Some tests: test-char, test-qdev-global-props, and test-qga, 147da668aa1SThomas Huth # are not runnable under TSan due to a known issue. 148da668aa1SThomas Huth # https://github.com/google/sanitizers/issues/1116 149da668aa1SThomas Huth if 'CONFIG_TSAN' not in config_host 150da668aa1SThomas Huth if 'CONFIG_POSIX' in config_host 151da668aa1SThomas Huth tests += { 152da668aa1SThomas Huth 'test-char': ['socket-helpers.c', qom, io, chardev] 153da668aa1SThomas Huth } 154da668aa1SThomas Huth endif 155da668aa1SThomas Huth 156da668aa1SThomas Huth tests += { 1579d587100SMarc-André Lureau 'test-qdev-global-props': [qom, hwcore] 158da668aa1SThomas Huth } 159da668aa1SThomas Huth endif 160da668aa1SThomas Huthendif 161da668aa1SThomas Huth 162a7bd942cSMarc-André Lureauif have_ga and targetos == 'linux' 163c6d3bcb4SMarc-André Lureau tests += {'test-qga': ['../qtest/libqmp.c']} 164da668aa1SThomas Huth test_deps += {'test-qga': qga} 165da668aa1SThomas Huthendif 166da668aa1SThomas Huth 167da668aa1SThomas Huthtest_env = environment() 168da668aa1SThomas Huthtest_env.set('G_TEST_SRCDIR', meson.current_source_dir()) 169da668aa1SThomas Huthtest_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) 170da668aa1SThomas Huth 171da668aa1SThomas Huthslow_tests = { 172da668aa1SThomas Huth 'test-crypto-tlscredsx509': 45, 173da668aa1SThomas Huth 'test-crypto-tlssession': 45 174da668aa1SThomas Huth} 175da668aa1SThomas Huth 176da668aa1SThomas Huthforeach test_name, extra: tests 177da668aa1SThomas Huth src = [test_name + '.c'] 178da668aa1SThomas Huth deps = [qemuutil] 179da668aa1SThomas Huth if extra.length() > 0 180da668aa1SThomas Huth # use a sourceset to quickly separate sources and deps 181da668aa1SThomas Huth test_ss = ss.source_set() 182da668aa1SThomas Huth test_ss.add(extra) 183da668aa1SThomas Huth src += test_ss.all_sources() 184da668aa1SThomas Huth deps += test_ss.all_dependencies() 185da668aa1SThomas Huth endif 186da668aa1SThomas Huth exe = executable(test_name, src, genh, dependencies: deps) 187da668aa1SThomas Huth 188da668aa1SThomas Huth test(test_name, exe, 189da668aa1SThomas Huth depends: test_deps.get(test_name, []), 190da668aa1SThomas Huth env: test_env, 191da668aa1SThomas Huth args: ['--tap', '-k'], 192da668aa1SThomas Huth protocol: 'tap', 193da668aa1SThomas Huth timeout: slow_tests.get(test_name, 30), 194da668aa1SThomas Huth priority: slow_tests.get(test_name, 30), 195da668aa1SThomas Huth suite: ['unit']) 196da668aa1SThomas Huthendforeach 197