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