]> git.proxmox.com Git - mirror_qemu.git/blame - tests/qtest/meson.build
tests/qtest: Enable more tests for the "mipsel" target
[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'] : []) + \
aa62976c 22 (config_all_devices.has_key('CONFIG_LSI_SCSI_PCI') ? ['fuzz-lsi53c895a-test'] : []) + \
b43957dc 23 (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-test'] : []) + \
a2cd86a9 24 (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \
59b63d78 25 (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \
c887d333 26 [
a2ce7dbd
PB
27 'cdrom-test',
28 'device-introspect-test',
29 'machine-none-test',
30 'qmp-test',
31 'qmp-cmd-test',
32 'qom-test',
33 'test-hmp',
34 'qos-test',
35]
36if config_host.has_key('CONFIG_MODULES')
37 qtests_generic += [ 'modules-test' ]
38endif
39
40qtests_pci = \
41 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \
42 (config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : [])
43
44qtests_i386 = \
4d34a86b 45 (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
a2ce7dbd
PB
46 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
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'] : []) + \
ce94fa7a 70 (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \
bd24550e 71 (config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \
e32b96b5
LV
72 (config_all_devices.has_key('CONFIG_VIRTIO_NET') and \
73 config_all_devices.has_key('CONFIG_Q35') and \
74 config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \
75 slirp.found() ? ['virtio-net-failover'] : []) + \
809954ef 76 (unpack_edk2_blobs ? ['bios-tables-test'] : []) + \
a2ce7dbd
PB
77 qtests_pci + \
78 ['fdc-test',
79 'ide-test',
a2ce7dbd
PB
80 'hd-geo-test',
81 'boot-order-test',
a2ce7dbd
PB
82 'rtc-test',
83 'i440fx-test',
84 'fw_cfg-test',
85 'device-plug-test',
86 'drive_del-test',
87 'tco-test',
88 'cpu-plug-test',
89 'q35-test',
90 'vmgenid-test',
91 'migration-test',
92 'test-x86-cpuid-compat',
31fb263c
TH
93 'numa-test',
94 'test-filter-redirector'
95 ]
a2ce7dbd 96
b4dd5b6a
MAL
97if dbus_display
98 qtests_i386 += ['dbus-display-test']
99endif
100
a2ce7dbd
PB
101dbus_daemon = find_program('dbus-daemon', required: false)
102if dbus_daemon.found() and config_host.has_key('GDBUS_CODEGEN')
103 # Temporarily disabled due to Patchew failures:
104 #qtests_i386 += ['dbus-vmstate-test']
105 dbus_vmstate1 = custom_target('dbus-vmstate description',
106 output: ['dbus-vmstate1.h', 'dbus-vmstate1.c'],
861aa79a 107 input: meson.project_source_root() / 'backends/dbus-vmstate1.xml',
a2ce7dbd
PB
108 command: [config_host['GDBUS_CODEGEN'],
109 '@INPUT@',
110 '--interface-prefix', 'org.qemu',
111 '--generate-c-code', '@BASENAME@']).to_list()
112else
113 dbus_vmstate1 = []
114endif
115
116qtests_x86_64 = qtests_i386
117
31fb263c
TH
118qtests_alpha = ['boot-serial-test'] + \
119 ['test-filter-mirror', 'test-filter-redirector'] + \
120 (slirp.found() ? ['test-netfilter'] : []) + \
a2ce7dbd
PB
121 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
122
123qtests_avr = [ 'boot-serial-test' ]
124
31fb263c
TH
125qtests_hppa = ['boot-serial-test'] + \
126 ['test-filter-mirror', 'test-filter-redirector'] + \
127 (slirp.found() ? ['test-netfilter'] : []) + \
a2ce7dbd
PB
128 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
129
31fb263c
TH
130qtests_m68k = ['boot-serial-test'] + \
131 ['test-filter-mirror', 'test-filter-redirector'] + \
132 (slirp.found() ? ['test-netfilter'] : [])
133
134qtests_microblaze = ['boot-serial-test'] + \
135 ['test-filter-mirror', 'test-filter-redirector'] + \
136 (slirp.found() ? ['test-netfilter'] : [])
137
a2ce7dbd
PB
138qtests_microblazeel = qtests_microblaze
139
140qtests_mips = \
31fb263c
TH
141 ['test-filter-mirror', 'test-filter-redirector'] + \
142 (slirp.found() ? ['test-netfilter'] : []) + \
a2ce7dbd
PB
143 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
144 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
145
20516580
TH
146qtests_mipsel = qtests_mips
147qtests_mips64 = qtests_mips
148qtests_mips64el = qtests_mips
a2ce7dbd 149
a2ce7dbd 150qtests_ppc = \
31fb263c
TH
151 ['test-filter-mirror', 'test-filter-redirector'] + \
152 (slirp.found() ? ['test-netfilter'] : []) + \
a2ce7dbd
PB
153 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
154 (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + \
44d827ea 155 (config_all_devices.has_key('CONFIG_TCG') ? ['prom-env-test'] : []) + \
74884cb1
DHB
156 (config_all_devices.has_key('CONFIG_TCG') ? ['boot-serial-test'] : []) + \
157 ['boot-order-test']
a2ce7dbd
PB
158
159qtests_ppc64 = \
a9697d09 160 qtests_ppc + \
a2ce7dbd
PB
161 (config_all_devices.has_key('CONFIG_PSERIES') ? ['device-plug-test'] : []) + \
162 (config_all_devices.has_key('CONFIG_POWERNV') ? ['pnv-xscom-test'] : []) + \
163 (config_all_devices.has_key('CONFIG_PSERIES') ? ['rtas-test'] : []) + \
31fb263c 164 (slirp.found() ? ['pxe-test'] : []) + \
a2ce7dbd
PB
165 (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
166 (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
d8a18da5 167 qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test', 'drive_del-test']
a2ce7dbd
PB
168
169qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
170qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
171
31fb263c
TH
172qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test'] + \
173 ['test-filter-mirror', 'test-filter-redirector'] + \
174 (slirp.found() ? ['test-netfilter'] : [])
a2ce7dbd
PB
175
176qtests_sparc64 = \
177 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
31fb263c
TH
178 (slirp.found() ? ['test-netfilter'] : []) + \
179 ['test-filter-mirror', 'test-filter-redirector'] + \
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
CLG
193 ['aspeed_hace-test',
194 'aspeed_smc-test']
a2ce7dbd 195qtests_arm = \
1eca58aa 196 (config_all_devices.has_key('CONFIG_MPS2') ? ['sse-timer-test'] : []) + \
9bc064b5 197 (config_all_devices.has_key('CONFIG_CMSDK_APB_DUALTIMER') ? ['cmsdk-apb-dualtimer-test'] : []) + \
30858daf 198 (config_all_devices.has_key('CONFIG_CMSDK_APB_TIMER') ? ['cmsdk-apb-timer-test'] : []) + \
9cf5eb29 199 (config_all_devices.has_key('CONFIG_CMSDK_APB_WATCHDOG') ? ['cmsdk-apb-watchdog-test'] : []) + \
a2ce7dbd 200 (config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) + \
66609952 201 (config_all_devices.has_key('CONFIG_ASPEED_SOC') ? qtests_aspeed : []) + \
288c31e3 202 (config_all_devices.has_key('CONFIG_NPCM7XX') ? qtests_npcm7xx : []) + \
a2ce7dbd
PB
203 ['arm-cpu-features',
204 'microbit-test',
a2ce7dbd
PB
205 'test-arm-mptimer',
206 'boot-serial-test',
207 'hexloader-test']
208
209# TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional
210qtests_aarch64 = \
809954ef 211 (cpu != 'arm' and unpack_edk2_blobs ? ['bios-tables-test'] : []) + \
a2ce7dbd
PB
212 (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-test'] : []) + \
213 (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-swtpm-test'] : []) + \
bf22f151 214 (config_all_devices.has_key('CONFIG_XLNX_ZYNQMP_ARM') ? ['xlnx-can-test', 'fuzz-xlnx-dp-test'] : []) + \
05889d15
AJ
215 ['arm-cpu-features',
216 'numa-test',
a2ce7dbd
PB
217 'boot-serial-test',
218 'migration-test']
219
220qtests_s390x = \
4d34a86b 221 (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
a2ce7dbd
PB
222 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
223 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
224 ['boot-serial-test',
225 'drive_del-test',
226 'device-plug-test',
227 'virtio-ccw-test',
228 'cpu-plug-test',
229 'migration-test']
230
231qos_test_ss = ss.source_set()
232qos_test_ss.add(
233 'ac97-test.c',
c0167539 234 'adm1272-test.c',
a2ce7dbd
PB
235 'ds1338-test.c',
236 'e1000-test.c',
237 'e1000e-test.c',
238 'eepro100-test.c',
239 'es1370-test.c',
240 'ipoctal232-test.c',
4fd1ebb1 241 'lsm303dlhc-mag-test.c',
ffcdae67 242 'isl_pmbus_vr-test.c',
7649086f 243 'max34451-test.c',
a2ce7dbd
PB
244 'megasas-test.c',
245 'ne2000-test.c',
246 'tulip-test.c',
247 'nvme-test.c',
248 'pca9552-test.c',
249 'pci-test.c',
250 'pcnet-test.c',
251 'sdhci-test.c',
252 'spapr-phb-test.c',
253 'tmp105-test.c',
5e623f2b 254 'emc141x-test.c',
a2ce7dbd
PB
255 'usb-hcd-ohci-test.c',
256 'virtio-test.c',
257 'virtio-blk-test.c',
258 'virtio-net-test.c',
259 'virtio-rng-test.c',
260 'virtio-scsi-test.c',
261 'virtio-serial-test.c',
becf8873 262 'virtio-iommu-test.c',
a2ce7dbd
PB
263 'vmxnet3-test.c',
264)
2c9dce01
PB
265if have_virtfs
266 qos_test_ss.add(files('virtio-9p-test.c'))
267endif
a2ce7dbd 268qos_test_ss.add(when: 'CONFIG_VHOST_USER', if_true: files('vhost-user-test.c'))
80695202
CX
269if have_tools and have_vhost_user_blk_server
270 qos_test_ss.add(files('vhost-user-blk-test.c'))
271endif
a2ce7dbd 272
da00d067
PB
273tpmemu_files = ['tpm-emu.c', 'tpm-util.c', 'tpm-tests.c']
274
275qtests = {
276 'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'],
a2ce7dbd 277 'cdrom-test': files('boot-sector.c'),
a2ce7dbd 278 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1,
bd24550e 279 'erst-test': files('erst-test.c'),
da00d067
PB
280 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'],
281 'migration-test': files('migration-helpers.c'),
282 'pxe-test': files('boot-sector.c'),
283 'qos-test': [chardev, io, qos_test_ss.apply(config_host, strict: false).sources()],
284 'tpm-crb-swtpm-test': [io, tpmemu_files],
285 'tpm-crb-test': [io, tpmemu_files],
286 'tpm-tis-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
287 'tpm-tis-test': [io, tpmemu_files, 'tpm-tis-util.c'],
288 'tpm-tis-device-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
289 'tpm-tis-device-test': [io, tpmemu_files, 'tpm-tis-util.c'],
a2ce7dbd 290 'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'),
a2ce7dbd
PB
291}
292
b4dd5b6a
MAL
293if dbus_display
294qtests += {'dbus-display-test': [dbus_display1, gio]}
295endif
296
a2ce7dbd
PB
297qtest_executables = {}
298foreach dir : target_dirs
299 if not dir.endswith('-softmmu')
300 continue
301 endif
302
303 target_base = dir.split('-')[0]
fd5eef85 304 qtest_emulator = emulators['qemu-system-' + target_base]
da00d067 305 target_qtests = get_variable('qtests_' + target_base, []) + qtests_generic
a2ce7dbd 306
809954ef 307 test_deps = roms
a2ce7dbd 308 qtest_env = environment()
fd5eef85
PB
309 if have_tools
310 qtest_env.set('QTEST_QEMU_IMG', './qemu-img')
311 test_deps += [qemu_img]
312 endif
654d6b04 313 qtest_env.set('G_TEST_DBUS_DAEMON', meson.project_source_root() / 'tests/dbus-vmstate-daemon.sh')
64ed6f92 314 qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base)
cc1838c2
TH
315 if have_tools and have_vhost_user_blk_server
316 qtest_env.set('QTEST_QEMU_STORAGE_DAEMON_BINARY', './storage-daemon/qemu-storage-daemon')
317 test_deps += [qsd]
318 endif
319
da00d067 320 foreach test : target_qtests
a2ce7dbd
PB
321 # Executables are shared across targets, declare them only the first time we
322 # encounter them
323 if not qtest_executables.has_key(test)
da00d067
PB
324 src = [test + '.c']
325 deps = [qemuutil, qos]
326 if test in qtests
327 # use a sourceset to quickly separate sources and deps
328 test_ss = ss.source_set()
329 test_ss.add(qtests[test])
330 src += test_ss.all_sources()
331 deps += test_ss.all_dependencies()
332 endif
a2ce7dbd 333 qtest_executables += {
da00d067 334 test: executable(test, src, dependencies: deps)
a2ce7dbd
PB
335 }
336 endif
34f02e9f 337 test('qtest-@0@/@1@'.format(target_base, test),
a2ce7dbd 338 qtest_executables[test],
fb72176b 339 depends: [test_deps, qtest_emulator, emulator_modules],
a2ce7dbd
PB
340 env: qtest_env,
341 args: ['--tap', '-k'],
342 protocol: 'tap',
dc1d91ac
PB
343 timeout: slow_qtests.get(test, 30),
344 priority: slow_qtests.get(test, 30),
a2ce7dbd
PB
345 suite: ['qtest', 'qtest-' + target_base])
346 endforeach
347endforeach