1 # All QTests for now are POSIX-only, but the dependencies are
2 # really in libqtest, not in the testcases themselves.
3 if not config_host.has_key('CONFIG_POSIX')
9 'device-introspect-test',
17 if config_host.has_key('CONFIG_MODULES')
18 qtests_generic += [ 'modules-test' ]
22 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \
23 (config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : [])
26 (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
27 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
28 (have_tools ? ['ahci-test'] : []) + \
29 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
30 (config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : []) + \
31 (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['test-filter-redirector'] : []) + \
32 (config_all_devices.has_key('CONFIG_ISA_IPMI_KCS') ? ['ipmi-kcs-test'] : []) + \
33 (config_host.has_key('CONFIG_LINUX') and \
34 config_all_devices.has_key('CONFIG_ISA_IPMI_BT') ? ['ipmi-bt-test'] : []) + \
35 (config_all_devices.has_key('CONFIG_WDT_IB700') ? ['wdt_ib700-test'] : []) + \
36 (config_all_devices.has_key('CONFIG_PVPANIC_ISA') ? ['pvpanic-test'] : []) + \
37 (config_all_devices.has_key('CONFIG_PVPANIC_PCI') ? ['pvpanic-pci-test'] : []) + \
38 (config_all_devices.has_key('CONFIG_HDA') ? ['intel-hda-test'] : []) + \
39 (config_all_devices.has_key('CONFIG_I82801B11') ? ['i82801b11-test'] : []) + \
40 (config_all_devices.has_key('CONFIG_IOH3420') ? ['ioh3420-test'] : []) + \
41 (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
42 (config_all_devices.has_key('CONFIG_USB_UHCI') and \
43 config_all_devices.has_key('CONFIG_USB_EHCI') ? ['usb-hcd-ehci-test'] : []) + \
44 (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
45 (config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-test'] : []) + \
46 (config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-swtpm-test'] : []) + \
47 (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-test'] : []) + \
48 (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-swtpm-test'] : []) + \
49 (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \
67 'test-x86-cpuid-compat',
70 dbus_daemon = find_program('dbus-daemon', required: false)
71 if dbus_daemon.found() and config_host.has_key('GDBUS_CODEGEN')
72 # Temporarily disabled due to Patchew failures:
73 #qtests_i386 += ['dbus-vmstate-test']
74 dbus_vmstate1 = custom_target('dbus-vmstate description',
75 output: ['dbus-vmstate1.h', 'dbus-vmstate1.c'],
76 input: files('dbus-vmstate1.xml'),
77 command: [config_host['GDBUS_CODEGEN'],
79 '--interface-prefix', 'org.qemu',
80 '--generate-c-code', '@BASENAME@']).to_list()
85 qtests_x86_64 = qtests_i386
87 qtests_alpha = [ 'boot-serial-test' ] + \
88 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
90 qtests_avr = [ 'boot-serial-test' ]
92 qtests_hppa = [ 'boot-serial-test' ] + \
93 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
95 qtests_m68k = [ 'boot-serial-test' ]
96 qtests_microblaze = [ 'boot-serial-test' ]
97 qtests_microblazeel = qtests_microblaze
100 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
101 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
104 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
105 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
108 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
109 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
111 qtests_moxie = [ 'boot-serial-test' ]
114 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
115 (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + \
116 ['boot-order-test', 'prom-env-test', 'boot-serial-test'] \
119 (config_all_devices.has_key('CONFIG_PSERIES') ? ['device-plug-test'] : []) + \
120 (config_all_devices.has_key('CONFIG_POWERNV') ? ['pnv-xscom-test'] : []) + \
121 (config_all_devices.has_key('CONFIG_PSERIES') ? ['rtas-test'] : []) + \
122 (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
123 (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
124 (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
125 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
126 qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test', 'drive_del-test']
128 qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
129 qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
131 qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test']
134 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
135 ['prom-env-test', 'boot-serial-test']
142 'npcm7xx_timer-test',
143 'npcm7xx_watchdog_timer-test']
145 (config_all_devices.has_key('CONFIG_CMSDK_APB_DUALTIMER') ? ['cmsdk-apb-dualtimer-test'] : []) + \
146 (config_all_devices.has_key('CONFIG_CMSDK_APB_TIMER') ? ['cmsdk-apb-timer-test'] : []) + \
147 (config_all_devices.has_key('CONFIG_CMSDK_APB_WATCHDOG') ? ['cmsdk-apb-watchdog-test'] : []) + \
148 (config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) + \
149 (config_all_devices.has_key('CONFIG_NPCM7XX') ? qtests_npcm7xx : []) + \
157 # TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional
159 (cpu != 'arm' ? ['bios-tables-test'] : []) + \
160 (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-test'] : []) + \
161 (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-swtpm-test'] : []) + \
169 (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
170 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
171 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
179 qos_test_ss = ss.source_set()
199 'usb-hcd-ohci-test.c',
204 'virtio-scsi-test.c',
205 'virtio-serial-test.c',
209 qos_test_ss.add(files('virtio-9p-test.c'))
211 qos_test_ss.add(when: 'CONFIG_VHOST_USER', if_true: files('vhost-user-test.c'))
213 tpmemu_files = ['tpm-emu.c', 'tpm-util.c', 'tpm-tests.c']
216 'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'],
217 'cdrom-test': files('boot-sector.c'),
218 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1,
219 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'],
220 'migration-test': files('migration-helpers.c'),
221 'pxe-test': files('boot-sector.c'),
222 'qos-test': [chardev, io, qos_test_ss.apply(config_host, strict: false).sources()],
223 'tpm-crb-swtpm-test': [io, tpmemu_files],
224 'tpm-crb-test': [io, tpmemu_files],
225 'tpm-tis-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
226 'tpm-tis-test': [io, tpmemu_files, 'tpm-tis-util.c'],
227 'tpm-tis-device-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
228 'tpm-tis-device-test': [io, tpmemu_files, 'tpm-tis-util.c'],
229 'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'),
232 qtest_executables = {}
233 foreach dir : target_dirs
234 if not dir.endswith('-softmmu')
238 target_base = dir.split('-')[0]
239 qtest_emulator = emulators['qemu-system-' + target_base]
240 target_qtests = get_variable('qtests_' + target_base, []) + qtests_generic
243 qtest_env = environment()
245 qtest_env.set('QTEST_QEMU_IMG', './qemu-img')
246 test_deps += [qemu_img]
248 qtest_env.set('G_TEST_DBUS_DAEMON', meson.source_root() / 'tests/dbus-vmstate-daemon.sh')
249 qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base)
251 foreach test : target_qtests
252 # Executables are shared across targets, declare them only the first time we
254 if not qtest_executables.has_key(test)
256 deps = [qemuutil, qos]
258 # use a sourceset to quickly separate sources and deps
259 test_ss = ss.source_set()
260 test_ss.add(qtests[test])
261 src += test_ss.all_sources()
262 deps += test_ss.all_dependencies()
264 qtest_executables += {
265 test: executable(test, src, dependencies: deps)
268 # FIXME: missing dependency on the emulator binary and qemu-img
269 test('qtest-@0@/@1@'.format(target_base, test),
270 qtest_executables[test],
271 depends: [test_deps, qtest_emulator],
273 args: ['--tap', '-k'],
275 suite: ['qtest', 'qtest-' + target_base])