Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o, dilfridge@g.o
Cc: "Andreas K. Huettel (dilfridge)" <dilfridge@g.o>
Subject: Re: [gentoo-dev] [PATCH 10/15] perl-module.eclass: Rename SRC_TEST to DIST_TEST in EAPI=6 and default to "do parallel"
Date: Sat, 12 Dec 2015 12:04:19
Message-Id: AEB995B8-923F-4DAB-BAAD-C4C0C029D381@gentoo.org
In Reply to: [gentoo-dev] [PATCH 10/15] perl-module.eclass: Rename SRC_TEST to DIST_TEST in EAPI=6 and default to "do parallel" by dilfridge@gentoo.org
1 Dnia 11 grudnia 2015 22:03:06 CET, dilfridge@g.o napisał(a):
2 >From: "Andreas K. Huettel (dilfridge)" <dilfridge@g.o>
3 >
4 >---
5 >eclass/perl-module.eclass | 40 +++++++++++++++++++++++-----------------
6 > 1 file changed, 23 insertions(+), 17 deletions(-)
7 >
8 >diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass
9 >index efcc47c..0d428d2 100644
10 >--- a/eclass/perl-module.eclass
11 >+++ b/eclass/perl-module.eclass
12 >@@ -154,6 +154,8 @@ if [[ ${EAPI:-0} = 5 ]] ; then
13 > SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}"
14 > [[ -z "${HOMEPAGE}" ]] && \
15 > HOMEPAGE="http://search.cpan.org/dist/${MODULE_NAME}/"
16 >+
17 >+ SRC_TEST="skip"
18 > else
19 > DIST_NAME=${DIST_NAME:-${PN}}
20 > DIST_P=${DIST_NAME}-${DIST_VERSION:-${PV}}
21 >@@ -168,7 +170,6 @@ else
22 > fi
23 >
24 > SRC_PREP="no"
25 >-SRC_TEST="skip"
26 > PREFER_BUILDPL="yes"
27 >
28 > pm_echovar=""
29 >@@ -315,6 +316,18 @@ perl-module_src_compile() {
30 > fi
31 > }
32 >
33 >+# @ECLASS-VARIABLE: DIST_TEST
34 >+# @DESCRIPTION:
35 >+# (EAPI=6) Variable that controls if tests are run in the test phase
36 >+# at all, and if yes under which conditions. Defaults to "do parallel"
37 >+# In EAPI=5 the variable is called SRC_TEST and defaults to "skip".
38 >+# All of the following have been tested to work:
39 >+# DIST_TEST="do parallel"
40 >+# DIST_TEST="parallel"
41 >+# DIST_TEST="parallel do"
42 >+# DIST_TEST=parallel
43 >+# DIST_TEST=skip
44
45 At this point, I'm starting to wonder why you aren't using PERL_ prefix...
46
47 >+
48 > # @FUNCTION: perl-module_src-test
49 > # @USAGE: perl-module_src_test()
50 > # @DESCRIPTION:
51 >@@ -323,24 +336,17 @@ perl-module_src_compile() {
52 > #
53 > # If you want more verbose testing, set TEST_VERBOSE=1
54 > # in your bashrc | /etc/portage/make.conf | ENV
55 >-#
56 >-# or ebuild writers:
57 >-# If you wish to enable default tests w/ 'make test' ,
58 >-#
59 >-# SRC_TEST="do"
60 >-#
61 >-# If you wish to have threads run in parallel ( using the users
62 >makeopts )
63 >-# all of the following have been tested to work.
64 >-#
65 >-# SRC_TEST="do parallel"
66 >-# SRC_TEST="parallel"
67 >-# SRC_TEST="parallel do"
68 >-# SRC_TEST=parallel
69 >-#
70 > perl-module_src_test() {
71 > debug-print-function $FUNCNAME "$@"
72 >- if has 'do' ${SRC_TEST} || has 'parallel' ${SRC_TEST} ; then
73 >- if has "${TEST_VERBOSE:-0}" 0 && has 'parallel' ${SRC_TEST} ; then
74 >+ local my_test_control
75 >+ if [[ ${EAPI:-0} = 5 ]] ; then
76 >+ my_test_control=${SRC_TEST}
77 >+ else
78 >+ my_test_control=${DIST_TEST:-do parallel}
79 >+ fi
80 >+
81 >+ if has 'do' ${my_test_control} || has 'parallel' ${my_test_control} ;
82 >then
83 >+ if has "${TEST_VERBOSE:-0}" 0 && has 'parallel' ${my_test_control} ;
84 >then
85 > export HARNESS_OPTIONS=j$(makeopts_jobs)
86 > einfo "Test::Harness Jobs=$(makeopts_jobs)"
87 > fi
88
89 --
90 Sent from my Android device with K-9 Mail. Please excuse my brevity.

Replies