]> git.proxmox.com Git - mirror_qemu.git/blame - tests/qtest/meson.build
Merge tag 'for-upstream' of https://repo.or.cz/qemu/kevin into staging
[mirror_qemu.git] / tests / qtest / meson.build
CommitLineData
dc1d91ac
PB
1slow_qtests = {
2 'ahci-test' : 60,
3 'bios-tables-test' : 120,
4 'boot-serial-test' : 60,
5 'migration-test' : 150,
6 'npcm7xx_pwm-test': 150,
7 'prom-env-test' : 60,
8 'pxe-test' : 60,
9 'qos-test' : 60,
10 'qom-test' : 300,
11 'test-hmp' : 120,
12}
13
b911c30c 14qtests_generic = [
a2ce7dbd
PB
15 'cdrom-test',
16 'device-introspect-test',
17 'machine-none-test',
18 'qmp-test',
19 'qmp-cmd-test',
20 'qom-test',
21 'test-hmp',
22 'qos-test',
f6a5f380 23 'readconfig-test',
c95031a1 24 'netdev-socket',
a2ce7dbd 25]
6002711c 26if enable_modules
a2ce7dbd
PB
27 qtests_generic += [ 'modules-test' ]
28endif
29
30qtests_pci = \
31 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \
32 (config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : [])
33
33c47ab9
JC
34qtests_cxl = \
35 (config_all_devices.has_key('CONFIG_CXL') ? ['cxl-test'] : [])
36
973d97fe
TH
37# FIXME: Get rid of get_option('default_devices') here and check
38# for the availability of the default NICs in the tests
8bf5bb2e 39qtests_filter = \
973d97fe
TH
40 (get_option('default_devices') and slirp.found() ? ['test-netfilter'] : []) + \
41 (get_option('default_devices') and config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
42 (get_option('default_devices') and config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
8bf5bb2e 43
a2ce7dbd 44qtests_i386 = \
8bf5bb2e
BM
45 (slirp.found() ? ['pxe-test'] : []) + \
46 qtests_filter + \
a2ce7dbd
PB
47 (have_tools ? ['ahci-test'] : []) + \
48 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
49 (config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : []) + \
a2ce7dbd
PB
50 (config_all_devices.has_key('CONFIG_ISA_IPMI_KCS') ? ['ipmi-kcs-test'] : []) + \
51 (config_host.has_key('CONFIG_LINUX') and \
52 config_all_devices.has_key('CONFIG_ISA_IPMI_BT') ? ['ipmi-bt-test'] : []) + \
53 (config_all_devices.has_key('CONFIG_WDT_IB700') ? ['wdt_ib700-test'] : []) + \
677726ef 54 (config_all_devices.has_key('CONFIG_PVPANIC_ISA') ? ['pvpanic-test'] : []) + \
c0f82826 55 (config_all_devices.has_key('CONFIG_PVPANIC_PCI') ? ['pvpanic-pci-test'] : []) + \
a2ce7dbd
PB
56 (config_all_devices.has_key('CONFIG_HDA') ? ['intel-hda-test'] : []) + \
57 (config_all_devices.has_key('CONFIG_I82801B11') ? ['i82801b11-test'] : []) + \
58 (config_all_devices.has_key('CONFIG_IOH3420') ? ['ioh3420-test'] : []) + \
af05ffff 59 (config_all_devices.has_key('CONFIG_LPC_ICH9') ? ['lpc-ich9-test'] : []) + \
a2ce7dbd
PB
60 (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
61 (config_all_devices.has_key('CONFIG_USB_UHCI') and \
62 config_all_devices.has_key('CONFIG_USB_EHCI') ? ['usb-hcd-ehci-test'] : []) + \
63 (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
64 (config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-test'] : []) + \
65 (config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-swtpm-test'] : []) + \
66 (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-test'] : []) + \
67 (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-swtpm-test'] : []) + \
68 (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \
7d6a4f12 69 (config_all_devices.has_key('CONFIG_E1000E_PCI_EXPRESS') ? ['fuzz-e1000e-test'] : []) + \
b911c30c
TH
70 (config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') ? ['fuzz-megasas-test'] : []) + \
71 (config_all_devices.has_key('CONFIG_LSI_SCSI_PCI') ? ['fuzz-lsi53c895a-test'] : []) + \
72 (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-test'] : []) + \
73 (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \
74 (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \
ce94fa7a 75 (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \
84efa8aa
BM
76 (config_host.has_key('CONFIG_POSIX') and \
77 config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \
56f7c6b1
FR
78 (config_all_devices.has_key('CONFIG_PCIE_PORT') and \
79 config_all_devices.has_key('CONFIG_VIRTIO_NET') and \
e32b96b5
LV
80 config_all_devices.has_key('CONFIG_Q35') and \
81 config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \
82 slirp.found() ? ['virtio-net-failover'] : []) + \
2e0def6d
FR
83 (unpack_edk2_blobs and \
84 config_all_devices.has_key('CONFIG_HPET') and \
85 config_all_devices.has_key('CONFIG_PARALLEL') ? ['bios-tables-test'] : []) + \
a2ce7dbd 86 qtests_pci + \
33c47ab9 87 qtests_cxl + \
a2ce7dbd
PB
88 ['fdc-test',
89 'ide-test',
a2ce7dbd
PB
90 'hd-geo-test',
91 'boot-order-test',
a2ce7dbd
PB
92 'rtc-test',
93 'i440fx-test',
94 'fw_cfg-test',
95 'device-plug-test',
96 'drive_del-test',
97 'tco-test',
98 'cpu-plug-test',
99 'q35-test',
100 'vmgenid-test',
101 'migration-test',
102 'test-x86-cpuid-compat',
8bf5bb2e 103 'numa-test'
31fb263c 104 ]
a2ce7dbd 105
84a0a2ef 106if dbus_display and targetos != 'windows'
b4dd5b6a
MAL
107 qtests_i386 += ['dbus-display-test']
108endif
109
a2ce7dbd 110dbus_daemon = find_program('dbus-daemon', required: false)
7544060e 111if dbus_daemon.found() and gdbus_codegen.found()
a2ce7dbd
PB
112 # Temporarily disabled due to Patchew failures:
113 #qtests_i386 += ['dbus-vmstate-test']
114 dbus_vmstate1 = custom_target('dbus-vmstate description',
115 output: ['dbus-vmstate1.h', 'dbus-vmstate1.c'],
861aa79a 116 input: meson.project_source_root() / 'backends/dbus-vmstate1.xml',
7544060e 117 command: [gdbus_codegen, '@INPUT@',
a2ce7dbd
PB
118 '--interface-prefix', 'org.qemu',
119 '--generate-c-code', '@BASENAME@']).to_list()
120else
121 dbus_vmstate1 = []
122endif
123
124qtests_x86_64 = qtests_i386
125
31fb263c 126qtests_alpha = ['boot-serial-test'] + \
8bf5bb2e 127 qtests_filter + \
a2ce7dbd
PB
128 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
129
130qtests_avr = [ 'boot-serial-test' ]
131
31fb263c 132qtests_hppa = ['boot-serial-test'] + \
8bf5bb2e 133 qtests_filter + \
a2ce7dbd
PB
134 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
135
31fb263c 136qtests_m68k = ['boot-serial-test'] + \
8bf5bb2e 137 qtests_filter
31fb263c
TH
138
139qtests_microblaze = ['boot-serial-test'] + \
8bf5bb2e 140 qtests_filter
31fb263c 141
a2ce7dbd
PB
142qtests_microblazeel = qtests_microblaze
143
144qtests_mips = \
8bf5bb2e 145 qtests_filter + \
a2ce7dbd
PB
146 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
147 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
148
20516580
TH
149qtests_mipsel = qtests_mips
150qtests_mips64 = qtests_mips
151qtests_mips64el = qtests_mips
a2ce7dbd 152
a2ce7dbd 153qtests_ppc = \
8bf5bb2e 154 qtests_filter + \
a2ce7dbd
PB
155 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
156 (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + \
44d827ea 157 (config_all_devices.has_key('CONFIG_TCG') ? ['prom-env-test'] : []) + \
74884cb1
DHB
158 (config_all_devices.has_key('CONFIG_TCG') ? ['boot-serial-test'] : []) + \
159 ['boot-order-test']
a2ce7dbd
PB
160
161qtests_ppc64 = \
a9697d09 162 qtests_ppc + \
a2ce7dbd
PB
163 (config_all_devices.has_key('CONFIG_PSERIES') ? ['device-plug-test'] : []) + \
164 (config_all_devices.has_key('CONFIG_POWERNV') ? ['pnv-xscom-test'] : []) + \
165 (config_all_devices.has_key('CONFIG_PSERIES') ? ['rtas-test'] : []) + \
31fb263c 166 (slirp.found() ? ['pxe-test'] : []) + \
a2ce7dbd
PB
167 (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
168 (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
d8a18da5 169 qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test', 'drive_del-test']
a2ce7dbd
PB
170
171qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
172qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
173
31fb263c 174qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test'] + \
8bf5bb2e 175 qtests_filter
a2ce7dbd
PB
176
177qtests_sparc64 = \
178 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
8bf5bb2e 179 qtests_filter + \
a2ce7dbd
PB
180 ['prom-env-test', 'boot-serial-test']
181
326ccfe2 182qtests_npcm7xx = \
77c05b0b
HW
183 ['npcm7xx_adc-test',
184 'npcm7xx_gpio-test',
73314f13 185 'npcm7xx_pwm-test',
526dbbe0 186 'npcm7xx_rng-test',
4c579e15 187 'npcm7xx_sdhci-test',
d986bf72 188 'npcm7xx_smbus-test',
326ccfe2 189 'npcm7xx_timer-test',
e6646167
DE
190 'npcm7xx_watchdog_timer-test'] + \
191 (slirp.found() ? ['npcm7xx_emc-test'] : [])
66609952 192qtests_aspeed = \
5fde7f10 193 ['aspeed_hace-test',
2ec06378
PD
194 'aspeed_smc-test',
195 'aspeed_gpio-test']
a2ce7dbd 196qtests_arm = \
1eca58aa 197 (config_all_devices.has_key('CONFIG_MPS2') ? ['sse-timer-test'] : []) + \
9bc064b5 198 (config_all_devices.has_key('CONFIG_CMSDK_APB_DUALTIMER') ? ['cmsdk-apb-dualtimer-test'] : []) + \
30858daf 199 (config_all_devices.has_key('CONFIG_CMSDK_APB_TIMER') ? ['cmsdk-apb-timer-test'] : []) + \
9cf5eb29 200 (config_all_devices.has_key('CONFIG_CMSDK_APB_WATCHDOG') ? ['cmsdk-apb-watchdog-test'] : []) + \
e19d24e6
TH
201 (config_all_devices.has_key('CONFIG_PFLASH_CFI02') and
202 config_all_devices.has_key('CONFIG_MUSICPAL') ? ['pflash-cfi02-test'] : []) + \
66609952 203 (config_all_devices.has_key('CONFIG_ASPEED_SOC') ? qtests_aspeed : []) + \
288c31e3 204 (config_all_devices.has_key('CONFIG_NPCM7XX') ? qtests_npcm7xx : []) + \
628f9008 205 (config_all_devices.has_key('CONFIG_GENERIC_LOADER') ? ['hexloader-test'] : []) + \
bcbbd95d 206 (config_all_devices.has_key('CONFIG_TPM_TIS_I2C') ? ['tpm-tis-i2c-test'] : []) + \
e19d24e6
TH
207 (config_all_devices.has_key('CONFIG_VEXPRESS') ? ['test-arm-mptimer'] : []) + \
208 (config_all_devices.has_key('CONFIG_MICROBIT') ? ['microbit-test'] : []) + \
a2ce7dbd 209 ['arm-cpu-features',
628f9008 210 'boot-serial-test']
a2ce7dbd
PB
211
212# TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional
213qtests_aarch64 = \
809954ef 214 (cpu != 'arm' and unpack_edk2_blobs ? ['bios-tables-test'] : []) + \
caf01d6a
FR
215 (config_all.has_key('CONFIG_TCG') and config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? \
216 ['tpm-tis-device-test', 'tpm-tis-device-swtpm-test'] : []) + \
bf22f151 217 (config_all_devices.has_key('CONFIG_XLNX_ZYNQMP_ARM') ? ['xlnx-can-test', 'fuzz-xlnx-dp-test'] : []) + \
db2237c4 218 (config_all_devices.has_key('CONFIG_RASPI') ? ['bcm2835-dma-test'] : []) + \
b08dc0f1
FR
219 (config_all.has_key('CONFIG_TCG') and \
220 config_all_devices.has_key('CONFIG_TPM_TIS_I2C') ? ['tpm-tis-i2c-test'] : []) + \
05889d15
AJ
221 ['arm-cpu-features',
222 'numa-test',
a2ce7dbd 223 'boot-serial-test',
db2237c4 224 'migration-test']
a2ce7dbd
PB
225
226qtests_s390x = \
973d97fe 227 qtests_filter + \
a2ce7dbd
PB
228 ['boot-serial-test',
229 'drive_del-test',
230 'device-plug-test',
231 'virtio-ccw-test',
232 'cpu-plug-test',
233 'migration-test']
234
235qos_test_ss = ss.source_set()
236qos_test_ss.add(
237 'ac97-test.c',
c0167539 238 'adm1272-test.c',
a2ce7dbd
PB
239 'ds1338-test.c',
240 'e1000-test.c',
a2ce7dbd
PB
241 'eepro100-test.c',
242 'es1370-test.c',
243 'ipoctal232-test.c',
4fd1ebb1 244 'lsm303dlhc-mag-test.c',
ffcdae67 245 'isl_pmbus_vr-test.c',
7649086f 246 'max34451-test.c',
a2ce7dbd
PB
247 'megasas-test.c',
248 'ne2000-test.c',
249 'tulip-test.c',
250 'nvme-test.c',
251 'pca9552-test.c',
252 'pci-test.c',
253 'pcnet-test.c',
254 'sdhci-test.c',
255 'spapr-phb-test.c',
256 'tmp105-test.c',
5e623f2b 257 'emc141x-test.c',
a2ce7dbd
PB
258 'usb-hcd-ohci-test.c',
259 'virtio-test.c',
260 'virtio-blk-test.c',
261 'virtio-net-test.c',
262 'virtio-rng-test.c',
263 'virtio-scsi-test.c',
becf8873 264 'virtio-iommu-test.c',
a2ce7dbd 265 'vmxnet3-test.c',
45cb69bb 266 'igb-test.c',
a2ce7dbd 267)
b8a310a2
FR
268
269if config_all_devices.has_key('CONFIG_VIRTIO_SERIAL')
270 qos_test_ss.add(files('virtio-serial-test.c'))
271endif
272
bc67e31c
BM
273if config_host.has_key('CONFIG_POSIX')
274 qos_test_ss.add(files('e1000e-test.c'))
275endif
2c9dce01
PB
276if have_virtfs
277 qos_test_ss.add(files('virtio-9p-test.c'))
278endif
43b6d7ee
PB
279if have_vhost_user
280 qos_test_ss.add(files('vhost-user-test.c'))
281endif
80695202
CX
282if have_tools and have_vhost_user_blk_server
283 qos_test_ss.add(files('vhost-user-blk-test.c'))
284endif
a2ce7dbd 285
da00d067
PB
286tpmemu_files = ['tpm-emu.c', 'tpm-util.c', 'tpm-tests.c']
287
58d25e97
DB
288migration_files = [files('migration-helpers.c')]
289if gnutls.found()
290 migration_files += [files('../unit/crypto-tls-psk-helpers.c'), gnutls]
d47b83b1
DB
291
292 if tasn1.found()
293 migration_files += [files('../unit/crypto-tls-x509-helpers.c',
294 '../unit/pkix_asn1_tab.c'), tasn1]
295 endif
58d25e97
DB
296endif
297
da00d067
PB
298qtests = {
299 'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'],
a2ce7dbd 300 'cdrom-test': files('boot-sector.c'),
a2ce7dbd 301 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1,
bd24550e 302 'erst-test': files('erst-test.c'),
da00d067 303 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'],
58d25e97 304 'migration-test': migration_files,
da00d067
PB
305 'pxe-test': files('boot-sector.c'),
306 'qos-test': [chardev, io, qos_test_ss.apply(config_host, strict: false).sources()],
307 'tpm-crb-swtpm-test': [io, tpmemu_files],
308 'tpm-crb-test': [io, tpmemu_files],
309 'tpm-tis-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
310 'tpm-tis-test': [io, tpmemu_files, 'tpm-tis-util.c'],
bcbbd95d 311 'tpm-tis-i2c-test': [io, tpmemu_files, 'qtest_aspeed.c'],
da00d067
PB
312 'tpm-tis-device-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
313 'tpm-tis-device-test': [io, tpmemu_files, 'tpm-tis-util.c'],
a2ce7dbd 314 'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'),
c95031a1 315 'netdev-socket': files('netdev-socket.c', '../unit/socket-helpers.c'),
a2ce7dbd
PB
316}
317
4d1bc58d
JQ
318if vnc.found()
319 gvnc = dependency('gvnc-1.0', required: false)
320 if gvnc.found()
321 qtests += {'vnc-display-test': [gvnc]}
322 qtests_generic += [ 'vnc-display-test' ]
323 endif
f5755989
MAL
324endif
325
b4dd5b6a 326if dbus_display
f5755989 327 qtests += {'dbus-display-test': [dbus_display1, gio]}
b4dd5b6a
MAL
328endif
329
a2ce7dbd
PB
330qtest_executables = {}
331foreach dir : target_dirs
332 if not dir.endswith('-softmmu')
333 continue
334 endif
335
336 target_base = dir.split('-')[0]
fd5eef85 337 qtest_emulator = emulators['qemu-system-' + target_base]
da00d067 338 target_qtests = get_variable('qtests_' + target_base, []) + qtests_generic
a2ce7dbd 339
809954ef 340 test_deps = roms
a2ce7dbd 341 qtest_env = environment()
fd5eef85
PB
342 if have_tools
343 qtest_env.set('QTEST_QEMU_IMG', './qemu-img')
344 test_deps += [qemu_img]
345 endif
654d6b04 346 qtest_env.set('G_TEST_DBUS_DAEMON', meson.project_source_root() / 'tests/dbus-vmstate-daemon.sh')
64ed6f92 347 qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base)
cc1838c2
TH
348 if have_tools and have_vhost_user_blk_server
349 qtest_env.set('QTEST_QEMU_STORAGE_DAEMON_BINARY', './storage-daemon/qemu-storage-daemon')
350 test_deps += [qsd]
351 endif
352
da00d067 353 foreach test : target_qtests
a2ce7dbd
PB
354 # Executables are shared across targets, declare them only the first time we
355 # encounter them
356 if not qtest_executables.has_key(test)
da00d067
PB
357 src = [test + '.c']
358 deps = [qemuutil, qos]
359 if test in qtests
360 # use a sourceset to quickly separate sources and deps
361 test_ss = ss.source_set()
362 test_ss.add(qtests[test])
363 src += test_ss.all_sources()
364 deps += test_ss.all_dependencies()
365 endif
a2ce7dbd 366 qtest_executables += {
da00d067 367 test: executable(test, src, dependencies: deps)
a2ce7dbd
PB
368 }
369 endif
34f02e9f 370 test('qtest-@0@/@1@'.format(target_base, test),
a2ce7dbd 371 qtest_executables[test],
fb72176b 372 depends: [test_deps, qtest_emulator, emulator_modules],
a2ce7dbd
PB
373 env: qtest_env,
374 args: ['--tap', '-k'],
375 protocol: 'tap',
dc1d91ac
PB
376 timeout: slow_qtests.get(test, 30),
377 priority: slow_qtests.get(test, 30),
a2ce7dbd
PB
378 suite: ['qtest', 'qtest-' + target_base])
379 endforeach
380endforeach