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: Thu, 02 Jul 2020 08:29:35
Message-Id: 1593678558.2917508e1ac399d73e4714468ee95a3a28cb979f.mgorny@gentoo
1 commit: 2917508e1ac399d73e4714468ee95a3a28cb979f
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jul 2 08:09:02 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Jul 2 08:29:18 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2917508e
7
8 eclass/tests/distutils-r1*.sh: Cover DISTUTILS_USE_SETUPTOOLS
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 eclass/tests/distutils-r1.sh | 43 ++++++++++++++++++++++++++++++++++++-
13 eclass/tests/distutils-r1_single.sh | 41 +++++++++++++++++++++++++++++++++++
14 2 files changed, 83 insertions(+), 1 deletion(-)
15
16 diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
17 index 237fc1eebae..93496f9ac00 100755
18 --- a/eclass/tests/distutils-r1.sh
19 +++ b/eclass/tests/distutils-r1.sh
20 @@ -35,7 +35,38 @@ test-distutils_enable_tests() {
21 for var in IUSE RESTRICT BDEPEND; do
22 local exp_var=exp_${var}
23 # (this normalizes whitespace)
24 - read -a val <<<"${!var}"
25 + read -d $'\0' -r -a val <<<"${!var}"
26 + val=${val[*]}
27 + if [[ ${val} != "${!exp_var}" ]]; then
28 + eindent
29 + eerror "${var} expected: ${!exp_var}"
30 + eerror "${var} actual: ${val}"
31 + eoutdent
32 + ret=1
33 + tret=1
34 + fi
35 + done
36 +
37 + tend ${ret}
38 +}
39 +
40 +test-DISTUTILS_USE_SETUPTOOLS() {
41 + local DISTUTILS_USE_SETUPTOOLS=${1}
42 + local exp_BDEPEND=${2}
43 + local exp_RDEPEND=${3}
44 +
45 + tbegin "${1}"
46 +
47 + local BDEPEND=
48 + local RDEPEND=
49 + unset _DISTUTILS_R1
50 + inherit distutils-r1
51 +
52 + local ret var val
53 + for var in BDEPEND RDEPEND; do
54 + local exp_var=exp_${var}
55 + # (this normalizes whitespace)
56 + read -d $'\0' -r -a val <<<"${!var}"
57 val=${val[*]}
58 if [[ ${val} != "${!exp_var}" ]]; then
59 eindent
60 @@ -98,4 +129,14 @@ eoutdent
61
62 eoutdent
63
64 +einfo DISTUTILS_USE_SETUPTOOLS
65 +eindent
66 +SETUPTOOLS_DEP=">=dev-python/setuptools-42.0.2[python_targets_python3_8(-)?,-python_single_target_python3_8(-)]"
67 +test-DISTUTILS_USE_SETUPTOOLS no "${BASE_DEPS}" "${BASE_DEPS}"
68 +test-DISTUTILS_USE_SETUPTOOLS bdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS}"
69 +test-DISTUTILS_USE_SETUPTOOLS rdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS} ${SETUPTOOLS_DEP}"
70 +test-DISTUTILS_USE_SETUPTOOLS pyproject.toml "${BASE_DEPS} dev-python/pyproject2setuppy[python_targets_python3_8(-)?,-python_single_target_python3_8(-)]" "${BASE_DEPS}"
71 +test-DISTUTILS_USE_SETUPTOOLS manual "${BASE_DEPS}" "${BASE_DEPS}"
72 +eoutdent
73 +
74 texit
75
76 diff --git a/eclass/tests/distutils-r1_single.sh b/eclass/tests/distutils-r1_single.sh
77 index 6c79e36881b..80c152b6ee0 100755
78 --- a/eclass/tests/distutils-r1_single.sh
79 +++ b/eclass/tests/distutils-r1_single.sh
80 @@ -39,6 +39,37 @@ test-distutils_enable_tests() {
81 tend ${ret}
82 }
83
84 +test-DISTUTILS_USE_SETUPTOOLS() {
85 + local DISTUTILS_USE_SETUPTOOLS=${1}
86 + local exp_BDEPEND=${2}
87 + local exp_RDEPEND=${3}
88 +
89 + tbegin "${1}"
90 +
91 + local BDEPEND=
92 + local RDEPEND=
93 + unset _DISTUTILS_R1
94 + inherit distutils-r1
95 +
96 + local ret var val
97 + for var in BDEPEND RDEPEND; do
98 + local exp_var=exp_${var}
99 + # (this normalizes whitespace)
100 + read -d $'\0' -r -a val <<<"${!var}"
101 + val=${val[*]}
102 + if [[ ${val} != "${!exp_var}" ]]; then
103 + eindent
104 + eerror "${var} expected: ${!exp_var}"
105 + eerror "${var} actual: ${val}"
106 + eoutdent
107 + ret=1
108 + tret=1
109 + fi
110 + done
111 +
112 + tend ${ret}
113 +}
114 +
115 DISTUTILS_USE_SETUPTOOLS=no
116 DISTUTILS_SINGLE_IMPL=1
117 inherit distutils-r1
118 @@ -78,4 +109,14 @@ eoutdent
119
120 eoutdent
121
122 +einfo DISTUTILS_USE_SETUPTOOLS
123 +eindent
124 +SETUPTOOLS_DEP="python_single_target_python3_8? ( >=dev-python/setuptools-42.0.2[python_targets_python3_8(-)] )"
125 +test-DISTUTILS_USE_SETUPTOOLS no "${BASE_DEPS}" "${BASE_DEPS}"
126 +test-DISTUTILS_USE_SETUPTOOLS bdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS}"
127 +test-DISTUTILS_USE_SETUPTOOLS rdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS} ${SETUPTOOLS_DEP}"
128 +test-DISTUTILS_USE_SETUPTOOLS pyproject.toml "${BASE_DEPS} python_single_target_python3_8? ( dev-python/pyproject2setuppy[python_targets_python3_8(-)] )" "${BASE_DEPS}"
129 +test-DISTUTILS_USE_SETUPTOOLS manual "${BASE_DEPS}" "${BASE_DEPS}"
130 +eoutdent
131 +
132 texit