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