• [gentoo-dev] [PATCH 3/6] eclass/tests/python-utils-r1.eclass: Add tests

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sun May 8 20:30:01 2022
    Add tests that verify that new Python implementations are added to all
    the places that need them.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/tests/python-utils-r1.sh | 35 +++++++++++++++++++++++++++++++++
    1 file changed, 35 insertions(+)

    diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh index d971c524b373..6abf10cadabd 100755
    --- a/eclass/tests/python-utils-r1.sh
    +++ b/eclass/tests/python-utils-r1.sh
    @@ -96,6 +96,41 @@ for minor in 6 7 8 9 10 11; do
    fi
    test_var PYTHON_PKG_DEP "python3_${minor}" "*dev-lang/python*:3.${minor}"
    test_var PYTHON_SCRIPTDIR "python3_${minor}" "/usr/lib/python-exec/python3.${minor}"
    +
    + tbegin "Testing that python3_${minor} is present in an impl array"
    + has "python3_${minor}" "${_PYTHON_ALL_IMPLS[@]}"
    + has_in_all=${?}
    + has "python3_${minor}" "${_PYTHON_HISTORICAL_IMPLS[@]}"
    + has_in_historical=${?}
    + if [[ ${has_in_all} -eq ${has_in_historical} ]]; then
    + if [[ ${has_in_all} -eq 1 ]]; then
    + eerror "python3_${minor} not found in _PYTHON_ALL_IMPLS or _PYTHON_HISTORICAL_IMPLS"
    + else
    + eerror "python3_${minor} listed both in _PYTHON_ALL_IMPLS an