test: meson: disable test with disabled module dependencies

Some tests will require some modules to be present to run correctly, but
it cannot be probed at compile time. However, as soon as every modules
will be declared unconditionnally, we'll be able to depend on a disabled
module and disable the matching tests.

Ideally, we'd skip it so that the test is still reported, but there's no
code to do that yet.
This commit is contained in:
Alexandre Janniaux 2024-03-07 21:16:06 +01:00 committed by Steve Lhomme
parent c69d877e0c
commit 146a4f4cd3
2 changed files with 13 additions and 0 deletions

View File

@ -258,6 +258,7 @@ endif
# entry with the needed build definition for a VLC plugin.
#
vlc_plugins_targets = {}
vlc_plugins_manifest = {}
foreach module : vlc_modules
if not module.has_key('name')
error('Got invalid vlc_modules entry without \'name\' key')
@ -324,4 +325,7 @@ foreach module : vlc_modules
vlc_plugins_targets += {
module['name']: vlc_plugin
}
vlc_plugins_manifest += {
module['name']: module
}
endforeach

View File

@ -37,6 +37,7 @@ foreach vlc_test: vlc_tests
'-DTOP_SRCDIR="@0@"'.format(vlc_src_root),
]
disabled_dependencies = []
test_modules_deps = []
foreach module_name : vlc_test.get('module_depends', [])
if module_name not in vlc_plugins_targets.keys()
@ -44,8 +45,16 @@ foreach vlc_test: vlc_tests
.format(vlc_test['name'], module_name))
endif
test_modules_deps += vlc_plugins_targets[module_name]
if vlc_plugins_manifest[module_name].get('enabled', true)
disabled_dependencies += module_name
endif
endforeach
if disabled_dependencies != []
# TODO: mark as skipped
continue
endif
moc_sources = []
if vlc_test.has_key('moc_headers') and qt5_dep.found()
moc_sources += qt5.preprocess(moc_headers: vlc_test['moc_headers'],