On Fri, 10 Jul 2026 09:19, Pierrick Bouvier <[email protected]>
wrote:
Similar to cc features, we declare the same for gdb. With both
available, we can now declare all tests inconditionally.
Tested-by: Alex Bennée <[email protected]>
Signed-off-by: Pierrick Bouvier <[email protected]>
---
Reviewed-by: Manos Pitsidianakis <[email protected]>
tests/tcg/meson.build | 29 ++++++++++++++++++++++++++---
1 file changed, 26 insertions(+), 3 deletions(-)
diff --git a/tests/tcg/meson.build b/tests/tcg/meson.build
index 26eb17fe17a..993a948bb80 100644
--- a/tests/tcg/meson.build
+++ b/tests/tcg/meson.build
@@ -26,6 +26,10 @@ tcg_tests = {}
# },
# 'folder': 'folder_for_test_src_files',
# 'gdb_arch': 'gdb architecture requirement',
+# 'gdb_feat_version': {
+# 'name': ['minimal gdb version supporting feature'],
+# ...
+# },
# 'qemu': emulators['qemu-...'],
# 'tests': [
# {
@@ -37,6 +41,7 @@ tcg_tests = {}
# 'qemu_args': ['qemu command line flags', ...],
# 'expected_output': 'file_to_compare_output',
# 'gdb_test': ['gdb test args'],
+# 'gdb_feat': ['feature name, must be present in gdb_feat_version'],
# 'env_var': ['VAR=value', ...],
# 'wrapper': [program_to_launch_test, 'args'...],
# 'plugin_test': {
@@ -83,7 +88,8 @@ foreach target, plan: tcg_tests
# return a clear error if user misspell a target entry
foreach key, _ : plan
- allowed = ['cc', 'cc_feat_cflags', 'folder', 'gdb_arch', 'qemu', 'tests']
+ allowed = ['cc', 'cc_feat_cflags', 'folder', 'gdb_arch',
'gdb_feat_version',
+ 'qemu', 'tests']
if key not in allowed
error('unknown tcg test plan entry \'' + key + '\' for target ' + target +
' (possible: [' + ', '.join(allowed) + '])')
@@ -98,6 +104,11 @@ foreach target, plan: tcg_tests
if 'cc_feat_cflags' in plan
cc_feat_cflags = plan['cc_feat_cflags']
endif
+ gdb_feat_version = {}
+ if 'gdb_feat_version' in plan
+ gdb_feat_version = plan['gdb_feat_version']
+ endif
+
tests = plan['tests']
foreach t : tests
@@ -105,8 +116,8 @@ foreach target, plan: tcg_tests
# return a clear error if user misspell a setup entry
foreach key, _ : setup
allowed = ['exe_name', 'env_var', 'expected_output', 'cc_feat',
'cflags',
- 'gdb_test', 'plugin_test', 'qemu_args', 'test_name',
- 'wrapper']
+ 'gdb_feat', 'gdb_test', 'plugin_test', 'qemu_args',
+ 'test_name', 'wrapper']
if key not in allowed
error('unknown tcg setup entry \'' + key + '\' for test ' + src +
' (possible: [' + ', '.join(allowed) + '])')
@@ -261,6 +272,18 @@ foreach target, plan: tcg_tests
cmd = [setup['env_var'], cmd]
endif
+ if 'gdb_feat' in setup
+ if 'gdb_test' not in setup
+ error('test ' + test_name + ' is not a gdb test, but it requires ' +
+ 'a gdb feature')
+ endif
+ gdb_feat = setup['gdb_feat']
+
+ if not gdb_version.version_compare('>=' + gdb_feat_version[gdb_feat])
+ skip_test = 'gdb feature ' + gdb_feat + ' not supported'
+ endif
+ endif
+
if skip_test != ''
# still declare test, but skip it and print reason
cmd = ['sh', '-c', 'echo "' + skip_test + '" && exit 77']
--
2.47.3