]>
Commit | Line | Data |
---|---|---|
a2ce7dbd PB |
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') | |
4 | subdir_done() | |
5 | endif | |
6 | ||
7 | qtests_generic = [ | |
8 | 'cdrom-test', | |
9 | 'device-introspect-test', | |
10 | 'machine-none-test', | |
11 | 'qmp-test', | |
12 | 'qmp-cmd-test', | |
13 | 'qom-test', | |
14 | 'test-hmp', | |
15 | 'qos-test', | |
16 | ] | |
17 | if config_host.has_key('CONFIG_MODULES') | |
18 | qtests_generic += [ 'modules-test' ] | |
19 | endif | |
20 | ||
21 | qtests_pci = \ | |
22 | (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \ | |
23 | (config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : []) | |
24 | ||
25 | qtests_i386 = \ | |
4d34a86b | 26 | (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \ |
a2ce7dbd PB |
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'] : []) + \ | |
49 | qtests_pci + \ | |
50 | ['fdc-test', | |
51 | 'ide-test', | |
a2ce7dbd PB |
52 | 'hd-geo-test', |
53 | 'boot-order-test', | |
54 | 'bios-tables-test', | |
55 | 'rtc-test', | |
56 | 'i440fx-test', | |
57 | 'fw_cfg-test', | |
58 | 'device-plug-test', | |
59 | 'drive_del-test', | |
60 | 'tco-test', | |
61 | 'cpu-plug-test', | |
62 | 'q35-test', | |
63 | 'vmgenid-test', | |
64 | 'migration-test', | |
65 | 'test-x86-cpuid-compat', | |
66 | 'numa-test'] | |
67 | ||
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'], | |
76 | '@INPUT@', | |
77 | '--interface-prefix', 'org.qemu', | |
78 | '--generate-c-code', '@BASENAME@']).to_list() | |
79 | else | |
80 | dbus_vmstate1 = [] | |
81 | endif | |
82 | ||
83 | qtests_x86_64 = qtests_i386 | |
84 | ||
85 | qtests_alpha = [ 'boot-serial-test' ] + \ | |
86 | (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) | |
87 | ||
88 | qtests_avr = [ 'boot-serial-test' ] | |
89 | ||
90 | qtests_hppa = [ 'boot-serial-test' ] + \ | |
91 | (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) | |
92 | ||
93 | qtests_m68k = [ 'boot-serial-test' ] | |
94 | qtests_microblaze = [ 'boot-serial-test' ] | |
95 | qtests_microblazeel = qtests_microblaze | |
96 | ||
97 | qtests_mips = \ | |
98 | (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ | |
99 | (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) | |
100 | ||
101 | qtests_mips64 = \ | |
102 | (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ | |
103 | (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) | |
104 | ||
105 | qtests_mips64el = \ | |
106 | (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ | |
107 | (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) | |
108 | ||
109 | qtests_moxie = [ 'boot-serial-test' ] | |
110 | ||
111 | qtests_ppc = \ | |
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'] \ | |
115 | ||
116 | qtests_ppc64 = \ | |
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'] : []) + \ | |
4d34a86b | 120 | (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \ |
a2ce7dbd PB |
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'] | |
125 | ||
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'] : []) | |
128 | ||
129 | qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test'] | |
130 | ||
131 | qtests_sparc64 = \ | |
132 | (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ | |
133 | ['prom-env-test', 'boot-serial-test'] | |
134 | ||
135 | qtests_arm = \ | |
136 | (config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) + \ | |
137 | ['arm-cpu-features', | |
138 | 'microbit-test', | |
139 | 'm25p80-test', | |
140 | 'test-arm-mptimer', | |
141 | 'boot-serial-test', | |
142 | 'hexloader-test'] | |
143 | ||
144 | # TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional | |
145 | qtests_aarch64 = \ | |
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'] : []) + \ | |
05889d15 AJ |
149 | ['arm-cpu-features', |
150 | 'numa-test', | |
a2ce7dbd PB |
151 | 'boot-serial-test', |
152 | 'migration-test'] | |
153 | ||
154 | qtests_s390x = \ | |
4d34a86b | 155 | (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \ |
a2ce7dbd PB |
156 | (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \ |
157 | (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \ | |
158 | ['boot-serial-test', | |
159 | 'drive_del-test', | |
160 | 'device-plug-test', | |
161 | 'virtio-ccw-test', | |
162 | 'cpu-plug-test', | |
163 | 'migration-test'] | |
164 | ||
165 | qos_test_ss = ss.source_set() | |
166 | qos_test_ss.add( | |
167 | 'ac97-test.c', | |
168 | 'ds1338-test.c', | |
169 | 'e1000-test.c', | |
170 | 'e1000e-test.c', | |
171 | 'eepro100-test.c', | |
172 | 'es1370-test.c', | |
173 | 'ipoctal232-test.c', | |
174 | 'megasas-test.c', | |
175 | 'ne2000-test.c', | |
176 | 'tulip-test.c', | |
177 | 'nvme-test.c', | |
178 | 'pca9552-test.c', | |
179 | 'pci-test.c', | |
180 | 'pcnet-test.c', | |
181 | 'sdhci-test.c', | |
182 | 'spapr-phb-test.c', | |
183 | 'tmp105-test.c', | |
184 | 'usb-hcd-ohci-test.c', | |
185 | 'virtio-test.c', | |
186 | 'virtio-blk-test.c', | |
187 | 'virtio-net-test.c', | |
188 | 'virtio-rng-test.c', | |
189 | 'virtio-scsi-test.c', | |
190 | 'virtio-serial-test.c', | |
191 | 'vmxnet3-test.c', | |
192 | ) | |
193 | qos_test_ss.add(when: 'CONFIG_VIRTFS', if_true: files('virtio-9p-test.c')) | |
194 | qos_test_ss.add(when: 'CONFIG_VHOST_USER', if_true: files('vhost-user-test.c')) | |
195 | ||
da00d067 PB |
196 | tpmemu_files = ['tpm-emu.c', 'tpm-util.c', 'tpm-tests.c'] |
197 | ||
198 | qtests = { | |
199 | 'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'], | |
a2ce7dbd | 200 | 'cdrom-test': files('boot-sector.c'), |
a2ce7dbd | 201 | 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1, |
da00d067 PB |
202 | 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'], |
203 | 'migration-test': files('migration-helpers.c'), | |
204 | 'pxe-test': files('boot-sector.c'), | |
205 | 'qos-test': [chardev, io, qos_test_ss.apply(config_host, strict: false).sources()], | |
206 | 'tpm-crb-swtpm-test': [io, tpmemu_files], | |
207 | 'tpm-crb-test': [io, tpmemu_files], | |
208 | 'tpm-tis-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'], | |
209 | 'tpm-tis-test': [io, tpmemu_files, 'tpm-tis-util.c'], | |
210 | 'tpm-tis-device-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'], | |
211 | 'tpm-tis-device-test': [io, tpmemu_files, 'tpm-tis-util.c'], | |
a2ce7dbd | 212 | 'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'), |
a2ce7dbd PB |
213 | } |
214 | ||
a2ce7dbd PB |
215 | qtest_executables = {} |
216 | foreach dir : target_dirs | |
217 | if not dir.endswith('-softmmu') | |
218 | continue | |
219 | endif | |
220 | ||
221 | target_base = dir.split('-')[0] | |
fd5eef85 | 222 | qtest_emulator = emulators['qemu-system-' + target_base] |
da00d067 | 223 | target_qtests = get_variable('qtests_' + target_base, []) + qtests_generic |
a2ce7dbd | 224 | |
fd5eef85 | 225 | test_deps = [] |
a2ce7dbd | 226 | qtest_env = environment() |
fd5eef85 PB |
227 | if have_tools |
228 | qtest_env.set('QTEST_QEMU_IMG', './qemu-img') | |
229 | test_deps += [qemu_img] | |
230 | endif | |
a2ce7dbd | 231 | qtest_env.set('G_TEST_DBUS_DAEMON', meson.source_root() / 'tests/dbus-vmstate-daemon.sh') |
64ed6f92 | 232 | qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base) |
a2ce7dbd | 233 | |
da00d067 | 234 | foreach test : target_qtests |
a2ce7dbd PB |
235 | # Executables are shared across targets, declare them only the first time we |
236 | # encounter them | |
237 | if not qtest_executables.has_key(test) | |
da00d067 PB |
238 | src = [test + '.c'] |
239 | deps = [qemuutil, qos] | |
240 | if test in qtests | |
241 | # use a sourceset to quickly separate sources and deps | |
242 | test_ss = ss.source_set() | |
243 | test_ss.add(qtests[test]) | |
244 | src += test_ss.all_sources() | |
245 | deps += test_ss.all_dependencies() | |
246 | endif | |
a2ce7dbd | 247 | qtest_executables += { |
da00d067 | 248 | test: executable(test, src, dependencies: deps) |
a2ce7dbd PB |
249 | } |
250 | endif | |
251 | # FIXME: missing dependency on the emulator binary and qemu-img | |
252 | test('qtest-@0@: @1@'.format(target_base, test), | |
253 | qtest_executables[test], | |
fd5eef85 | 254 | depends: [test_deps, qtest_emulator], |
a2ce7dbd PB |
255 | env: qtest_env, |
256 | args: ['--tap', '-k'], | |
257 | protocol: 'tap', | |
258 | suite: ['qtest', 'qtest-' + target_base]) | |
259 | endforeach | |
260 | endforeach |