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') ? ['pvpanic-test'] : []) + \
37 (config_all_devices.has_key('CONFIG_HDA') ? ['intel-hda-test'] : []) + \
38 (config_all_devices.has_key('CONFIG_I82801B11') ? ['i82801b11-test'] : []) + \
39 (config_all_devices.has_key('CONFIG_IOH3420') ? ['ioh3420-test'] : []) + \
40 (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
41 (config_all_devices.has_key('CONFIG_USB_UHCI') and \
42 config_all_devices.has_key('CONFIG_USB_EHCI') ? ['usb-hcd-ehci-test'] : []) + \
43 (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
44 (config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-test'] : []) + \
45 (config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-swtpm-test'] : []) + \
46 (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-test'] : []) + \
47 (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-swtpm-test'] : []) + \
48 (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \
65 'test-x86-cpuid-compat',
68 dbus_daemon = find_program('dbus-daemon', required: false)
69 if dbus_daemon.found() and config_host.has_key('GDBUS_CODEGEN')
70 # Temporarily disabled due to Patchew failures:
71 #qtests_i386 += ['dbus-vmstate-test']
72 dbus_vmstate1 = custom_target('dbus-vmstate description',
73 output: ['dbus-vmstate1.h', 'dbus-vmstate1.c'],
74 input: files('dbus-vmstate1.xml'),
75 command: [config_host['GDBUS_CODEGEN'],
77 '--interface-prefix', 'org.qemu',
78 '--generate-c-code', '@BASENAME@']).to_list()
83 qtests_x86_64 = qtests_i386
85 qtests_alpha = [ 'boot-serial-test' ] + \
86 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
88 qtests_avr = [ 'boot-serial-test' ]
90 qtests_hppa = [ 'boot-serial-test' ] + \
91 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
93 qtests_m68k = [ 'boot-serial-test' ]
94 qtests_microblaze = [ 'boot-serial-test' ]
95 qtests_microblazeel = qtests_microblaze
98 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
99 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
102 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
103 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
106 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
107 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
109 qtests_moxie = [ 'boot-serial-test' ]
112 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
113 (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + \
114 ['boot-order-test', 'prom-env-test', 'drive_del-test', 'boot-serial-test'] \
117 (config_all_devices.has_key('CONFIG_PSERIES') ? ['device-plug-test'] : []) + \
118 (config_all_devices.has_key('CONFIG_POWERNV') ? ['pnv-xscom-test'] : []) + \
119 (config_all_devices.has_key('CONFIG_PSERIES') ? ['rtas-test'] : []) + \
120 (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
121 (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
122 (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
123 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
124 qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test']
126 qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
127 qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
129 qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test']
132 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
133 ['prom-env-test', 'boot-serial-test']
136 (config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) + \
144 # TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional
146 (cpu != 'arm' ? ['bios-tables-test'] : []) + \
147 (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-test'] : []) + \
148 (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-swtpm-test'] : []) + \
154 (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
155 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
156 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
164 qos_test_ss = ss.source_set()
183 'usb-hcd-ohci-test.c',
188 'virtio-scsi-test.c',
189 'virtio-serial-test.c',
192 qos_test_ss.add(when: 'CONFIG_VIRTFS', if_true: files('virtio-9p-test.c'))
193 qos_test_ss.add(when: 'CONFIG_VHOST_USER', if_true: files('vhost-user-test.c'))
196 'bios-tables-test': [io],
197 'ivshmem-test': [rt],
198 'qos-test': [chardev, io],
199 'tpm-crb-swtpm-test': [io],
200 'tpm-crb-test': [io],
201 'tpm-tis-swtpm-test': [io],
202 'tpm-tis-test': [io],
203 'tpm-tis-device-swtpm-test': [io],
204 'tpm-tis-device-test': [io],
207 'bios-tables-test': files('boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'),
208 'pxe-test': files('boot-sector.c'),
209 'cdrom-test': files('boot-sector.c'),
210 'migration-test': files('migration-helpers.c'),
211 'ivshmem-test': files('../../contrib/ivshmem-server/ivshmem-server.c'),
212 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1,
213 'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'),
214 'tpm-crb-swtpm-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tests.c'),
215 'tpm-crb-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tests.c'),
216 'tpm-tis-device-swtpm-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tis-util.c', 'tpm-tests.c'),
217 'tpm-tis-device-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tis-util.c', 'tpm-tests.c'),
218 'tpm-tis-swtpm-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tis-util.c', 'tpm-tests.c'),
219 'tpm-tis-test': files('tpm-emu.c', 'tpm-util.c', 'tpm-tis-util.c', 'tpm-tests.c'),
220 'qos-test': qos_test_ss.apply(config_host, strict: false).sources()
224 qtest_executables = {}
225 foreach dir : target_dirs
226 if not dir.endswith('-softmmu')
230 target_base = dir.split('-')[0]
231 qtest_emulator = emulators['qemu-system-' + target_base]
232 qtests = get_variable('qtests_' + target_base, []) + qtests_generic
235 qtest_env = environment()
237 qtest_env.set('QTEST_QEMU_IMG', './qemu-img')
238 test_deps += [qemu_img]
240 qtest_env.set('G_TEST_DBUS_DAEMON', meson.source_root() / 'tests/dbus-vmstate-daemon.sh')
241 qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base)
243 foreach test : qtests
244 # Executables are shared across targets, declare them only the first time we
246 if not qtest_executables.has_key(test)
247 qtest_executables += {
248 test: executable(test,
249 files(test + '.c') + extra_qtest_srcs.get(test, []),
250 dependencies: [qemuutil, qos] + extra_qtest_deps.get(test, []))
253 # FIXME: missing dependency on the emulator binary and qemu-img
254 test('qtest-@0@: @1@'.format(target_base, test),
255 qtest_executables[test],
256 depends: [test_deps, qtest_emulator],
258 args: ['--tap', '-k'],
260 suite: ['qtest', 'qtest-' + target_base])