From: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
To: "Alex Bennée" <alex.bennee@linaro.org>, qemu-devel@nongnu.org
Cc: "Aurelien Jarno" <aurelien@aurel32.net>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Chinmay Rath" <rathc@linux.ibm.com>,
"Helge Deller" <deller@gmx.de>,
"Chao Liu" <chao.liu@processmission.com>,
"Weiwei Li" <liwei1518@gmail.com>,
"David Hildenbrand" <david@kernel.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"LIU Zhiwei" <zhiwei_liu@linux.alibaba.com>,
qemu-riscv@nongnu.org, qemu-s390x@nongnu.org,
"Brian Cain" <brian.cain@oss.qualcomm.com>,
"Alistair Francis" <alistair.francis@wdc.com>,
"Ilya Leoshkevich" <iii@linux.ibm.com>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Song Gao" <17746591750@163.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
qemu-arm@nongnu.org, "Stafford Horne" <shorne@gmail.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Yoshinori Sato" <yoshinori.sato@nifty.com>,
qemu-ppc@nongnu.org,
"Daniel Henrique Barboza" <daniel.barboza@oss.qualcomm.com>,
"Bibo Mao" <maobibo@loongson.cn>,
"Xianglai Li" <lixianglai@loongson.cn>,
"Laurent Vivier" <laurent@vivier.eu>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Aleksandar Rikalo" <arikalo@gmail.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Glenn Miles" <milesg@linux.ibm.com>
Subject: Re: [PATCH v2 2/6] scripts/tests: add regen-reference.sh
Date: Wed, 2 Dec 2026 13:12:07 -0800 [thread overview]
Message-ID: <35f2b44e-e531-447c-a5ef-d6bff75a146f@oss.qualcomm.com> (raw)
In-Reply-To: <20261201113005.394788-3-alex.bennee@linaro.org>
On 12/1/2026 3:30 AM, Alex Bennée wrote:
> While we should verify references with real hardware we don't have
> hardware for all cases. Since the meson conversion we've made
> reference files mandatory so lets include a helper script to make
> things a bit easier to update.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>
> ---
> v2
> - moved the refs to the next patch
> ---
> scripts/tests/regen-reference.sh | 87 ++++++++++++++++++++++++++++++++
> 1 file changed, 87 insertions(+)
> create mode 100755 scripts/tests/regen-reference.sh
>
> diff --git a/scripts/tests/regen-reference.sh b/scripts/tests/regen-reference.sh
> new file mode 100755
> index 00000000000..0600b56bef8
> --- /dev/null
> +++ b/scripts/tests/regen-reference.sh
> @@ -0,0 +1,87 @@
> +#!/bin/sh
> +#
> +# Regenerate TCG test reference files.
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +set -eu
> +
> +usage() {
> + cat <<EOF
> +Usage: ./run $(basename "$0") [-n] <test-name-or-stub>
> +
> +Regenerate TCG reference (.ref) files for tests matching <test-name-or-stub>.
> +This script must be executed from inside a QEMU build directory using the './run' wrapper.
> +
> +Options:
> + -n Dry run (print commands without executing or overwriting files)
> + -h Show this help message
> +EOF
> + exit "${1:-1}"
> +}
> +
> +DRY_RUN=0
> +
> +while getopts "nh" opt; do
> + case "$opt" in
> + n) DRY_RUN=1 ;;
> + h) usage 0 ;;
> + *) usage 1 ;;
> + esac
> +done
> +shift $((OPTIND - 1))
> +
> +if [ $# -lt 1 ]; then
> + usage 1
> +fi
> +
> +TEST_PATTERN="$1"
> +
> +# Must be run using the ./run wrapper which provides MESON_SOURCE_ROOT and MESON_BUILD_ROOT
> +if [ -z "${MESON_SOURCE_ROOT:-}" ] || [ -z "${MESON_BUILD_ROOT:-}" ]; then
> + echo "Error: MESON_SOURCE_ROOT or MESON_BUILD_ROOT is not set." >&2
> + echo "This script must be executed from inside a build directory using the './run' wrapper, e.g.:" >&2
> + echo " cd <build-dir> && ./run \$PWD/../scripts/tests/regen-reference.sh ${TEST_PATTERN}" >&2
> + exit 1
> +fi
> +
> +SRC_ROOT="$MESON_SOURCE_ROOT"
> +BUILD_DIR="$MESON_BUILD_ROOT"
> +
> +# Ensure we are inside the build directory
> +if [ ! -f "build.ninja" ] || [ "$(pwd -P)" != "$(cd "$BUILD_DIR" && pwd -P)" ]; then
> + echo "Error: This script must be executed from inside the build directory." >&2
> + echo "Please cd into your build directory and run via './run'." >&2
> + exit 1
> +fi
> +
> +echo "!!! Warning: about to regenerate with TCG !!!"
> +echo "You should verify the real hardware generates the same reference files where you can"
> +
> +# Query meson test list
> +TEST_LIST=$(meson test --suite tcg --list "*${TEST_PATTERN}*" | grep -v "plugin")
> +
> +while IFS= read -r line; do
> + case "$line" in
> + *" / "*)
> + test_name="${line##* / }"
> + case "$test_name" in
> + *-linux-user-*)
> + arch="${test_name%%-linux-user-*}"
> + test_base="${test_name#*-linux-user-}"
> +
> + qemu_bin="./qemu-${arch}"
> + test_bin="tests/tcg/${test_name}.test"
> + ref_file="${SRC_ROOT}/tests/tcg/${arch}/${test_base}.ref"
> +
> + echo "${qemu_bin} ${test_bin} > ${ref_file}"
> + if [ "$DRY_RUN" -eq 0 ]; then
> + "${qemu_bin}" "${test_bin}" > "${ref_file}"
> + fi
> + ;;
> + esac
> + ;;
> + esac
> +done <<EOF
> +$TEST_LIST
> +EOF
See original review here:
https://lore.kernel.org/qemu-devel/6dc1341f-5c1b-4e81-8ec4-a3c522f76980@oss.qualcomm.com/
next prev parent reply other threads:[~2026-12-02 21:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 11:29 [PATCH v2 0/6] [soft|hard]float: tests and bug fix for #5203 Alex Bennée
2026-12-01 11:29 ` [PATCH v2 1/6] meson: expose MESON_SOURCE_ROOT to scripts Alex Bennée
2026-12-01 11:30 ` [PATCH v2 2/6] scripts/tests: add regen-reference.sh Alex Bennée
2026-12-02 21:12 ` Pierrick Bouvier [this message]
2026-12-02 21:26 ` Richard Henderson
2026-12-02 21:31 ` Pierrick Bouvier
2026-12-02 21:38 ` Philippe Mathieu-Daudé
2026-12-02 21:48 ` Pierrick Bouvier
2026-12-03 9:05 ` Alex Bennée
2026-12-01 11:30 ` [PATCH v2 3/6] tests/tcg: extend the float_madds test case Alex Bennée
2026-12-02 21:12 ` Pierrick Bouvier
2026-12-02 21:35 ` Richard Henderson
2026-12-01 11:30 ` [PATCH v2 4/6] fpu/softfloat: gate hardfloat on working fmaf Alex Bennée
2026-12-02 21:37 ` Richard Henderson
2026-12-01 11:30 ` [PATCH v2 5/6] fpu: promote force_soft_fma to force_soft_float Alex Bennée
2026-12-02 21:43 ` Richard Henderson
2026-12-03 9:10 ` Alex Bennée
2026-12-01 11:30 ` [PATCH v2 6/6] tests/fp: add fp-test-hard Alex Bennée
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=35f2b44e-e531-447c-a5ef-d6bff75a146f@oss.qualcomm.com \
--to=pierrick.bouvier@oss.qualcomm.com \
--cc=17746591750@163.com \
--cc=alex.bennee@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=arikalo@gmail.com \
--cc=aurelien@aurel32.net \
--cc=berrange@redhat.com \
--cc=brian.cain@oss.qualcomm.com \
--cc=chao.liu@processmission.com \
--cc=daniel.barboza@oss.qualcomm.com \
--cc=david@kernel.org \
--cc=deller@gmx.de \
--cc=harshpb@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=jiaxun.yang@flygoat.com \
--cc=laurent@vivier.eu \
--cc=liwei1518@gmail.com \
--cc=lixianglai@loongson.cn \
--cc=maobibo@loongson.cn \
--cc=marcandre.lureau@redhat.com \
--cc=milesg@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=palmer@dabbelt.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@oss.qualcomm.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=rathc@linux.ibm.com \
--cc=richard.henderson@linaro.org \
--cc=shorne@gmail.com \
--cc=yoshinori.sato@nifty.com \
--cc=zhiwei_liu@linux.alibaba.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.