]> git.proxmox.com Git - mirror_qemu.git/blame - tests/qtest/meson.build
gitlab: skip many more targets in windows cross builds
[mirror_qemu.git] / tests / qtest / meson.build
CommitLineData
a2ce7dbd
PB
1# All QTests for now are POSIX-only, but the dependencies are
2# really in libqtest, not in the testcases themselves.
3if not config_host.has_key('CONFIG_POSIX')
4 subdir_done()
5endif
6
dc1d91ac
PB
7slow_qtests = {
8 'ahci-test' : 60,
9 'bios-tables-test' : 120,
10 'boot-serial-test' : 60,
11 'migration-test' : 150,
12 'npcm7xx_pwm-test': 150,
13 'prom-env-test' : 60,
14 'pxe-test' : 60,
15 'qos-test' : 60,
16 'qom-test' : 300,
17 'test-hmp' : 120,
18}
19
c887d333
PMD
20qtests_generic = \
21 (config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') ? ['fuzz-megasas-test'] : []) + \
b43957dc 22 (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-test'] : []) + \
a2cd86a9 23 (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \
59b63d78 24 (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \
c887d333 25 [
a2ce7dbd
PB
26 'cdrom-test',
27 'device-introspect-test',
28 'machine-none-test',
29 'qmp-test',
30 'qmp-cmd-test',
31 'qom-test',
32 'test-hmp',
33 'qos-test',
34]
35if config_host.has_key('CONFIG_MODULES')
36 qtests_generic += [ 'modules-test' ]
37endif
38
39qtests_pci = \
40 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \
41 (config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : [])
42
43qtests_i386 = \
4d34a86b 44 (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
a2ce7dbd
PB
45 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
46 (have_tools ? ['ahci-test'] : []) + \
47 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
48 (config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : []) + \
49 (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['test-filter-redirector'] : []) + \
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'] : []) + \
ce94fa7a 70 (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \
a2ce7dbd
PB
71 qtests_pci + \
72 ['fdc-test',
73 'ide-test',
a2ce7dbd
PB
74 'hd-geo-test',
75 'boot-order-test',
76 'bios-tables-test',
77 'rtc-test',
78 'i440fx-test',
79 'fw_cfg-test',
80 'device-plug-test',
81 'drive_del-test',
82 'tco-test',
83 'cpu-plug-test',
84 'q35-test',
85 'vmgenid-test',
86 'migration-test',
87 'test-x86-cpuid-compat',
88 'numa-test']
89
90dbus_daemon = find_program('dbus-daemon', required: false)
91if dbus_daemon.found() and config_host.has_key('GDBUS_CODEGEN')
92 # Temporarily disabled due to Patchew failures:
93 #qtests_i386 += ['dbus-vmstate-test']
94 dbus_vmstate1 = custom_target('dbus-vmstate description',
95 output: ['dbus-vmstate1.h', 'dbus-vmstate1.c'],
96 input: files('dbus-vmstate1.xml'),
97 command: [config_host['GDBUS_CODEGEN'],
98 '@INPUT@',
99 '--interface-prefix', 'org.qemu',
100 '--generate-c-code', '@BASENAME@']).to_list()
101else
102 dbus_vmstate1 = []
103endif
104
105qtests_x86_64 = qtests_i386
106
107qtests_alpha = [ 'boot-serial-test' ] + \
108 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
109
110qtests_avr = [ 'boot-serial-test' ]
111
112qtests_hppa = [ 'boot-serial-test' ] + \
113 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
114
115qtests_m68k = [ 'boot-serial-test' ]
116qtests_microblaze = [ 'boot-serial-test' ]
117qtests_microblazeel = qtests_microblaze
118
119qtests_mips = \
120 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
121 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
122
123qtests_mips64 = \
124 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
125 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
126
127qtests_mips64el = \
128 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
129 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
130
a2ce7dbd
PB
131qtests_ppc = \
132 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
133 (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + \
d8a18da5 134 ['boot-order-test', 'prom-env-test', 'boot-serial-test'] \
a2ce7dbd
PB
135
136qtests_ppc64 = \
137 (config_all_devices.has_key('CONFIG_PSERIES') ? ['device-plug-test'] : []) + \
138 (config_all_devices.has_key('CONFIG_POWERNV') ? ['pnv-xscom-test'] : []) + \
139 (config_all_devices.has_key('CONFIG_PSERIES') ? ['rtas-test'] : []) + \
4d34a86b 140 (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
a2ce7dbd
PB
141 (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
142 (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
143 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
d8a18da5 144 qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test', 'drive_del-test']
a2ce7dbd
PB
145
146qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
147qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
148
149qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test']
150
151qtests_sparc64 = \
152 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
153 ['prom-env-test', 'boot-serial-test']
154
326ccfe2 155qtests_npcm7xx = \
77c05b0b
HW
156 ['npcm7xx_adc-test',
157 'npcm7xx_gpio-test',
73314f13 158 'npcm7xx_pwm-test',
526dbbe0 159 'npcm7xx_rng-test',
d986bf72 160 'npcm7xx_smbus-test',
326ccfe2 161 'npcm7xx_timer-test',
e6646167
DE
162 'npcm7xx_watchdog_timer-test'] + \
163 (slirp.found() ? ['npcm7xx_emc-test'] : [])
66609952 164qtests_aspeed = \
5fde7f10
CLG
165 ['aspeed_hace-test',
166 'aspeed_smc-test']
a2ce7dbd 167qtests_arm = \
1eca58aa 168 (config_all_devices.has_key('CONFIG_MPS2') ? ['sse-timer-test'] : []) + \
9bc064b5 169 (config_all_devices.has_key('CONFIG_CMSDK_APB_DUALTIMER') ? ['cmsdk-apb-dualtimer-test'] : []) + \
30858daf 170 (config_all_devices.has_key('CONFIG_CMSDK_APB_TIMER') ? ['cmsdk-apb-timer-test'] : []) + \
9cf5eb29 171 (config_all_devices.has_key('CONFIG_CMSDK_APB_WATCHDOG') ? ['cmsdk-apb-watchdog-test'] : []) + \
a2ce7dbd 172 (config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) + \
66609952 173 (config_all_devices.has_key('CONFIG_ASPEED_SOC') ? qtests_aspeed : []) + \
288c31e3 174 (config_all_devices.has_key('CONFIG_NPCM7XX') ? qtests_npcm7xx : []) + \
a2ce7dbd
PB
175 ['arm-cpu-features',
176 'microbit-test',
a2ce7dbd
PB
177 'test-arm-mptimer',
178 'boot-serial-test',
179 'hexloader-test']
180
181# TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional
182qtests_aarch64 = \
183 (cpu != 'arm' ? ['bios-tables-test'] : []) + \
184 (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-test'] : []) + \
185 (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-swtpm-test'] : []) + \
05889d15
AJ
186 ['arm-cpu-features',
187 'numa-test',
a2ce7dbd 188 'boot-serial-test',
ab5e842c 189 'xlnx-can-test',
a2ce7dbd
PB
190 'migration-test']
191
192qtests_s390x = \
4d34a86b 193 (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
a2ce7dbd
PB
194 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
195 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
196 ['boot-serial-test',
197 'drive_del-test',
198 'device-plug-test',
199 'virtio-ccw-test',
200 'cpu-plug-test',
201 'migration-test']
202
203qos_test_ss = ss.source_set()
204qos_test_ss.add(
205 'ac97-test.c',
c0167539 206 'adm1272-test.c',
a2ce7dbd
PB
207 'ds1338-test.c',
208 'e1000-test.c',
209 'e1000e-test.c',
210 'eepro100-test.c',
211 'es1370-test.c',
212 'ipoctal232-test.c',
7649086f 213 'max34451-test.c',
a2ce7dbd
PB
214 'megasas-test.c',
215 'ne2000-test.c',
216 'tulip-test.c',
217 'nvme-test.c',
218 'pca9552-test.c',
219 'pci-test.c',
220 'pcnet-test.c',
221 'sdhci-test.c',
222 'spapr-phb-test.c',
223 'tmp105-test.c',
5e623f2b 224 'emc141x-test.c',
a2ce7dbd
PB
225 'usb-hcd-ohci-test.c',
226 'virtio-test.c',
227 'virtio-blk-test.c',
228 'virtio-net-test.c',
229 'virtio-rng-test.c',
230 'virtio-scsi-test.c',
231 'virtio-serial-test.c',
232 'vmxnet3-test.c',
233)
2c9dce01
PB
234if have_virtfs
235 qos_test_ss.add(files('virtio-9p-test.c'))
236endif
a2ce7dbd 237qos_test_ss.add(when: 'CONFIG_VHOST_USER', if_true: files('vhost-user-test.c'))
80695202
CX
238if have_tools and have_vhost_user_blk_server
239 qos_test_ss.add(files('vhost-user-blk-test.c'))
240endif
a2ce7dbd 241
da00d067
PB
242tpmemu_files = ['tpm-emu.c', 'tpm-util.c', 'tpm-tests.c']
243
244qtests = {
245 'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'],
a2ce7dbd 246 'cdrom-test': files('boot-sector.c'),
a2ce7dbd 247 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1,
da00d067
PB
248 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'],
249 'migration-test': files('migration-helpers.c'),
250 'pxe-test': files('boot-sector.c'),
251 'qos-test': [chardev, io, qos_test_ss.apply(config_host, strict: false).sources()],
252 'tpm-crb-swtpm-test': [io, tpmemu_files],
253 'tpm-crb-test': [io, tpmemu_files],
254 'tpm-tis-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
255 'tpm-tis-test': [io, tpmemu_files, 'tpm-tis-util.c'],
256 'tpm-tis-device-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
257 'tpm-tis-device-test': [io, tpmemu_files, 'tpm-tis-util.c'],
a2ce7dbd 258 'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'),
a2ce7dbd
PB
259}
260
a2ce7dbd
PB
261qtest_executables = {}
262foreach dir : target_dirs
263 if not dir.endswith('-softmmu')
264 continue
265 endif
266
267 target_base = dir.split('-')[0]
fd5eef85 268 qtest_emulator = emulators['qemu-system-' + target_base]
da00d067 269 target_qtests = get_variable('qtests_' + target_base, []) + qtests_generic
a2ce7dbd 270
fd5eef85 271 test_deps = []
a2ce7dbd 272 qtest_env = environment()
fd5eef85
PB
273 if have_tools
274 qtest_env.set('QTEST_QEMU_IMG', './qemu-img')
275 test_deps += [qemu_img]
276 endif
a2ce7dbd 277 qtest_env.set('G_TEST_DBUS_DAEMON', meson.source_root() / 'tests/dbus-vmstate-daemon.sh')
64ed6f92 278 qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base)
80695202 279 qtest_env.set('QTEST_QEMU_STORAGE_DAEMON_BINARY', './storage-daemon/qemu-storage-daemon')
a2ce7dbd 280
da00d067 281 foreach test : target_qtests
a2ce7dbd
PB
282 # Executables are shared across targets, declare them only the first time we
283 # encounter them
284 if not qtest_executables.has_key(test)
da00d067
PB
285 src = [test + '.c']
286 deps = [qemuutil, qos]
287 if test in qtests
288 # use a sourceset to quickly separate sources and deps
289 test_ss = ss.source_set()
290 test_ss.add(qtests[test])
291 src += test_ss.all_sources()
292 deps += test_ss.all_dependencies()
293 endif
a2ce7dbd 294 qtest_executables += {
da00d067 295 test: executable(test, src, dependencies: deps)
a2ce7dbd
PB
296 }
297 endif
298 # FIXME: missing dependency on the emulator binary and qemu-img
34f02e9f 299 test('qtest-@0@/@1@'.format(target_base, test),
a2ce7dbd 300 qtest_executables[test],
fd5eef85 301 depends: [test_deps, qtest_emulator],
a2ce7dbd
PB
302 env: qtest_env,
303 args: ['--tap', '-k'],
304 protocol: 'tap',
dc1d91ac
PB
305 timeout: slow_qtests.get(test, 30),
306 priority: slow_qtests.get(test, 30),
a2ce7dbd
PB
307 suite: ['qtest', 'qtest-' + target_base])
308 endforeach
309endforeach