From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
To: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
qemu-devel@nongnu.org
Cc: "Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Gustavo Romero" <gustavo.romero@linaro.org>,
"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
"Brian Cain" <brian.cain@oss.qualcomm.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Helge Deller" <deller@gmx.de>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Ilya Leoshkevich" <iii@linux.ibm.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Laurent Vivier" <laurent@vivier.eu>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Subject: Re: [PATCH v4 22/97] tests/tcg/meson.build: introduce cc_feat and cc_feat_cflags
Date: Fri, 10 Jul 2026 10:19:48 +0300 [thread overview]
Message-ID: <thy75i.2ycx7hqouutmv@linaro.org> (raw)
In-Reply-To: <20260710062016.1818125-23-pierrick.bouvier@oss.qualcomm.com>
On Fri, 10 Jul 2026 09:19, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> wrote:
>We directly move compiler requirements in test definition. This allows
>to always declare all tests, and let the main loop filter the ones
>that will be available.
>
>Tested-by: Alex Bennée <alex.bennee@linaro.org>
>Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
>---
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> tests/tcg/meson.build | 43 +++++++++++++++++++++++++++++++++++++------
> 1 file changed, 37 insertions(+), 6 deletions(-)
>
>diff --git a/tests/tcg/meson.build b/tests/tcg/meson.build
>index 05d54093709..26eb17fe17a 100644
>--- a/tests/tcg/meson.build
>+++ b/tests/tcg/meson.build
>@@ -20,6 +20,10 @@ tcg_tests = {}
> # {
> # 'name_of_target': {
> # 'cc': cross_compiler,
>+# 'cc_feat_cflags': {
>+# 'name': ['feature cflags'],
>+# ...
>+# },
> # 'folder': 'folder_for_test_src_files',
> # 'gdb_arch': 'gdb architecture requirement',
> # 'qemu': emulators['qemu-...'],
>@@ -29,6 +33,7 @@ tcg_tests = {}
> # 'exe_name': ['provide an alternative binary name'],
> # 'test_name': ['provide an alternative test name'],
> # 'cflags': ['additional cflags to compile test', ...],
>+# 'cc_feat': 'feature name, must be present in cc_feat_cflags',
> # 'qemu_args': ['qemu command line flags', ...],
> # 'expected_output': 'file_to_compare_output',
> # 'gdb_test': ['gdb test args'],
>@@ -74,10 +79,11 @@ foreach target, plan: tcg_tests
> # choose how to deal with it.
> built_tests = {}
> added_tests = {}
>+ cc_has_feat = {}
>
> # return a clear error if user misspell a target entry
> foreach key, _ : plan
>- allowed = ['cc', 'folder', 'gdb_arch', 'qemu', 'tests']
>+ allowed = ['cc', 'cc_feat_cflags', 'folder', 'gdb_arch', 'qemu', 'tests']
> if key not in allowed
> error('unknown tcg test plan entry \'' + key + '\' for target ' + target +
> ' (possible: [' + ', '.join(allowed) + '])')
>@@ -88,13 +94,17 @@ foreach target, plan: tcg_tests
> folder = plan['folder']
> gdb_arch = plan['gdb_arch']
> qemu = plan['qemu']
>+ cc_feat_cflags = {}
>+ if 'cc_feat_cflags' in plan
>+ cc_feat_cflags = plan['cc_feat_cflags']
>+ endif
> tests = plan['tests']
>
> foreach t : tests
> foreach src, setup: t
> # return a clear error if user misspell a setup entry
> foreach key, _ : setup
>- allowed = ['exe_name', 'env_var', 'expected_output', 'cflags',
>+ allowed = ['exe_name', 'env_var', 'expected_output', 'cc_feat', 'cflags',
> 'gdb_test', 'plugin_test', 'qemu_args', 'test_name',
> 'wrapper']
> if key not in allowed
>@@ -155,15 +165,36 @@ foreach target, plan: tcg_tests
> 'specify a different \'test_name\'')
> endif
>
>+ if 'cflags' in setup or 'cc_feat' in setup
>+ if exe_name in built_tests
>+ error('test ' + exe_name +
>+ ' was already built with cflags or cc_feat:' +
>+ ' remove cflags, cc_feat, or set \'exe_name\'' +
>+ ' (if cflags are different)')
>+ endif
>+ endif
>+
> cflags = []
> if 'cflags' in setup
>- if exe_name in built_tests
>- error('test ' + exe_name + ' was already built with cflags: ' +
>- 'remove cflags or set \'exe_name\' (if cflags are different)')
>- endif
> cflags = setup['cflags']
> endif
>
>+ if 'cc_feat' in setup
>+ cc_feat = setup['cc_feat']
>+ if cc_feat not in cc_has_feat
>+ cmd = run_command([cc, cc_check_args, cc_feat_cflags[cc_feat]],
>+ check: false)
>+ avail = cmd.returncode() == 0
>+ cc_has_feat += {cc_feat: avail}
>+ endif
>+
>+ if not cc_has_feat[cc_feat]
>+ skip_test = 'compiler feature ' + cc_feat + ' not supported'
>+ built_tests += {exe_name: exe_name}
>+ endif
>+ cflags += cc_feat_cflags[cc_feat]
>+ endif
>+
> # build executable if needed
> if exe_name not in built_tests
> exe = custom_target(exe_name,
>--
>2.47.3
>
next prev parent reply other threads:[~2026-07-10 7:22 UTC|newest]
Thread overview: 107+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 6:18 [PATCH v4 00/97] tests/tcg: run tests with meson Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 01/97] tests/tcg/multiarch/system/memory.c: remove unused variable Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 02/97] tests/tcg/multiarch/plugin/check-plugin-output.sh: take test output as input Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 03/97] tests/tcg/multiarch/plugin: rename check-plugin-output to regex-compare Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 04/97] meson: bump minimal version to 1.6.0 Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 05/97] tests/tcg: introduce meson.build Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 06/97] tests/tcg/meson.build: introduce exe_name Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 07/97] tests/tcg/meson.build: introduce test_name Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 08/97] tests/tcg/meson.build: introduce cflags Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 09/97] tests/tcg/meson.build: introduce qemu_args Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 10/97] tests/tcg/meson.build: introduce env_var Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 11/97] tests/tcg/plugins: build list of test_plugins Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 12/97] tests/tcg/meson.build: introduce plugin_test Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 13/97] tests/tcg/meson.build: test gdb support and introduce gdb_arch Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 14/97] tests/tcg/meson.build: introduce gdb_test Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 15/97] tests/tcg/meson.build: introduce wrapper Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 16/97] tests/tcg/meson.build: introduce expected_output Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 17/97] tests/tcg/meson.build: add wrapper run_and_check_forbidden_output Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 18/97] tests/tcg/meson.build: add wrapper run_with_input Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 19/97] tests/tcg/meson.build: add wrapper record_replay Pierrick Bouvier
2026-07-10 6:18 ` [PATCH v4 20/97] tests/tcg/meson.build: add wrapper check_plugin_output Pierrick Bouvier
2026-07-10 7:19 ` Manos Pitsidianakis
2026-07-10 6:18 ` [PATCH v4 21/97] tests/tcg/meson.build: add logic to skip tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 22/97] tests/tcg/meson.build: introduce cc_feat and cc_feat_cflags Pierrick Bouvier
2026-07-10 7:19 ` Manos Pitsidianakis [this message]
2026-07-10 6:19 ` [PATCH v4 23/97] tests/tcg/meson.build: introduce gdb_feat and gdb_feat_version Pierrick Bouvier
2026-07-10 7:22 ` Manos Pitsidianakis
2026-07-10 6:19 ` [PATCH v4 24/97] tests/tcg/meson.build: move gdb_arch support check Pierrick Bouvier
2026-07-10 7:24 ` Manos Pitsidianakis
2026-07-10 6:19 ` [PATCH v4 25/97] tests/tcg/meson.build: let test infrastructure detect compiler Pierrick Bouvier
2026-07-10 7:25 ` Manos Pitsidianakis
2026-07-10 6:19 ` [PATCH v4 26/97] tests/docker/docker.py: return error code if probe fails Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 27/97] tests/docker/docker.py: remove "Image is up to date" info Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 28/97] tests/tcg/meson.build: introduce cc_dockerfile and cc_docker_host_arch Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 29/97] tests/tcg/meson.build: check host cross cc is working Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 30/97] tests/tcg/meson.build: introduce depends Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 31/97] tests/tcg/meson.build: add top-level 'tcg-tests' target Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 32/97] tests/tcg/multiarch/gdbstub/prot-none.py: deactivate on gitlab CI Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 33/97] tests/tcg/multiarch: declare user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 34/97] tests/tcg/multiarch: declare system tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 35/97] tests/tcg/meson.build: add generic plugin tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 36/97] tests/tcg/arm/fcvt.c: use raw opcode for FPRCVT Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 37/97] tests/tcg/aarch64: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 38/97] tests/tcg/aarch64/system/gpc-test.c: remove unused variables Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 39/97] tests/tcg/aarch64: system tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 40/97] tests/tcg/aarch64_be: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 41/97] tests/tcg/alpha: add float reference files Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 42/97] tests/tcg/alpha: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 43/97] tests/tcg/alpha: system tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 44/97] tests/tcg/arm: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 45/97] tests/tcg/arm: system tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 46/97] tests/tcg/hexagon/overflow.c: add missing include Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 47/97] tests/tcg/hexagon: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 48/97] tests/tcg/multiarch/sha1.c: fix big endian implementation Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 49/97] tests/tcg/hppa: add float reference files Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 50/97] tests/tcg/hppa: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 51/97] tests/tcg/i386: add missing float reference files Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 52/97] tests/tcg/i386: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 53/97] tests/tcg/i386: system tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 54/97] tests/tcg/loongarch64: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 55/97] tests/tcg/loongarch64: system tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 56/97] tests/tcg/m68k: add float reference files Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 57/97] tests/tcg/m68k: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 58/97] scripts/probe-gdb-support.py: add mapping for mips architecture Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 59/97] tests/tcg/mips: add float reference files Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 60/97] test/tcg/mips: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 61/97] tests/tcg/mips64: add float reference files Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 62/97] tests/tcg/mips64: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 63/97] tests/tcg/mips64el: add float reference files Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 64/97] tests/tcg/mips64el: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 65/97] tests/docker/dockerfiles/debian-all-test-cross.docker: add or1k toolchain Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 66/97] tests/tcg/or1k/test_addic.c: remove unused variables Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 67/97] tests/tcg/or1k/test_muli.c: remove set but unused variable Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 68/97] tests/tcg/or1k: add float reference files Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 69/97] plugins/api.c: identify or1k pc register and mark it as read only Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 70/97] tests/tcg/or1k: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 71/97] tests/tcg/ppc64: add float reference files Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 72/97] tests/tcg/ppc64: remove dependency on qemu/compiler.h Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 73/97] tests/tcg/ppc64: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 74/97] tests/tcg/ppc64le: add missing float reference file Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 75/97] tests/tcg/ppc64le: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 76/97] tests/tcg/riscv64: add float reference files Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 77/97] tests/tcg/riscv64: user tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 78/97] tests/tcg/riscv64: system tests Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 79/97] tests/tcg/s390x/head64.S: declare _exit symbol after main Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 80/97] tests/tcg/s390x: add float reference files Pierrick Bouvier
2026-07-10 6:19 ` [PATCH v4 81/97] tests/tcg/s390x: user tests Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 82/97] tests/tcg/s390x/console.c: directly implement memcpy and memset Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 83/97] tests/tcg/s390x: system tests Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 84/97] tests/tcg/sh4: add float reference files Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 85/97] tests/tcg/sh4: user tests Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 86/97] tests/tcg/tricore: system tests Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 87/97] tests/tcg/x86_64: add missing float reference file Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 88/97] tests/tcg/x86_64: user tests Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 89/97] tests/tcg/x86_64: system tests Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 90/97] tests/tcg/xtensa/crt.S: align .text section Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 91/97] tests/docker/dockerfiles/debian-xtensa-cross.docker: add test_kc705_be toolchain for xtensaeb Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 92/97] tests/tcg/xtensa: system tests Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 93/97] tests/tcg/xtensa: xtensaeb " Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 94/97] tests: remove tcg tests machinery Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 95/97] tests/tcg: remove Makefiles Pierrick Bouvier
2026-07-10 18:12 ` Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 96/97] configure: remove --cross-cc* options Pierrick Bouvier
2026-07-10 6:20 ` [PATCH v4 97/97] docs/devel/testing/: update documentation Pierrick Bouvier
2026-07-10 7:28 ` Manos Pitsidianakis
2026-07-10 6:40 ` [PATCH v4 00/97] tests/tcg: run tests with meson Pierrick Bouvier
2026-07-10 21:55 ` Pierrick Bouvier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=thy75i.2ycx7hqouutmv@linaro.org \
--to=manos.pitsidianakis@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=brian.cain@oss.qualcomm.com \
--cc=deller@gmx.de \
--cc=gustavo.romero@linaro.org \
--cc=iii@linux.ibm.com \
--cc=laurent@vivier.eu \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@oss.qualcomm.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.