]>
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', | |
d8dd1095 | 57 | 'fuzz-test', |
a2ce7dbd PB |
58 | 'fw_cfg-test', |
59 | 'device-plug-test', | |
60 | 'drive_del-test', | |
61 | 'tco-test', | |
62 | 'cpu-plug-test', | |
63 | 'q35-test', | |
64 | 'vmgenid-test', | |
65 | 'migration-test', | |
66 | 'test-x86-cpuid-compat', | |
67 | 'numa-test'] | |
68 | ||
69 | dbus_daemon = find_program('dbus-daemon', required: false) | |
70 | if dbus_daemon.found() and config_host.has_key('GDBUS_CODEGEN') | |
71 | # Temporarily disabled due to Patchew failures: | |
72 | #qtests_i386 += ['dbus-vmstate-test'] | |
73 | dbus_vmstate1 = custom_target('dbus-vmstate description', | |
74 | output: ['dbus-vmstate1.h', 'dbus-vmstate1.c'], | |
75 | input: files('dbus-vmstate1.xml'), | |
76 | command: [config_host['GDBUS_CODEGEN'], | |
77 | '@INPUT@', | |
78 | '--interface-prefix', 'org.qemu', | |
79 | '--generate-c-code', '@BASENAME@']).to_list() | |
80 | else | |
81 | dbus_vmstate1 = [] | |
82 | endif | |
83 | ||
84 | qtests_x86_64 = qtests_i386 | |
85 | ||
86 | qtests_alpha = [ 'boot-serial-test' ] + \ | |
87 | (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) | |
88 | ||
89 | qtests_avr = [ 'boot-serial-test' ] | |
90 | ||
91 | qtests_hppa = [ 'boot-serial-test' ] + \ | |
92 | (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) | |
93 | ||
94 | qtests_m68k = [ 'boot-serial-test' ] | |
95 | qtests_microblaze = [ 'boot-serial-test' ] | |
96 | qtests_microblazeel = qtests_microblaze | |
97 | ||
98 | qtests_mips = \ | |
99 | (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ | |
100 | (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) | |
101 | ||
102 | qtests_mips64 = \ | |
103 | (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ | |
104 | (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) | |
105 | ||
106 | qtests_mips64el = \ | |
107 | (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ | |
108 | (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) | |
109 | ||
110 | qtests_moxie = [ 'boot-serial-test' ] | |
111 | ||
112 | qtests_ppc = \ | |
113 | (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ | |
114 | (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + \ | |
d8a18da5 | 115 | ['boot-order-test', 'prom-env-test', 'boot-serial-test'] \ |
a2ce7dbd PB |
116 | |
117 | qtests_ppc64 = \ | |
118 | (config_all_devices.has_key('CONFIG_PSERIES') ? ['device-plug-test'] : []) + \ | |
119 | (config_all_devices.has_key('CONFIG_POWERNV') ? ['pnv-xscom-test'] : []) + \ | |
120 | (config_all_devices.has_key('CONFIG_PSERIES') ? ['rtas-test'] : []) + \ | |
4d34a86b | 121 | (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \ |
a2ce7dbd PB |
122 | (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \ |
123 | (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \ | |
124 | (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \ | |
d8a18da5 | 125 | qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test', 'drive_del-test'] |
a2ce7dbd PB |
126 | |
127 | qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) | |
128 | qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) | |
129 | ||
130 | qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test'] | |
131 | ||
132 | qtests_sparc64 = \ | |
133 | (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ | |
134 | ['prom-env-test', 'boot-serial-test'] | |
135 | ||
326ccfe2 | 136 | qtests_npcm7xx = \ |
526dbbe0 HS |
137 | ['npcm7xx_gpio-test', |
138 | 'npcm7xx_rng-test', | |
326ccfe2 HS |
139 | 'npcm7xx_timer-test', |
140 | 'npcm7xx_watchdog_timer-test'] | |
a2ce7dbd PB |
141 | qtests_arm = \ |
142 | (config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) + \ | |
288c31e3 | 143 | (config_all_devices.has_key('CONFIG_NPCM7XX') ? qtests_npcm7xx : []) + \ |
a2ce7dbd PB |
144 | ['arm-cpu-features', |
145 | 'microbit-test', | |
146 | 'm25p80-test', | |
147 | 'test-arm-mptimer', | |
148 | 'boot-serial-test', | |
149 | 'hexloader-test'] | |
150 | ||
151 | # TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional | |
152 | qtests_aarch64 = \ | |
153 | (cpu != 'arm' ? ['bios-tables-test'] : []) + \ | |
154 | (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-test'] : []) + \ | |
155 | (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-swtpm-test'] : []) + \ | |
05889d15 AJ |
156 | ['arm-cpu-features', |
157 | 'numa-test', | |
a2ce7dbd | 158 | 'boot-serial-test', |
ab5e842c | 159 | 'xlnx-can-test', |
a2ce7dbd PB |
160 | 'migration-test'] |
161 | ||
162 | qtests_s390x = \ | |
4d34a86b | 163 | (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \ |
a2ce7dbd PB |
164 | (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \ |
165 | (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \ | |
166 | ['boot-serial-test', | |
167 | 'drive_del-test', | |
168 | 'device-plug-test', | |
169 | 'virtio-ccw-test', | |
170 | 'cpu-plug-test', | |
171 | 'migration-test'] | |
172 | ||
173 | qos_test_ss = ss.source_set() | |
174 | qos_test_ss.add( | |
175 | 'ac97-test.c', | |
176 | 'ds1338-test.c', | |
177 | 'e1000-test.c', | |
178 | 'e1000e-test.c', | |
179 | 'eepro100-test.c', | |
180 | 'es1370-test.c', | |
181 | 'ipoctal232-test.c', | |
182 | 'megasas-test.c', | |
183 | 'ne2000-test.c', | |
184 | 'tulip-test.c', | |
185 | 'nvme-test.c', | |
186 | 'pca9552-test.c', | |
187 | 'pci-test.c', | |
188 | 'pcnet-test.c', | |
189 | 'sdhci-test.c', | |
190 | 'spapr-phb-test.c', | |
191 | 'tmp105-test.c', | |
5e623f2b | 192 | 'emc141x-test.c', |
a2ce7dbd PB |
193 | 'usb-hcd-ohci-test.c', |
194 | 'virtio-test.c', | |
195 | 'virtio-blk-test.c', | |
196 | 'virtio-net-test.c', | |
197 | 'virtio-rng-test.c', | |
198 | 'virtio-scsi-test.c', | |
199 | 'virtio-serial-test.c', | |
200 | 'vmxnet3-test.c', | |
201 | ) | |
2c9dce01 PB |
202 | if have_virtfs |
203 | qos_test_ss.add(files('virtio-9p-test.c')) | |
204 | endif | |
a2ce7dbd PB |
205 | qos_test_ss.add(when: 'CONFIG_VHOST_USER', if_true: files('vhost-user-test.c')) |
206 | ||
da00d067 PB |
207 | tpmemu_files = ['tpm-emu.c', 'tpm-util.c', 'tpm-tests.c'] |
208 | ||
209 | qtests = { | |
210 | 'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'], | |
a2ce7dbd | 211 | 'cdrom-test': files('boot-sector.c'), |
a2ce7dbd | 212 | 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1, |
da00d067 PB |
213 | 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'], |
214 | 'migration-test': files('migration-helpers.c'), | |
215 | 'pxe-test': files('boot-sector.c'), | |
216 | 'qos-test': [chardev, io, qos_test_ss.apply(config_host, strict: false).sources()], | |
217 | 'tpm-crb-swtpm-test': [io, tpmemu_files], | |
218 | 'tpm-crb-test': [io, tpmemu_files], | |
219 | 'tpm-tis-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'], | |
220 | 'tpm-tis-test': [io, tpmemu_files, 'tpm-tis-util.c'], | |
221 | 'tpm-tis-device-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'], | |
222 | 'tpm-tis-device-test': [io, tpmemu_files, 'tpm-tis-util.c'], | |
a2ce7dbd | 223 | 'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'), |
a2ce7dbd PB |
224 | } |
225 | ||
a2ce7dbd PB |
226 | qtest_executables = {} |
227 | foreach dir : target_dirs | |
228 | if not dir.endswith('-softmmu') | |
229 | continue | |
230 | endif | |
231 | ||
232 | target_base = dir.split('-')[0] | |
fd5eef85 | 233 | qtest_emulator = emulators['qemu-system-' + target_base] |
da00d067 | 234 | target_qtests = get_variable('qtests_' + target_base, []) + qtests_generic |
a2ce7dbd | 235 | |
fd5eef85 | 236 | test_deps = [] |
a2ce7dbd | 237 | qtest_env = environment() |
fd5eef85 PB |
238 | if have_tools |
239 | qtest_env.set('QTEST_QEMU_IMG', './qemu-img') | |
240 | test_deps += [qemu_img] | |
241 | endif | |
a2ce7dbd | 242 | qtest_env.set('G_TEST_DBUS_DAEMON', meson.source_root() / 'tests/dbus-vmstate-daemon.sh') |
64ed6f92 | 243 | qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base) |
a2ce7dbd | 244 | |
da00d067 | 245 | foreach test : target_qtests |
a2ce7dbd PB |
246 | # Executables are shared across targets, declare them only the first time we |
247 | # encounter them | |
248 | if not qtest_executables.has_key(test) | |
da00d067 PB |
249 | src = [test + '.c'] |
250 | deps = [qemuutil, qos] | |
251 | if test in qtests | |
252 | # use a sourceset to quickly separate sources and deps | |
253 | test_ss = ss.source_set() | |
254 | test_ss.add(qtests[test]) | |
255 | src += test_ss.all_sources() | |
256 | deps += test_ss.all_dependencies() | |
257 | endif | |
a2ce7dbd | 258 | qtest_executables += { |
da00d067 | 259 | test: executable(test, src, dependencies: deps) |
a2ce7dbd PB |
260 | } |
261 | endif | |
262 | # FIXME: missing dependency on the emulator binary and qemu-img | |
34f02e9f | 263 | test('qtest-@0@/@1@'.format(target_base, test), |
a2ce7dbd | 264 | qtest_executables[test], |
fd5eef85 | 265 | depends: [test_deps, qtest_emulator], |
a2ce7dbd PB |
266 | env: qtest_env, |
267 | args: ['--tap', '-k'], | |
268 | protocol: 'tap', | |
269 | suite: ['qtest', 'qtest-' + target_base]) | |
270 | endforeach | |
271 | endforeach |