Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
Date: Mon, 09 May 2022 20:33:42
Message-Id: 1652128307.f77482477e16fb380a1fe29bbbf88ba9d343a1ac.mgorny@gentoo
1 commit: f77482477e16fb380a1fe29bbbf88ba9d343a1ac
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 8 10:37:57 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon May 9 20:31:47 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7748247
7
8 eclass/tests/python-utils-r1.eclass: Add tests for adding new impls
9
10 Add tests that verify that new Python implementations are added to all
11 the places that need them.
12
13 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
14
15 eclass/tests/python-utils-r1.sh | 35 +++++++++++++++++++++++++++++++++++
16 1 file changed, 35 insertions(+)
17
18 diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
19 index d971c524b373..6abf10cadabd 100755
20 --- a/eclass/tests/python-utils-r1.sh
21 +++ b/eclass/tests/python-utils-r1.sh
22 @@ -96,6 +96,41 @@ for minor in 6 7 8 9 10 11; do
23 fi
24 test_var PYTHON_PKG_DEP "python3_${minor}" "*dev-lang/python*:3.${minor}"
25 test_var PYTHON_SCRIPTDIR "python3_${minor}" "/usr/lib/python-exec/python3.${minor}"
26 +
27 + tbegin "Testing that python3_${minor} is present in an impl array"
28 + has "python3_${minor}" "${_PYTHON_ALL_IMPLS[@]}"
29 + has_in_all=${?}
30 + has "python3_${minor}" "${_PYTHON_HISTORICAL_IMPLS[@]}"
31 + has_in_historical=${?}
32 + if [[ ${has_in_all} -eq ${has_in_historical} ]]; then
33 + if [[ ${has_in_all} -eq 1 ]]; then
34 + eerror "python3_${minor} not found in _PYTHON_ALL_IMPLS or _PYTHON_HISTORICAL_IMPLS"
35 + else
36 + eerror "python3_${minor} listed both in _PYTHON_ALL_IMPLS and _PYTHON_HISTORICAL_IMPLS"
37 + fi
38 + fi
39 + tend ${?}
40 +
41 + tbegin "Testing that PYTHON_COMPAT accepts the impl"
42 + (
43 + # NB: we add pypy3 as we need to always have at least one
44 + # non-historical impl
45 + PYTHON_COMPAT=( pypy3 "python3_${minor}" )
46 + _python_set_impls
47 + )
48 + tend ${?}
49 +
50 + # these tests apply to py3.8+ only
51 + if [[ ${minor} -ge 8 ]]; then
52 + tbegin "Testing that _python_verify_patterns accepts stdlib version"
53 + ( _python_verify_patterns "3.${minor}" )
54 + tend ${?}
55 +
56 + tbegin "Testing _python_impl_matches on stdlib version"
57 + _python_impl_matches "python3_${minor}" "3.${minor}"
58 + tend ${?}
59 + fi
60 +
61 eoutdent
62 done