On Tue, 07 Jul 2026 01:32, Pierrick Bouvier <[email protected]> 
wrote:
Instead of skipping tests and not declare them, always declare them and
simply return an exit code 77 (SKIPPED for meson) and print reason why
test is skipped.

Signed-off-by: Pierrick Bouvier <[email protected]>
---

Reviewed-by: Manos Pitsidianakis <[email protected]>

tests/tcg/meson.build | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/tests/tcg/meson.build b/tests/tcg/meson.build
index 679a69054e4..2bc1fc77775 100644
--- a/tests/tcg/meson.build
+++ b/tests/tcg/meson.build
@@ -115,11 +115,15 @@ foreach target, plan: tcg_tests
        endforeach
      endif

+      # if set, we'll skip test and print the reason
+      skip_test = ''
+
      if 'gdb_test' in setup and gdb_arch not in gdb_arch_supported
        continue
      endif

      if 'plugin_test' in setup and not get_option('plugins')
+        # do not use the skip_test logic, and simply ignore the test
        continue
      endif

@@ -227,6 +231,11 @@ foreach target, plan: tcg_tests
        cmd = [setup['env_var'], cmd]
      endif

+      if skip_test != ''
+        # still declare test, but skip it and print reason
+        cmd = ['sh', '-c', 'echo "' + skip_test + '" && exit 77']
+      endif
+
      test(test_name, env, args: cmd,
           depends: depends,
           suite: ['tcg', 'tcg-' + target])
--
2.47.3


Reply via email to