2024-08-30 16:38:05 +03:00
|
|
|
# QEMU functional tests:
|
|
|
|
# Tests that are put in the 'quick' category are run by default during
|
|
|
|
# 'make check'. Everything that should not be run during 'make check'
|
|
|
|
# (e.g. tests that fetch assets from the internet) should be put into
|
|
|
|
# the 'thorough' category instead.
|
|
|
|
|
|
|
|
# Most tests run too slow with TCI enabled, so skip the functional tests there
|
|
|
|
if get_option('tcg_interpreter')
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Timeouts for individual tests that can be slow e.g. with debugging enabled
|
|
|
|
test_timeouts = {
|
2024-10-02 17:02:12 +03:00
|
|
|
'aarch64_raspi4' : 120,
|
2024-08-30 16:38:28 +03:00
|
|
|
'aarch64_sbsaref' : 600,
|
2024-08-30 16:38:29 +03:00
|
|
|
'aarch64_virt' : 360,
|
2024-08-30 16:38:23 +03:00
|
|
|
'acpi_bits' : 240,
|
2024-10-02 17:02:12 +03:00
|
|
|
'arm_raspi2' : 120,
|
|
|
|
'mips_malta' : 120,
|
2024-08-30 16:38:11 +03:00
|
|
|
'netdev_ethtool' : 180,
|
2024-08-30 16:38:19 +03:00
|
|
|
'ppc_40p' : 240,
|
2024-08-30 16:38:21 +03:00
|
|
|
'ppc64_hv' : 1000,
|
2024-10-02 17:02:12 +03:00
|
|
|
'ppc64_powernv' : 240,
|
|
|
|
'ppc64_pseries' : 240,
|
|
|
|
's390x_ccw_virtio' : 240,
|
2024-08-30 16:38:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
tests_generic_system = [
|
2024-08-30 16:38:06 +03:00
|
|
|
'empty_cpu_model',
|
2024-08-30 16:38:07 +03:00
|
|
|
'info_usernet',
|
|
|
|
'version',
|
|
|
|
]
|
|
|
|
|
2024-08-30 16:38:05 +03:00
|
|
|
tests_generic_linuxuser = [
|
|
|
|
]
|
|
|
|
|
|
|
|
tests_generic_bsduser = [
|
|
|
|
]
|
|
|
|
|
2024-08-30 16:38:28 +03:00
|
|
|
tests_aarch64_system_thorough = [
|
2024-09-06 21:05:45 +03:00
|
|
|
'aarch64_raspi3',
|
2024-09-06 21:05:46 +03:00
|
|
|
'aarch64_raspi4',
|
2024-08-30 16:38:28 +03:00
|
|
|
'aarch64_sbsaref',
|
2024-08-30 16:38:29 +03:00
|
|
|
'aarch64_virt',
|
2024-09-03 08:13:33 +03:00
|
|
|
'multiprocess',
|
2024-08-30 16:38:28 +03:00
|
|
|
]
|
|
|
|
|
2024-09-06 21:05:47 +03:00
|
|
|
tests_alpha_system_thorough = [
|
|
|
|
'alpha_clipper',
|
|
|
|
]
|
|
|
|
|
2024-08-30 16:38:13 +03:00
|
|
|
tests_arm_system_thorough = [
|
|
|
|
'arm_canona1100',
|
2024-08-30 16:38:27 +03:00
|
|
|
'arm_integratorcp',
|
2024-09-06 21:05:44 +03:00
|
|
|
'arm_raspi2',
|
2024-09-19 21:57:42 +03:00
|
|
|
'arm_vexpress',
|
2024-08-30 16:38:13 +03:00
|
|
|
]
|
|
|
|
|
2024-08-30 16:38:32 +03:00
|
|
|
tests_arm_linuxuser_thorough = [
|
|
|
|
'arm_bflt',
|
|
|
|
]
|
|
|
|
|
2024-08-30 16:38:11 +03:00
|
|
|
tests_avr_system_thorough = [
|
|
|
|
'avr_mega2560',
|
|
|
|
]
|
|
|
|
|
|
|
|
tests_loongarch64_system_thorough = [
|
|
|
|
'loongarch64_virt',
|
|
|
|
]
|
|
|
|
|
2024-08-30 16:38:22 +03:00
|
|
|
tests_m68k_system_thorough = [
|
2024-09-06 21:05:48 +03:00
|
|
|
'm68k_mcf5208evb',
|
2024-09-06 21:05:37 +03:00
|
|
|
'm68k_nextcube',
|
|
|
|
'm68k_q800',
|
2024-08-30 16:38:22 +03:00
|
|
|
]
|
|
|
|
|
2024-08-30 16:38:16 +03:00
|
|
|
tests_microblaze_system_thorough = [
|
|
|
|
'microblaze_s3adsp1800'
|
|
|
|
]
|
|
|
|
|
|
|
|
tests_microblazeel_system_thorough = [
|
|
|
|
'microblazeel_s3adsp1800'
|
|
|
|
]
|
|
|
|
|
2024-09-06 21:05:43 +03:00
|
|
|
tests_mips_system_thorough = [
|
|
|
|
'mips_malta',
|
|
|
|
]
|
|
|
|
|
2024-09-06 21:05:41 +03:00
|
|
|
tests_mipsel_system_thorough = [
|
|
|
|
'mipsel_malta',
|
|
|
|
]
|
|
|
|
|
2024-08-30 16:38:11 +03:00
|
|
|
tests_mips64el_system_thorough = [
|
2024-09-13 20:51:40 +03:00
|
|
|
'mips64el_fuloong2e',
|
2024-08-30 16:38:11 +03:00
|
|
|
'mips64el_loongson3v',
|
2024-09-06 21:05:39 +03:00
|
|
|
'mips64el_malta',
|
2024-08-30 16:38:11 +03:00
|
|
|
]
|
|
|
|
|
2024-09-17 14:02:47 +03:00
|
|
|
tests_or1k_system_thorough = [
|
2024-09-06 21:05:49 +03:00
|
|
|
'or1k_sim',
|
|
|
|
]
|
|
|
|
|
2024-08-30 16:38:11 +03:00
|
|
|
tests_ppc_system_quick = [
|
|
|
|
'ppc_74xx',
|
|
|
|
]
|
|
|
|
|
|
|
|
tests_ppc_system_thorough = [
|
|
|
|
'ppc_405',
|
2024-08-30 16:38:19 +03:00
|
|
|
'ppc_40p',
|
2024-08-30 16:38:20 +03:00
|
|
|
'ppc_amiga',
|
2024-08-30 16:38:13 +03:00
|
|
|
'ppc_bamboo',
|
2024-09-19 21:57:46 +03:00
|
|
|
'ppc_mac',
|
2024-08-30 16:38:19 +03:00
|
|
|
'ppc_mpc8544ds',
|
|
|
|
'ppc_virtex_ml507',
|
|
|
|
]
|
|
|
|
|
|
|
|
tests_ppc64_system_thorough = [
|
2024-09-19 21:57:45 +03:00
|
|
|
'ppc64_e500',
|
2024-08-30 16:38:21 +03:00
|
|
|
'ppc64_hv',
|
2024-08-30 16:38:19 +03:00
|
|
|
'ppc64_powernv',
|
|
|
|
'ppc64_pseries',
|
2024-08-30 16:38:13 +03:00
|
|
|
]
|
|
|
|
|
2024-08-30 16:38:24 +03:00
|
|
|
tests_rx_system_thorough = [
|
|
|
|
'rx_gdbsim',
|
|
|
|
]
|
|
|
|
|
2024-08-30 16:38:14 +03:00
|
|
|
tests_s390x_system_thorough = [
|
|
|
|
's390x_ccw_virtio',
|
|
|
|
's390x_topology',
|
|
|
|
]
|
|
|
|
|
2024-09-19 21:57:47 +03:00
|
|
|
tests_sh4_system_thorough = [
|
|
|
|
'sh4_r2d',
|
|
|
|
]
|
|
|
|
|
2024-09-19 21:57:44 +03:00
|
|
|
tests_sparc_system_thorough = [
|
|
|
|
'sparc_sun4m',
|
|
|
|
]
|
|
|
|
|
2024-08-30 16:38:13 +03:00
|
|
|
tests_sparc64_system_thorough = [
|
|
|
|
'sparc64_sun4u',
|
2024-08-30 16:38:11 +03:00
|
|
|
]
|
|
|
|
|
2024-08-30 16:38:05 +03:00
|
|
|
tests_x86_64_system_quick = [
|
2024-08-30 16:38:06 +03:00
|
|
|
'cpu_queries',
|
|
|
|
'mem_addr_space',
|
|
|
|
'pc_cpu_hotplug_props',
|
|
|
|
'virtio_version',
|
2024-08-30 16:38:15 +03:00
|
|
|
'x86_cpu_model_versions',
|
2024-08-30 16:38:05 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
tests_x86_64_system_thorough = [
|
2024-08-30 16:38:23 +03:00
|
|
|
'acpi_bits',
|
2024-08-30 16:38:25 +03:00
|
|
|
'linux_initrd',
|
2024-09-03 08:13:33 +03:00
|
|
|
'multiprocess',
|
2024-08-30 16:38:11 +03:00
|
|
|
'netdev_ethtool',
|
2024-08-30 16:38:18 +03:00
|
|
|
'virtio_gpu',
|
2024-08-30 16:38:05 +03:00
|
|
|
]
|
|
|
|
|
2024-09-19 21:57:43 +03:00
|
|
|
tests_xtensa_system_thorough = [
|
|
|
|
'xtensa_lx60',
|
|
|
|
]
|
|
|
|
|
2024-08-30 16:38:09 +03:00
|
|
|
precache_all = []
|
2024-08-30 16:38:05 +03:00
|
|
|
foreach speed : ['quick', 'thorough']
|
|
|
|
foreach dir : target_dirs
|
|
|
|
|
|
|
|
target_base = dir.split('-')[0]
|
|
|
|
|
|
|
|
if dir.endswith('-softmmu')
|
|
|
|
sysmode = 'system'
|
|
|
|
test_emulator = emulators['qemu-system-' + target_base]
|
|
|
|
elif dir.endswith('-linux-user')
|
|
|
|
sysmode = 'linuxuser'
|
|
|
|
test_emulator = emulators['qemu-' + target_base]
|
|
|
|
elif dir.endswith('-bsd-user')
|
|
|
|
sysmode = 'bsduser'
|
|
|
|
test_emulator = emulators['qemu-' + target_base]
|
|
|
|
else
|
|
|
|
continue
|
|
|
|
endif
|
|
|
|
|
|
|
|
if speed == 'quick'
|
|
|
|
suites = ['func-quick', 'func-' + target_base]
|
|
|
|
target_tests = get_variable('tests_' + target_base + '_' + sysmode + '_quick', []) \
|
|
|
|
+ get_variable('tests_generic_' + sysmode)
|
|
|
|
else
|
|
|
|
suites = ['func-' + speed, 'func-' + target_base + '-' + speed, speed]
|
|
|
|
target_tests = get_variable('tests_' + target_base + '_' + sysmode + '_' + speed, [])
|
|
|
|
endif
|
|
|
|
|
|
|
|
test_deps = roms
|
|
|
|
test_env = environment()
|
|
|
|
if have_tools
|
|
|
|
test_env.set('QEMU_TEST_QEMU_IMG', meson.global_build_root() / 'qemu-img')
|
|
|
|
test_deps += [qemu_img]
|
|
|
|
endif
|
|
|
|
test_env.set('QEMU_TEST_QEMU_BINARY', test_emulator.full_path())
|
|
|
|
test_env.set('QEMU_BUILD_ROOT', meson.project_build_root())
|
|
|
|
test_env.set('PYTHONPATH', meson.project_source_root() / 'python:' +
|
|
|
|
meson.current_source_dir())
|
|
|
|
|
|
|
|
foreach test : target_tests
|
2024-08-30 16:38:09 +03:00
|
|
|
testname = '@0@-@1@'.format(target_base, test)
|
|
|
|
testfile = 'test_' + test + '.py'
|
|
|
|
testpath = meson.current_source_dir() / testfile
|
|
|
|
teststamp = testname + '.tstamp'
|
|
|
|
test_precache_env = environment()
|
|
|
|
test_precache_env.set('QEMU_TEST_PRECACHE', meson.current_build_dir() / teststamp)
|
|
|
|
test_precache_env.set('PYTHONPATH', meson.project_source_root() / 'python:' +
|
|
|
|
meson.current_source_dir())
|
|
|
|
precache = custom_target('func-precache-' + testname,
|
|
|
|
output: teststamp,
|
|
|
|
command: [python, testpath],
|
|
|
|
depend_files: files(testpath),
|
|
|
|
build_by_default: false,
|
|
|
|
env: test_precache_env)
|
|
|
|
precache_all += precache
|
|
|
|
|
|
|
|
# Ideally we would add 'precache' to 'depends' here, such that
|
|
|
|
# 'build_by_default: false' lets the pre-caching automatically
|
|
|
|
# run immediately before the test runs. In practice this is
|
|
|
|
# broken in meson, with it running the pre-caching in the normal
|
|
|
|
# compile phase https://github.com/mesonbuild/meson/issues/2518
|
|
|
|
# If the above bug ever gets fixed, when QEMU changes the min
|
|
|
|
# meson version, add the 'depends' and remove the custom
|
|
|
|
# 'run_target' logic below & in Makefile.include
|
|
|
|
test('func-' + testname,
|
2024-08-30 16:38:05 +03:00
|
|
|
python,
|
|
|
|
depends: [test_deps, test_emulator, emulator_modules],
|
|
|
|
env: test_env,
|
2024-08-30 16:38:09 +03:00
|
|
|
args: [testpath],
|
2024-08-30 16:38:05 +03:00
|
|
|
protocol: 'tap',
|
|
|
|
timeout: test_timeouts.get(test, 60),
|
|
|
|
priority: test_timeouts.get(test, 60),
|
|
|
|
suite: suites)
|
|
|
|
endforeach
|
|
|
|
endforeach
|
|
|
|
endforeach
|
2024-08-30 16:38:09 +03:00
|
|
|
|
|
|
|
run_target('precache-functional',
|
|
|
|
depends: precache_all,
|
|
|
|
command: ['true'])
|