summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-07-02 10:09:02 +0200
committerMichał Górny <mgorny@gentoo.org>2020-07-02 10:29:18 +0200
commit2917508e1ac399d73e4714468ee95a3a28cb979f (patch)
tree33c2cbdb828b42421bad8a872e6763b2af402a20 /eclass
parentdistutils-r1.eclass: Fix pyproject.toml w/ single-r1 (diff)
downloadgentoo-2917508e1ac399d73e4714468ee95a3a28cb979f.tar.gz
gentoo-2917508e1ac399d73e4714468ee95a3a28cb979f.tar.bz2
gentoo-2917508e1ac399d73e4714468ee95a3a28cb979f.zip
eclass/tests/distutils-r1*.sh: Cover DISTUTILS_USE_SETUPTOOLS
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rwxr-xr-xeclass/tests/distutils-r1.sh43
-rwxr-xr-xeclass/tests/distutils-r1_single.sh41
2 files changed, 83 insertions, 1 deletions
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
index 237fc1eebae1..93496f9ac007 100755
--- a/eclass/tests/distutils-r1.sh
+++ b/eclass/tests/distutils-r1.sh
@@ -35,7 +35,38 @@ test-distutils_enable_tests() {
for var in IUSE RESTRICT BDEPEND; do
local exp_var=exp_${var}
# (this normalizes whitespace)
- read -a val <<<"${!var}"
+ read -d $'\0' -r -a val <<<"${!var}"
+ val=${val[*]}
+ if [[ ${val} != "${!exp_var}" ]]; then
+ eindent
+ eerror "${var} expected: ${!exp_var}"
+ eerror "${var} actual: ${val}"
+ eoutdent
+ ret=1
+ tret=1
+ fi
+ done
+
+ tend ${ret}
+}
+
+test-DISTUTILS_USE_SETUPTOOLS() {
+ local DISTUTILS_USE_SETUPTOOLS=${1}
+ local exp_BDEPEND=${2}
+ local exp_RDEPEND=${3}
+
+ tbegin "${1}"
+
+ local BDEPEND=
+ local RDEPEND=
+ unset _DISTUTILS_R1
+ inherit distutils-r1
+
+ local ret var val
+ for var in BDEPEND RDEPEND; do
+ local exp_var=exp_${var}
+ # (this normalizes whitespace)
+ read -d $'\0' -r -a val <<<"${!var}"
val=${val[*]}
if [[ ${val} != "${!exp_var}" ]]; then
eindent
@@ -98,4 +129,14 @@ eoutdent
eoutdent
+einfo DISTUTILS_USE_SETUPTOOLS
+eindent
+SETUPTOOLS_DEP=">=dev-python/setuptools-42.0.2[python_targets_python3_8(-)?,-python_single_target_python3_8(-)]"
+test-DISTUTILS_USE_SETUPTOOLS no "${BASE_DEPS}" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS bdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS rdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS} ${SETUPTOOLS_DEP}"
+test-DISTUTILS_USE_SETUPTOOLS pyproject.toml "${BASE_DEPS} dev-python/pyproject2setuppy[python_targets_python3_8(-)?,-python_single_target_python3_8(-)]" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS manual "${BASE_DEPS}" "${BASE_DEPS}"
+eoutdent
+
texit
diff --git a/eclass/tests/distutils-r1_single.sh b/eclass/tests/distutils-r1_single.sh
index 6c79e36881b0..80c152b6ee0c 100755
--- a/eclass/tests/distutils-r1_single.sh
+++ b/eclass/tests/distutils-r1_single.sh
@@ -39,6 +39,37 @@ test-distutils_enable_tests() {
tend ${ret}
}
+test-DISTUTILS_USE_SETUPTOOLS() {
+ local DISTUTILS_USE_SETUPTOOLS=${1}
+ local exp_BDEPEND=${2}
+ local exp_RDEPEND=${3}
+
+ tbegin "${1}"
+
+ local BDEPEND=
+ local RDEPEND=
+ unset _DISTUTILS_R1
+ inherit distutils-r1
+
+ local ret var val
+ for var in BDEPEND RDEPEND; do
+ local exp_var=exp_${var}
+ # (this normalizes whitespace)
+ read -d $'\0' -r -a val <<<"${!var}"
+ val=${val[*]}
+ if [[ ${val} != "${!exp_var}" ]]; then
+ eindent
+ eerror "${var} expected: ${!exp_var}"
+ eerror "${var} actual: ${val}"
+ eoutdent
+ ret=1
+ tret=1
+ fi
+ done
+
+ tend ${ret}
+}
+
DISTUTILS_USE_SETUPTOOLS=no
DISTUTILS_SINGLE_IMPL=1
inherit distutils-r1
@@ -78,4 +109,14 @@ eoutdent
eoutdent
+einfo DISTUTILS_USE_SETUPTOOLS
+eindent
+SETUPTOOLS_DEP="python_single_target_python3_8? ( >=dev-python/setuptools-42.0.2[python_targets_python3_8(-)] )"
+test-DISTUTILS_USE_SETUPTOOLS no "${BASE_DEPS}" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS bdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS rdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS} ${SETUPTOOLS_DEP}"
+test-DISTUTILS_USE_SETUPTOOLS pyproject.toml "${BASE_DEPS} python_single_target_python3_8? ( dev-python/pyproject2setuppy[python_targets_python3_8(-)] )" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS manual "${BASE_DEPS}" "${BASE_DEPS}"
+eoutdent
+
texit