1 |
Signed-off-by: Michał Górny <mgorny@g.o> |
2 |
--- |
3 |
eclass/tests/distutils-r1.sh | 67 +++++++++++++++++++++++++++++++++++- |
4 |
1 file changed, 66 insertions(+), 1 deletion(-) |
5 |
|
6 |
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh |
7 |
index d557f6cad534..d5f3e2812ca4 100755 |
8 |
--- a/eclass/tests/distutils-r1.sh |
9 |
+++ b/eclass/tests/distutils-r1.sh |
10 |
@@ -17,6 +17,36 @@ test-phase_name_free() { |
11 |
fi |
12 |
} |
13 |
|
14 |
+test-distutils_enable_tests() { |
15 |
+ local runner=${1} |
16 |
+ local exp_IUSE=${2} |
17 |
+ local exp_RESTRICT=${3} |
18 |
+ local exp_DEPEND=${4} |
19 |
+ |
20 |
+ local IUSE=${IUSE} |
21 |
+ local RESTRICT=${RESTRICT} |
22 |
+ local DEPEND=${DEPEND} |
23 |
+ |
24 |
+ tbegin "${runner}" |
25 |
+ |
26 |
+ distutils_enable_tests "${runner}" |
27 |
+ |
28 |
+ local ret var |
29 |
+ for var in IUSE RESTRICT DEPEND; do |
30 |
+ local exp_var=exp_${var} |
31 |
+ if [[ ${!var} != "${!exp_var}" ]]; then |
32 |
+ eindent |
33 |
+ eerror "${var} expected: ${!exp_var}" |
34 |
+ eerror "${var} actual: ${!var}" |
35 |
+ eoutdent |
36 |
+ ret=1 |
37 |
+ tret=1 |
38 |
+ fi |
39 |
+ done |
40 |
+ |
41 |
+ tend ${ret} |
42 |
+} |
43 |
+ |
44 |
inherit distutils-r1 |
45 |
|
46 |
tbegin "sane function names" |
47 |
@@ -27,6 +57,41 @@ test-phase_name_free python_compile |
48 |
test-phase_name_free python_test |
49 |
test-phase_name_free python_install |
50 |
|
51 |
-tend ${failed} |
52 |
+tend |
53 |
+ |
54 |
+einfo distutils_enable_tests |
55 |
+eindent |
56 |
+BASE_IUSE="python_targets_python2_7" |
57 |
+BASE_DEPS="python_targets_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_python2_7(-)]" |
58 |
+TEST_RESTRICT=" !test? ( test )" |
59 |
+ |
60 |
+einfo "empty RDEPEND" |
61 |
+eindent |
62 |
+RDEPEND="" |
63 |
+test-distutils_enable_tests pytest \ |
64 |
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/pytest[${PYTHON_USEDEP}] )" |
65 |
+test-distutils_enable_tests nose \ |
66 |
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/nose[${PYTHON_USEDEP}] )" |
67 |
+test-distutils_enable_tests unittest \ |
68 |
+ "${BASE_IUSE}" "" "${BASE_DEPS}" |
69 |
+test-distutils_enable_tests setup.py \ |
70 |
+ "${BASE_IUSE}" "" "${BASE_DEPS}" |
71 |
+eoutdent |
72 |
+ |
73 |
+einfo "non-empty RDEPEND" |
74 |
+eindent |
75 |
+BASE_RDEPEND="dev-python/foo[${PYTHON_USEDEP}]" |
76 |
+RDEPEND=${BASE_RDEPEND} |
77 |
+test-distutils_enable_tests pytest \ |
78 |
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/pytest[${PYTHON_USEDEP}] ${BASE_RDEPEND} )" |
79 |
+test-distutils_enable_tests nose \ |
80 |
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/nose[${PYTHON_USEDEP}] ${BASE_RDEPEND} )" |
81 |
+test-distutils_enable_tests unittest \ |
82 |
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )" |
83 |
+test-distutils_enable_tests setup.py \ |
84 |
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )" |
85 |
+eoutdent |
86 |
+ |
87 |
+eoutdent |
88 |
|
89 |
texit |
90 |
-- |
91 |
2.24.0 |