diff options
author | Gabi Falk <gabifalk@gmx.com> | 2024-04-15 08:00:00 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-04-16 02:38:48 +0100 |
commit | ef9d26ba1e410d25b94cab81a6606e96e85d35d8 (patch) | |
tree | 63ea263a241771f52b8f5383d16a9dc00e0be424 /eclass/toolchain.eclass | |
parent | toolchain.eclass: always generate a new test-suite baseline manifest (diff) | |
download | gentoo-ef9d26ba1e410d25b94cab81a6606e96e85d35d8.tar.gz gentoo-ef9d26ba1e410d25b94cab81a6606e96e85d35d8.tar.bz2 gentoo-ef9d26ba1e410d25b94cab81a6606e96e85d35d8.zip |
toolchain.eclass: add a variable to force baseline regeneration
Suggested-by: Sam James <sam@gentoo.org>
Signed-off-by: Gabi Falk <gabifalk@gmx.com>
Closes: https://github.com/gentoo/gentoo/pull/36244
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass/toolchain.eclass')
-rw-r--r-- | eclass/toolchain.eclass | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 786d65da2d9a..2a74e6f165df 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -117,6 +117,13 @@ tc_version_is_between() { # Ignore missing baseline/reference data and create new baseline. : "${GCC_TESTS_IGNORE_NO_BASELINE:=}" +# @ECLASS_VARIABLE: GCC_TESTS_REGEN_BASELINE +# @DEFAULT_UNSET +# @USER_VARIABLE +# @DESCRIPTION: +# Ignore baseline/reference data and create new baseline. +: "${GCC_TESTS_REGEN_BASELINE:=}" + # @ECLASS_VARIABLE: GCC_TESTS_CHECK_TARGET # @USER_VARIABLE # @DESCRIPTION: @@ -1917,17 +1924,25 @@ toolchain_src_test() { --manifest="${T}"/${CHOST}.xfail \ --produce_manifest &> /dev/null - if [[ -f "${GCC_TESTS_COMPARISON_DIR}/${GCC_TESTS_COMPARISON_SLOT}/${CHOST}.xfail" ]] ; then + local manifest="${GCC_TESTS_COMPARISON_DIR}/${GCC_TESTS_COMPARISON_SLOT}/${CHOST}.xfail" + + if [[ -f "${manifest}" ]] ; then # TODO: Distribute some baseline results in e.g. gcc-patches.git? # validate_failures.py manifest files support include directives. - einfo "Comparing with previous cached results at GCC_TESTS_COMPARISON_DIR=${GCC_TESTS_COMPARISON_DIR}/${GCC_TESTS_COMPARISON_SLOT}/${CHOST}.xfail" + einfo "Comparing with previous cached results at ${manifest}" - edo "${T}"/validate_failures.py \ + nonfatal edo "${T}"/validate_failures.py \ --srcpath="${S}" \ --build_dir="${WORKDIR}"/build \ - --manifest="${GCC_TESTS_COMPARISON_DIR}/${GCC_TESTS_COMPARISON_SLOT}/${CHOST}.xfail" + --manifest="${manifest}" + ret=$? + + if [[ -n ${GCC_TESTS_REGEN_BASELINE} ]] ; then + eerror "GCC_TESTS_REGEN_BASELINE is set, ignoring test result and creating a new baseline..." + elif [[ ${ret} != 0 ]]; then + die "Tests failed (failures not listed in the baseline data)" + fi else - # nonfatal first because we want to run again with comparison data if available. nonfatal edo "${T}"/validate_failures.py \ --srcpath="${S}" \ --build_dir="${WORKDIR}"/build @@ -1935,13 +1950,15 @@ toolchain_src_test() { # We have no reference data saved from a previous run to know if # the failures are tolerable or not, so we bail out. - eerror "No reference test data at GCC_TESTS_COMPARISON_DIR=${GCC_TESTS_COMPARISON_DIR}/${GCC_TESTS_COMPARISON_SLOT}/${CHOST}.xfail!" + eerror "No reference test data at ${manifest}!" eerror "GCC's tests require a baseline to compare with for any reasonable interpretation of results." if [[ -n ${GCC_TESTS_IGNORE_NO_BASELINE} ]] ; then - eerror "GCC_TESTS_IGNORE_NO_BASELINE is set, creating new baseline manifest..." + eerror "GCC_TESTS_IGNORE_NO_BASELINE is set, ignoring test result and creating a new baseline..." + elif [[ -n ${GCC_TESTS_REGEN_BASELINE} ]] ; then + eerror "GCC_TESTS_REGEN_BASELINE is set, ignoring test result and creating using a new baseline..." elif [[ ${ret} != 0 ]]; then - eerror "(Set GCC_TESTS_IGNORE_NO_BASELINE=1 to make this non-fatal for initial run.)" + eerror "(Set GCC_TESTS_IGNORE_NO_BASELINE=1 to make this non-fatal and generate a baseline.)" die "Tests failed (failures occurred with no reference data)" fi fi |