When CPython tests fail, exit with 1 to signal failure (rather than error)

This commit is contained in:
Miro Hrončok 2026-05-13 17:02:07 +02:00
commit dfd41a9acf

View file

@ -32,4 +32,10 @@ export OPENSSL_CONF=/non-existing-file
$PYTHON -c 'import distutils' 2>/dev/null && export SETUPTOOLS_USE_DISTUTILS=stdlib || true $PYTHON -c 'import distutils' 2>/dev/null && export SETUPTOOLS_USE_DISTUTILS=stdlib || true
$PYTHON -m test.pythoninfo $PYTHON -m test.pythoninfo
$PYTHON -m test -wW -j$JOBS --timeout=$TIMEOUT $X $PYTHON -m test -wW -j$JOBS --timeout=$TIMEOUT $X && e=0 || e=$?
# https://tmt.readthedocs.io/en/stable/spec/tests.html#framework says only exit code 1 is failure, rest is error
# https://github.com/python/cpython/blob/v3.14.0/Lib/test/libregrtest/results.py#L18 says a bad test exits with 2
if [ $e -eq 2 ]; then
exit 1
fi
exit $e