All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/37] tests/tcg: run tests with meson
@ 2026-06-26 23:38 Pierrick Bouvier
  2026-06-26 23:38 ` [PATCH v2 01/37] tests/tcg/multiarch/system/memory.c: remove unused variable Pierrick Bouvier
                   ` (37 more replies)
  0 siblings, 38 replies; 40+ messages in thread
From: Pierrick Bouvier @ 2026-06-26 23:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Pierrick Bouvier, Thomas Huth, Manos Pitsidianakis,
	Richard Henderson, Alex Bennée, Peter Maydell,
	Gustavo Romero, Paolo Bonzini, Daniel P . Berrangé,
	Philippe Mathieu-Daudé, qemu-arm, Alexandre Iooss

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

-- 
2.47.3



^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2026-07-06 22:44 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-26 23:38 [PATCH v2 00/37] tests/tcg: run tests with meson Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 01/37] tests/tcg/multiarch/system/memory.c: remove unused variable Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 02/37] tests/tcg/multiarch/plugin/check-plugin-output.sh: take test output as input Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 03/37] tests/tcg/multiarch/plugin: rename check-plugin-output to regex-compare Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 04/37] tests/tcg: introduce meson.build Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 05/37] tests/tcg/meson.build: introduce exe_name Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 06/37] tests/tcg/meson.build: introduce test_name Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 07/37] tests/tcg/meson.build: introduce cflags Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 08/37] tests/tcg/meson.build: introduce qemu_args Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 09/37] tests/tcg/meson.build: introduce env_var Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 10/37] tests/tcg/plugins: build list of test_plugins Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 11/37] tests/tcg/meson.build: introduce plugin_test Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 12/37] tests/tcg/meson.build: test gdb support and introduce gdb_arch Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 13/37] tests/tcg/meson.build: introduce gdb_test Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 14/37] tests/tcg/meson.build: add default flag for testing compiler support Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 15/37] tests/tcg/meson.build: introduce wrapper Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 16/37] tests/tcg/meson.build: introduce expected_output Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 17/37] tests/tcg/meson.build: add wrapper run_and_check_forbidden_output Pierrick Bouvier
2026-06-26 23:38 ` [PATCH v2 18/37] tests/tcg/meson.build: add wrapper run_with_input Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 19/37] tests/tcg/meson.build: add wrapper record_replay Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 20/37] tests/tcg/meson.build: add wrapper check_plugin_output Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 21/37] tests/tcg/aarch64: add user tests Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 22/37] tests/tcg/aarch64: add system tests Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 23/37] tests/tcg/multiarch: declare user tests Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 24/37] tests/tcg/aarch64: add multiarch " Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 25/37] tests/tcg/multiarch: declare system tests Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 26/37] tests/tcg/aarch64: add multiarch " Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 27/37] tests/tcg/meson.build: add generic plugin tests Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 28/37] tests/tcg/meson.build: add logic to skip tests Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 29/37] tests/tcg/meson.build: introduce cc_feat and cc_feat_cflags Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 30/37] tests/tcg/meson.build: introduce gdb_feat and gdb_feat_version Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 31/37] tests/tcg/meson.build: move gdb_arch support check Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 32/37] tests/tcg/aarch64: delegate cc_feat and gdb_feat Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 33/37] tests/tcg/meson.build: let test infrastructure detect compiler Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 34/37] tests/docker/docker.py: return error code if probe fails Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 35/37] tests/tcg/meson.build: introduce cc_dockerfile Pierrick Bouvier
2026-06-30  6:34   ` Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 36/37] tests/tcg/aarch64: add container support Pierrick Bouvier
2026-06-26 23:39 ` [PATCH v2 37/37] tests/tcg/meson.build: add top-level 'tcg-tests' target Pierrick Bouvier
2026-07-06 22:44 ` [PATCH v2 00/37] tests/tcg: run tests with meson Pierrick Bouvier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.