1 |
From: "Andreas K. Huettel (dilfridge)" <dilfridge@g.o> |
2 |
|
3 |
--- |
4 |
eclass/perl-module.eclass | 40 +++++++++++++++++++++++----------------- |
5 |
1 file changed, 23 insertions(+), 17 deletions(-) |
6 |
|
7 |
diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass |
8 |
index efcc47c..0d428d2 100644 |
9 |
--- a/eclass/perl-module.eclass |
10 |
+++ b/eclass/perl-module.eclass |
11 |
@@ -154,6 +154,8 @@ if [[ ${EAPI:-0} = 5 ]] ; then |
12 |
SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}" |
13 |
[[ -z "${HOMEPAGE}" ]] && \ |
14 |
HOMEPAGE="http://search.cpan.org/dist/${MODULE_NAME}/" |
15 |
+ |
16 |
+ SRC_TEST="skip" |
17 |
else |
18 |
DIST_NAME=${DIST_NAME:-${PN}} |
19 |
DIST_P=${DIST_NAME}-${DIST_VERSION:-${PV}} |
20 |
@@ -168,7 +170,6 @@ else |
21 |
fi |
22 |
|
23 |
SRC_PREP="no" |
24 |
-SRC_TEST="skip" |
25 |
PREFER_BUILDPL="yes" |
26 |
|
27 |
pm_echovar="" |
28 |
@@ -315,6 +316,18 @@ perl-module_src_compile() { |
29 |
fi |
30 |
} |
31 |
|
32 |
+# @ECLASS-VARIABLE: DIST_TEST |
33 |
+# @DESCRIPTION: |
34 |
+# (EAPI=6) Variable that controls if tests are run in the test phase |
35 |
+# at all, and if yes under which conditions. Defaults to "do parallel" |
36 |
+# In EAPI=5 the variable is called SRC_TEST and defaults to "skip". |
37 |
+# All of the following have been tested to work: |
38 |
+# DIST_TEST="do parallel" |
39 |
+# DIST_TEST="parallel" |
40 |
+# DIST_TEST="parallel do" |
41 |
+# DIST_TEST=parallel |
42 |
+# DIST_TEST=skip |
43 |
+ |
44 |
# @FUNCTION: perl-module_src-test |
45 |
# @USAGE: perl-module_src_test() |
46 |
# @DESCRIPTION: |
47 |
@@ -323,24 +336,17 @@ perl-module_src_compile() { |
48 |
# |
49 |
# If you want more verbose testing, set TEST_VERBOSE=1 |
50 |
# in your bashrc | /etc/portage/make.conf | ENV |
51 |
-# |
52 |
-# or ebuild writers: |
53 |
-# If you wish to enable default tests w/ 'make test' , |
54 |
-# |
55 |
-# SRC_TEST="do" |
56 |
-# |
57 |
-# If you wish to have threads run in parallel ( using the users makeopts ) |
58 |
-# all of the following have been tested to work. |
59 |
-# |
60 |
-# SRC_TEST="do parallel" |
61 |
-# SRC_TEST="parallel" |
62 |
-# SRC_TEST="parallel do" |
63 |
-# SRC_TEST=parallel |
64 |
-# |
65 |
perl-module_src_test() { |
66 |
debug-print-function $FUNCNAME "$@" |
67 |
- if has 'do' ${SRC_TEST} || has 'parallel' ${SRC_TEST} ; then |
68 |
- if has "${TEST_VERBOSE:-0}" 0 && has 'parallel' ${SRC_TEST} ; then |
69 |
+ local my_test_control |
70 |
+ if [[ ${EAPI:-0} = 5 ]] ; then |
71 |
+ my_test_control=${SRC_TEST} |
72 |
+ else |
73 |
+ my_test_control=${DIST_TEST:-do parallel} |
74 |
+ fi |
75 |
+ |
76 |
+ if has 'do' ${my_test_control} || has 'parallel' ${my_test_control} ; then |
77 |
+ if has "${TEST_VERBOSE:-0}" 0 && has 'parallel' ${my_test_control} ; then |
78 |
export HARNESS_OPTIONS=j$(makeopts_jobs) |
79 |
einfo "Test::Harness Jobs=$(makeopts_jobs)" |
80 |
fi |
81 |
-- |
82 |
2.6.3 |