xref: /qemu/tests/functional/meson.build (revision cce85725f10fbe92481e8314986e69dbe6ca0dd1)
114973778SThomas Huth# QEMU functional tests:
214973778SThomas Huth# Tests that are put in the 'quick' category are run by default during
314973778SThomas Huth# 'make check'. Everything that should not be run during 'make check'
414973778SThomas Huth# (e.g. tests that fetch assets from the internet) should be put into
514973778SThomas Huth# the 'thorough' category instead.
614973778SThomas Huth
714973778SThomas Huth# Most tests run too slow with TCI enabled, so skip the functional tests there
814973778SThomas Huthif get_option('tcg_interpreter')
914973778SThomas Huth  subdir_done()
1014973778SThomas Huthendif
1114973778SThomas Huth
1214973778SThomas Huth# Timeouts for individual tests that can be slow e.g. with debugging enabled
1314973778SThomas Huthtest_timeouts = {
1414973778SThomas Huth}
1514973778SThomas Huth
1614973778SThomas Huthtests_generic_system = [
17*cce85725SThomas Huth  'empty_cpu_model',
1814973778SThomas Huth]
1914973778SThomas Huth
2014973778SThomas Huthtests_generic_linuxuser = [
2114973778SThomas Huth]
2214973778SThomas Huth
2314973778SThomas Huthtests_generic_bsduser = [
2414973778SThomas Huth]
2514973778SThomas Huth
2614973778SThomas Huthtests_x86_64_system_quick = [
27*cce85725SThomas Huth  'cpu_queries',
28*cce85725SThomas Huth  'mem_addr_space',
29*cce85725SThomas Huth  'pc_cpu_hotplug_props',
30*cce85725SThomas Huth  'virtio_version',
3114973778SThomas Huth]
3214973778SThomas Huth
3314973778SThomas Huthtests_x86_64_system_thorough = [
3414973778SThomas Huth]
3514973778SThomas Huth
3614973778SThomas Huthforeach speed : ['quick', 'thorough']
3714973778SThomas Huth  foreach dir : target_dirs
3814973778SThomas Huth
3914973778SThomas Huth    target_base = dir.split('-')[0]
4014973778SThomas Huth
4114973778SThomas Huth    if dir.endswith('-softmmu')
4214973778SThomas Huth      sysmode = 'system'
4314973778SThomas Huth      test_emulator = emulators['qemu-system-' + target_base]
4414973778SThomas Huth    elif dir.endswith('-linux-user')
4514973778SThomas Huth      sysmode = 'linuxuser'
4614973778SThomas Huth      test_emulator = emulators['qemu-' + target_base]
4714973778SThomas Huth    elif dir.endswith('-bsd-user')
4814973778SThomas Huth      sysmode = 'bsduser'
4914973778SThomas Huth      test_emulator = emulators['qemu-' + target_base]
5014973778SThomas Huth    else
5114973778SThomas Huth      continue
5214973778SThomas Huth    endif
5314973778SThomas Huth
5414973778SThomas Huth    if speed == 'quick'
5514973778SThomas Huth      suites = ['func-quick', 'func-' + target_base]
5614973778SThomas Huth      target_tests = get_variable('tests_' + target_base + '_' + sysmode + '_quick', []) \
5714973778SThomas Huth                     + get_variable('tests_generic_' + sysmode)
5814973778SThomas Huth    else
5914973778SThomas Huth      suites = ['func-' + speed, 'func-' + target_base + '-' + speed, speed]
6014973778SThomas Huth      target_tests = get_variable('tests_' + target_base + '_' + sysmode + '_' + speed, [])
6114973778SThomas Huth    endif
6214973778SThomas Huth
6314973778SThomas Huth    test_deps = roms
6414973778SThomas Huth    test_env = environment()
6514973778SThomas Huth    if have_tools
6614973778SThomas Huth      test_env.set('QEMU_TEST_QEMU_IMG', meson.global_build_root() / 'qemu-img')
6714973778SThomas Huth      test_deps += [qemu_img]
6814973778SThomas Huth    endif
6914973778SThomas Huth    test_env.set('QEMU_TEST_QEMU_BINARY', test_emulator.full_path())
7014973778SThomas Huth    test_env.set('QEMU_BUILD_ROOT', meson.project_build_root())
7114973778SThomas Huth    test_env.set('PYTHONPATH', meson.project_source_root() / 'python:' +
7214973778SThomas Huth                               meson.current_source_dir())
7314973778SThomas Huth
7414973778SThomas Huth    foreach test : target_tests
7514973778SThomas Huth      test('func-@0@/@1@'.format(target_base, test),
7614973778SThomas Huth           python,
7714973778SThomas Huth           depends: [test_deps, test_emulator, emulator_modules],
7814973778SThomas Huth           env: test_env,
7914973778SThomas Huth           args: [meson.current_source_dir() / 'test_' + test + '.py'],
8014973778SThomas Huth           protocol: 'tap',
8114973778SThomas Huth           timeout: test_timeouts.get(test, 60),
8214973778SThomas Huth           priority: test_timeouts.get(test, 60),
8314973778SThomas Huth           suite: suites)
8414973778SThomas Huth    endforeach
8514973778SThomas Huth  endforeach
8614973778SThomas Huthendforeach
87