build/tests: Skip a test if the test requires it during inspection

In case we don't have dependencies, we should skip the test, otherwise
we can just fail at test time
This commit is contained in:
Marco Trevisan (Treviño)
2024-02-20 08:24:12 +01:00
parent 4b72f27de6
commit 7dbb21e77a

View File

@@ -100,11 +100,17 @@ if get_option('introspection')
base_args = files(vdtest + '.py') base_args = files(vdtest + '.py')
suite = ['virtual-driver'] suite = ['virtual-driver']
r = run_command(unittest_inspector, files(vdtest + '.py'), check: true) r = run_command(unittest_inspector, files(vdtest + '.py'), check: false)
unit_tests = r.stdout().strip().split('\n') unit_tests = r.stdout().strip().split('\n')
if r.returncode() == 0 and unit_tests.length() > 0 if r.returncode() == 0 and unit_tests.length() > 0
suite += vdtest suite += vdtest
elif r.returncode() == 77
test(vdtest,
sh,
args: ['-c', 'exit 77']
)
continue
else else
unit_tests = [vdtest] unit_tests = [vdtest]
endif endif