[PATCH] tcg/tests: add an alias for all TCG tests of a target

Paolo Bonzini posted 1 patch 6 days, 6 hours ago
docs/devel/testing/main.rst | 6 ++++--
tests/tcg/meson.build       | 8 +++++++-
2 files changed, 11 insertions(+), 3 deletions(-)
[PATCH] tcg/tests: add an alias for all TCG tests of a target
Posted by Paolo Bonzini 6 days, 6 hours ago
Allow building (without running) all the TCG tests that are available
for a target, so that they can be run manually.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/devel/testing/main.rst | 6 ++++--
 tests/tcg/meson.build       | 8 +++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/docs/devel/testing/main.rst b/docs/devel/testing/main.rst
index fadb376eaf0..b0ca37fe2ba 100644
--- a/docs/devel/testing/main.rst
+++ b/docs/devel/testing/main.rst
@@ -1035,12 +1035,14 @@ See :ref:`container-ref` for more details.
 Running subset of tests
 ~~~~~~~~~~~~~~~~~~~~~~~
 
-You can build the tcg tests using::
+You can build and run the TCG tests using respectively::
 
   make tcg-tests
+  make check-tcg-$TARGET
 
-And run them for one target with::
+Or for a single target::
 
+  make tcg-tests-$TARGET
   make check-tcg-$TARGET
 
 Adding ``V=1`` to the invocation will show the details of how to
diff --git a/tests/tcg/meson.build b/tests/tcg/meson.build
index 4c0e30756d5..43886ac9269 100644
--- a/tests/tcg/meson.build
+++ b/tests/tcg/meson.build
@@ -197,6 +197,7 @@ image_targets = {}
 exe_targets = []
 # Finally, we can create all test executables and test targets
 foreach target, plan: tcg_tests
+  target_exe_targets = []
   if target.startswith('multiarch-')
     # those tests are included by architecture files if needed
     continue
@@ -451,7 +452,7 @@ foreach target, plan: tcg_tests
                             depends: exe_depends,
                             depend_files: build_test_depend_files,
                             build_by_default: false)
-        exe_targets += exe
+        target_exe_targets += exe
         built_tests += {exe_name: exe}
       endif
 
@@ -538,6 +539,11 @@ foreach target, plan: tcg_tests
       added_tests += {test_name: true}
     endforeach
   endforeach
+  if target_exe_targets.length() > 0
+    # finally create a top level target to rebuild all tests for this target
+    alias_target('tcg-tests-' + target, target_exe_targets)
+  endif
+  exe_targets += target_exe_targets
 endforeach
 
 if exe_targets.length() > 0
-- 
2.56.0
Re: [PATCH] tcg/tests: add an alias for all TCG tests of a target
Posted by Pierrick Bouvier 3 days, 21 hours ago
On 10/17/2026 12:39 AM, Paolo Bonzini wrote:
> Allow building (without running) all the TCG tests that are available
> for a target, so that they can be run manually.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  docs/devel/testing/main.rst | 6 ++++--
>  tests/tcg/meson.build       | 8 +++++++-
>  2 files changed, 11 insertions(+), 3 deletions(-)
> 

This was merged into master (1c8440e9162d7f98d8e41ff4de0ccacb08fb65b8).
Thank you for your contribution!

Regards,
Pierrick
Re: [PATCH] tcg/tests: add an alias for all TCG tests of a target
Posted by Pierrick Bouvier 5 days, 20 hours ago
On 10/17/2026 12:39 AM, Paolo Bonzini wrote:
> Allow building (without running) all the TCG tests that are available
> for a target, so that they can be run manually.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  docs/devel/testing/main.rst | 6 ++++--
>  tests/tcg/meson.build       | 8 +++++++-
>  2 files changed, 11 insertions(+), 3 deletions(-)
> 

Thanks for this addition.

Tested-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>

Regards,
Pierrick