All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Aniket Sahu" <asahu1x@linux.ibm.com>
Subject: [PULL 008/105] tests/tcg/meson.build: introduce cflags
Date: Fri,  4 Sep 2026 13:44:22 +0100	[thread overview]
Message-ID: <20260904124604.2207440-9-alex.bennee@linaro.org> (raw)
In-Reply-To: <20260904124604.2207440-1-alex.bennee@linaro.org>

From: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>

We add possibility to declare cflags for a given test. Since we want to
preserve the uniqueness of test binaries, we prevent repeating those
cflags later, for an existing binary.

This ensures one executable == one set of cflags, and if dev needs
duplication, they can use a custom 'exe_name' to override this.

Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Aniket Sahu <asahu1x@linux.ibm.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Message-ID: <20260827221506.91574-9-pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

diff --git a/tests/tcg/meson.build b/tests/tcg/meson.build
index ae7ec998f63..e8d8cfbcf88 100644
--- a/tests/tcg/meson.build
+++ b/tests/tcg/meson.build
@@ -13,6 +13,7 @@ tcg_tests = {}
 #         'src_file': {
 #           'exe_name': ['provide an alternative binary name'],
 #           'test_name': ['provide an alternative test name'],
+#           'cflags': ['additional cflags to compile test', ...],
 #         }
 #       },
 #       ...
@@ -20,7 +21,8 @@ tcg_tests = {}
 #   }
 # }
 #
-# Every test executable, identified by 'exe_name' is built only once.
+# Every test executable, identified by 'exe_name' is built only once, and we
+# ensure cflags are specified only once, on first declaration.
 # Tests for a given src use the same executable by default, and their definition
 # is guaranteed to be unique also. Several tests for the same executable can
 # declared using 'test_name'.
@@ -54,7 +56,7 @@ foreach target, plan: tcg_tests
     foreach src, setup: t
       # return a clear error if user misspell a setup entry
       foreach key, _ : setup
-        allowed = ['exe_name', 'test_name']
+        allowed = ['exe_name', 'cflags', 'test_name']
         if key not in allowed
           error('unknown tcg setup entry \'' + key + '\' for test ' + src +
                 ' (possible: [' + ', '.join(allowed) + '])')
@@ -82,6 +84,15 @@ foreach target, plan: tcg_tests
               'specify a different \'test_name\'')
       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
+
       # build executable if needed
       if exe_name not in built_tests
         exe = custom_target(exe_name,
@@ -91,7 +102,7 @@ foreach target, plan: tcg_tests
                                       '-MMD', '-MF', '@DEPFILE@',
                                       '-Wall', '-Werror',
                                       '-O0', '-g', '-fno-strict-aliasing',
-                                      ],
+                                      cflags],
                             depfile: exe_name + '.d',
                             output: exe_name + '.test',
                             build_by_default: false)
-- 
2.47.3



  parent reply	other threads:[~2026-09-04 12:47 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04 12:44 [PULL 000/105] move check-tcg into the meson build Alex Bennée
2026-09-04 12:44 ` [PULL 001/105] tests/tcg/multiarch/system/memory.c: remove unused variable Alex Bennée
2026-09-04 12:44 ` [PULL 002/105] tests/tcg/multiarch/plugin/check-plugin-output.sh: take test output as input Alex Bennée
2026-09-04 12:44 ` [PULL 003/105] tests/tcg/multiarch/plugin: rename check-plugin-output to regex-compare Alex Bennée
2026-09-04 12:44 ` [PULL 004/105] meson: bump minimal version to 1.6.0 Alex Bennée
2026-09-04 12:44 ` [PULL 005/105] tests/tcg: introduce meson.build Alex Bennée
2026-09-04 12:44 ` [PULL 006/105] tests/tcg/meson.build: introduce exe_name Alex Bennée
2026-09-04 12:44 ` [PULL 007/105] tests/tcg/meson.build: introduce test_name Alex Bennée
2026-09-04 12:44 ` Alex Bennée [this message]
2026-09-04 12:44 ` [PULL 009/105] tests/tcg/meson.build: introduce qemu_args Alex Bennée
2026-09-04 12:44 ` [PULL 010/105] tests/tcg/meson.build: introduce env_var Alex Bennée
2026-09-04 12:44 ` [PULL 011/105] tests/tcg/plugins: build list of test_plugins Alex Bennée
2026-09-04 12:44 ` [PULL 012/105] tests/tcg/meson.build: introduce plugin_test Alex Bennée
2026-09-04 12:44 ` [PULL 013/105] tests/tcg/meson.build: test gdb support and introduce gdb_arch Alex Bennée
2026-09-04 12:44 ` [PULL 014/105] tests/tcg/meson.build: introduce gdb_test Alex Bennée
2026-09-04 12:44 ` [PULL 015/105] tests/tcg/meson.build: introduce wrapper Alex Bennée
2026-09-04 12:44 ` [PULL 016/105] tests/tcg/meson.build: introduce expected_output Alex Bennée
2026-09-04 12:44 ` [PULL 017/105] tests/tcg/meson.build: add wrapper run_and_check_forbidden_output Alex Bennée
2026-09-04 12:44 ` [PULL 018/105] tests/tcg/meson.build: add wrapper run_with_input Alex Bennée
2026-09-04 12:44 ` [PULL 019/105] tests/tcg/meson.build: add wrapper record_replay Alex Bennée
2026-09-04 12:44 ` [PULL 020/105] tests/tcg/meson.build: add wrapper check_plugin_output Alex Bennée
2026-09-04 12:44 ` [PULL 021/105] tests/tcg/meson.build: add logic to skip tests Alex Bennée
2026-09-04 12:44 ` [PULL 022/105] tests/tcg/meson.build: introduce cc_feat and cc_feat_cflags Alex Bennée
2026-09-04 12:44 ` [PULL 023/105] tests/tcg/meson.build: introduce gdb_feat and gdb_feat_version Alex Bennée
2026-09-04 12:44 ` [PULL 024/105] tests/tcg/meson.build: move gdb_arch support check Alex Bennée
2026-09-04 12:44 ` [PULL 025/105] tests/tcg/meson.build: let test infrastructure detect compiler Alex Bennée
2026-09-04 12:44 ` [PULL 026/105] tests/docker/docker.py: return error code if probe fails Alex Bennée
2026-09-04 12:44 ` [PULL 027/105] tests/docker/docker.py: remove "Image is up to date" info Alex Bennée
2026-09-04 12:44 ` [PULL 028/105] tests/tcg/meson.build: introduce cc_dockerfile and cc_docker_host_arch Alex Bennée
2026-09-04 12:44 ` [PULL 029/105] tests/tcg/meson.build: check host cross cc is working Alex Bennée
2026-09-04 12:44 ` [PULL 030/105] tests/tcg/meson.build: introduce depends Alex Bennée
2026-09-04 12:44 ` [PULL 031/105] tests/tcg/meson.build: use full path for QEMU binary Alex Bennée
2026-09-04 12:44 ` [PULL 032/105] tests/tcg/meson.build: add top-level 'tcg-tests' target Alex Bennée
2026-09-04 12:44 ` [PULL 033/105] tests/tcg/Makefile: skip user/system tests if target Makefile is not present Alex Bennée
2026-09-04 12:44 ` [PULL 034/105] tests/tcg/multiarch/gdbstub/prot-none.py: deactivate on gitlab CI Alex Bennée
2026-09-04 12:44 ` [PULL 035/105] tests/tcg/multiarch/gdbstub/prot-none.py: detect if /proc/self/mem can be used to access PROT_NONE pages Alex Bennée
2026-09-04 12:44 ` [PULL 036/105] tests/tcg/multiarch: declare user tests Alex Bennée
2026-09-04 12:44 ` [PULL 037/105] tests/tcg/multiarch: declare system tests Alex Bennée
2026-09-04 12:44 ` [PULL 038/105] tests/tcg/meson.build: add generic plugin tests Alex Bennée
2026-09-04 12:44 ` [PULL 039/105] tests/tcg/arm/fcvt.c: use raw opcode for FPRCVT Alex Bennée
2026-09-04 12:44 ` [PULL 040/105] tests/tcg/aarch64: user tests Alex Bennée
2026-09-04 12:44 ` [PULL 041/105] tests/tcg/aarch64/system/gpc-test.c: remove unused variables Alex Bennée
2026-09-04 12:44 ` [PULL 042/105] tests/tcg/aarch64: system tests Alex Bennée
2026-09-04 12:44 ` [PULL 043/105] tests/tcg/aarch64_be: user tests Alex Bennée
2026-09-04 12:44 ` [PULL 044/105] tests/tcg/alpha: add float reference files Alex Bennée
2026-09-04 12:44 ` [PULL 045/105] tests/tcg/alpha: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 046/105] tests/tcg/alpha: system tests Alex Bennée
2026-09-04 12:45 ` [PULL 047/105] tests/tcg/arm: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 048/105] tests/tcg/arm: system tests Alex Bennée
2026-09-04 12:45 ` [PULL 049/105] tests/tcg/hexagon/overflow.c: add missing include Alex Bennée
2026-09-04 12:45 ` [PULL 050/105] tests/tcg/hexagon: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 051/105] tests/tcg/multiarch/sha1.c: fix big endian implementation Alex Bennée
2026-09-04 12:45 ` [PULL 052/105] tests/tcg/hppa: add float reference files Alex Bennée
2026-09-04 12:45 ` [PULL 053/105] tests/tcg/hppa: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 054/105] tests/tcg/i386: add missing float reference files Alex Bennée
2026-09-04 12:45 ` [PULL 055/105] tests/tcg/i386: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 056/105] tests/tcg/i386: system tests Alex Bennée
2026-09-04 12:45 ` [PULL 057/105] tests/tcg/loongarch64: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 058/105] tests/tcg/loongarch64: system tests Alex Bennée
2026-09-04 12:45 ` [PULL 059/105] tests/tcg/m68k: add float reference files Alex Bennée
2026-09-04 12:45 ` [PULL 060/105] tests/tcg/m68k: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 061/105] scripts/probe-gdb-support.py: add mapping for mips architecture Alex Bennée
2026-09-04 12:45 ` [PULL 062/105] tests/tcg/mips: add float reference files Alex Bennée
2026-09-04 12:45 ` [PULL 063/105] test/tcg/mips: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 064/105] tests/tcg/mips64: add float reference files Alex Bennée
2026-09-04 12:45 ` [PULL 065/105] tests/tcg/mips64: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 066/105] tests/tcg/mips64el: add float reference files Alex Bennée
2026-09-04 12:45 ` [PULL 067/105] tests/tcg/mips64el: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 068/105] tests/docker/dockerfiles/debian-all-test-cross.docker: add or1k toolchain Alex Bennée
2026-09-04 12:45 ` [PULL 069/105] tests/tcg/or1k/test_addic.c: remove unused variables Alex Bennée
2026-09-04 12:45 ` [PULL 070/105] tests/tcg/or1k/test_muli.c: remove set but unused variable Alex Bennée
2026-09-04 12:45 ` [PULL 071/105] tests/tcg/or1k: add float reference files Alex Bennée
2026-09-04 12:45 ` [PULL 072/105] plugins/api.c: identify or1k pc register and mark it as read only Alex Bennée
2026-09-04 12:45 ` [PULL 073/105] tests/tcg/or1k: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 074/105] tests/tcg/ppc64: add float reference files Alex Bennée
2026-09-04 12:45 ` [PULL 075/105] tests/tcg/ppc64: remove dependency on qemu/compiler.h Alex Bennée
2026-09-04 12:45 ` [PULL 076/105] tests/tcg/ppc64: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 077/105] tests/tcg/ppc64le: add missing float reference file Alex Bennée
2026-09-04 12:45 ` [PULL 078/105] tests/tcg/ppc64le: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 079/105] tests/tcg/riscv64: add float reference files Alex Bennée
2026-09-04 12:45 ` [PULL 080/105] tests/tcg/riscv64: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 081/105] tests/tcg/riscv64: system tests Alex Bennée
2026-09-04 12:45 ` [PULL 082/105] tests/tcg/s390x/head64.S: declare _exit symbol after main Alex Bennée
2026-09-04 12:45 ` [PULL 083/105] tests/tcg/s390x: add float reference files Alex Bennée
2026-09-04 12:45 ` [PULL 084/105] tests/tcg/s390x: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 085/105] tests/tcg/s390x/console.c: directly implement memcpy and memset Alex Bennée
2026-09-04 12:45 ` [PULL 086/105] tests/tcg/s390x: system tests Alex Bennée
2026-09-04 12:45 ` [PULL 087/105] tests/tcg/sh4: add float reference files Alex Bennée
2026-09-04 12:45 ` [PULL 088/105] tests/tcg/sh4: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 089/105] tests/tcg/tricore: system tests Alex Bennée
2026-09-04 12:45 ` [PULL 090/105] tests/tcg/x86_64: add missing float reference file Alex Bennée
2026-09-04 12:45 ` [PULL 091/105] tests/tcg/x86_64: user tests Alex Bennée
2026-09-04 12:45 ` [PULL 092/105] tests/tcg/x86_64: system tests Alex Bennée
2026-09-04 12:45 ` [PULL 093/105] tests/tcg/xtensa/crt.S: align .text section Alex Bennée
2026-09-04 12:45 ` [PULL 094/105] tests/docker/dockerfiles/debian-xtensa-cross.docker: add test_kc705_be toolchain for xtensaeb Alex Bennée
2026-09-04 12:45 ` [PULL 095/105] tests/tcg/xtensa: system tests Alex Bennée
2026-09-04 12:45 ` [PULL 096/105] tests/tcg/xtensa: xtensaeb " Alex Bennée
2026-09-04 12:45 ` [PULL 097/105] tests: remove tcg tests machinery Alex Bennée
2026-09-04 12:45 ` [PULL 098/105] tests/tcg: remove remaining Makefiles Alex Bennée
2026-09-04 12:45 ` [PULL 099/105] configure: directly pass gdb path as a meson option Alex Bennée
2026-09-04 12:45 ` [PULL 100/105] tests/tcg/meson.build: implement ./configure containers options Alex Bennée
2026-09-04 12:45 ` [PULL 101/105] tests/tcg/meson.build: implement ./configure -cross-cc-* options Alex Bennée
2026-09-07 12:55   ` Daniel P. Berrangé
2026-09-07 13:26     ` Alex Bennée
2026-09-07 13:46       ` Daniel P. Berrangé
2026-09-04 12:45 ` [PULL 102/105] configure: remove cross_cc and gdb detection logic Alex Bennée
2026-09-11 16:16   ` Eric Farman
2026-09-11 17:48     ` Alex Bennée
2026-09-11 18:22       ` Eric Farman
2026-09-04 12:45 ` [PULL 103/105] meson.build: add summary for TCG tests Alex Bennée
2026-09-04 12:45 ` [PULL 104/105] docs/devel/testing/: update documentation Alex Bennée
2026-09-04 12:45 ` [PULL 105/105] MAINTAINERS: add maintainer for tcg/tests meson infrastructure Alex Bennée
2026-09-04 13:46 ` [PULL 000/105] move check-tcg into the meson build Philippe Mathieu-Daudé
2026-09-04 15:43   ` Alex Bennée
2026-09-04 15:57     ` Peter Maydell

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=20260904124604.2207440-9-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=asahu1x@linux.ibm.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    /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.