On 6/26/2026 4:38 PM, Pierrick Bouvier wrote:
> This series is an experiment to replace TCG tests makefiles with meson, with the
> goal of having something more readable and maintainable in the long term.
> Also it closes the gap that tcg tests had with the rest of tests, by integrating
> them with meson directly.
>
> It covers all existing tests for aarch64 architecture, including
> user/system/multiarch-user/multiarch-system. I'll carry the effort to port all
> other architectures once we agree on a base. We agreed with Alex to not merge
> anything before all arch are covered.
>
> It implements all requirements listed on original thread [1].
>
> [1] https://lore.kernel.org/qemu-devel/87wlwfsay4.fsf@draig.linaro.org/
>
> We also have for free:
> - correct and complete dependencies for any test, including:
> scripts, c.inc, headers, reference files and binaries/plugins.
> - catch test declaration issues at configure time vs test time.
> - proper data types for variables instead of string expansion with make.
> - we now build tests binaries by default with 'all' target.
> - hopefully, better readability to your taste.
>
> Main ideas for the current design are:
> - make arch files as simple and explicit as possible. If it conflicts,
> always pick explicit, as long as we don't expose meson details.
> remove any kind of "skip, override, filter" logic.
> - never expose custom_target and meson details in arch files.
> - catch any spelling mistake on test or any dependency.
> - keep complexity contained in tests/tcg/meson.build.
>
> Usage:
>
> ```
> make check-tcg
> make check-tcg-aarch64-linux-user
> make check-tcg-aarch64-softmmu
> make tcg-tests
>
> from build folder:
> ./pyvenv/bin/meson test --list --suite tcg
> ninja clean
> ./pyvenv/bin/meson test aarch64-softmmu-asid2 --verbose
> ```
>
> v2:
> --
>
> - s/mispell/misspell
> - moved comment about why we remove 'lib' prefix for plugins
> - if user declare a wrong entry in a dictionary, list possible keys
> - build tests by default (with 'all' target), as long as cross compiler is
> natively installed, to avoid triggering a container build.
> - reword some comments based on reviewers feedback
> - always declare all tests and avoid "per config" errors (no 'if' in arch files)
> - move compiler feature and gdb version checks directly in tests/tcg/meson.build
> - add support for cross containers
> - add top target 'tcg-tests' to rebuild all tests
>
> Pierrick Bouvier (37):
> tests/tcg/multiarch/system/memory.c: remove unused variable
> tests/tcg/multiarch/plugin/check-plugin-output.sh: take test output as
> input
> tests/tcg/multiarch/plugin: rename check-plugin-output to
> regex-compare
> tests/tcg: introduce meson.build
> tests/tcg/meson.build: introduce exe_name
> tests/tcg/meson.build: introduce test_name
> tests/tcg/meson.build: introduce cflags
> tests/tcg/meson.build: introduce qemu_args
> tests/tcg/meson.build: introduce env_var
> tests/tcg/plugins: build list of test_plugins
> tests/tcg/meson.build: introduce plugin_test
> tests/tcg/meson.build: test gdb support and introduce gdb_arch
> tests/tcg/meson.build: introduce gdb_test
> tests/tcg/meson.build: add default flag for testing compiler support
> tests/tcg/meson.build: introduce wrapper
> tests/tcg/meson.build: introduce expected_output
> tests/tcg/meson.build: add wrapper run_and_check_forbidden_output
> tests/tcg/meson.build: add wrapper run_with_input
> tests/tcg/meson.build: add wrapper record_replay
> tests/tcg/meson.build: add wrapper check_plugin_output
> tests/tcg/aarch64: add user tests
> tests/tcg/aarch64: add system tests
> tests/tcg/multiarch: declare user tests
> tests/tcg/aarch64: add multiarch user tests
> tests/tcg/multiarch: declare system tests
> tests/tcg/aarch64: add multiarch system tests
> tests/tcg/meson.build: add generic plugin tests
> tests/tcg/meson.build: add logic to skip tests
> tests/tcg/meson.build: introduce cc_feat and cc_feat_cflags
> tests/tcg/meson.build: introduce gdb_feat and gdb_feat_version
> tests/tcg/meson.build: move gdb_arch support check
> tests/tcg/aarch64: delegate cc_feat and gdb_feat
> tests/tcg/meson.build: let test infrastructure detect compiler
> tests/docker/docker.py: return error code if probe fails
> tests/tcg/meson.build: introduce cc_dockerfile
> tests/tcg/aarch64: add container support
> tests/tcg/meson.build: add top-level 'tcg-tests' target
>
> tests/docker/docker.py | 1 +
> tests/meson.build | 2 +-
> tests/tcg/aarch64/meson.build | 193 +++++++++
> tests/tcg/aarch64/system/meson.build | 101 +++++
> tests/tcg/meson.build | 402 ++++++++++++++++++
> tests/tcg/multiarch/Makefile.target | 3 +-
> tests/tcg/multiarch/meson.build | 149 +++++++
> .../multiarch/plugin/check-plugin-output.sh | 36 --
> tests/tcg/multiarch/plugin/regex-compare.sh | 28 ++
> tests/tcg/multiarch/sha1.ref | 1 +
> tests/tcg/multiarch/system/memory.c | 3 +-
> tests/tcg/multiarch/system/meson.build | 53 +++
> tests/tcg/plugins/meson.build | 11 +-
> tests/tcg/scripts/check_plugin_output.sh | 19 +
> tests/tcg/scripts/record_replay.sh | 16 +
> .../scripts/run_and_check_forbidden_output.sh | 19 +
> tests/tcg/scripts/run_and_diff.sh | 15 +
> tests/tcg/scripts/run_with_input.sh | 12 +
> 18 files changed, 1019 insertions(+), 45 deletions(-)
> create mode 100644 tests/tcg/aarch64/meson.build
> create mode 100644 tests/tcg/aarch64/system/meson.build
> create mode 100644 tests/tcg/meson.build
> create mode 100644 tests/tcg/multiarch/meson.build
> delete mode 100755 tests/tcg/multiarch/plugin/check-plugin-output.sh
> create mode 100755 tests/tcg/multiarch/plugin/regex-compare.sh
> create mode 100644 tests/tcg/multiarch/sha1.ref
> create mode 100644 tests/tcg/multiarch/system/meson.build
> create mode 100755 tests/tcg/scripts/check_plugin_output.sh
> create mode 100755 tests/tcg/scripts/record_replay.sh
> create mode 100755 tests/tcg/scripts/run_and_check_forbidden_output.sh
> create mode 100755 tests/tcg/scripts/run_and_diff.sh
> create mode 100755 tests/tcg/scripts/run_with_input.sh
>
sent v3, with support for all architectures:
https://lore.kernel.org/qemu-devel/20260706223343.988769-1-pierrick.bouvier@oss.qualcomm.com/T/#
Regards,
Pierrick