From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C83711396D0 for ; Sun, 17 Sep 2017 00:52:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4105D1FC108; Sun, 17 Sep 2017 00:52:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1429C1FC0F7 for ; Sun, 17 Sep 2017 00:52:02 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2C0FF33D3CE for ; Sun, 17 Sep 2017 00:52:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id EB8099096 for ; Sun, 17 Sep 2017 00:51:57 +0000 (UTC) From: "Kent Fredric" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Kent Fredric" Message-ID: <1505608778.827cfafd22e458208ed384e48e71e57c9c333b05.kentnl@gentoo> Subject: [gentoo-commits] proj/perl-overlay:master commit in: eclass/ X-VCS-Repository: proj/perl-overlay X-VCS-Files: eclass/perl-module.eclass X-VCS-Directories: eclass/ X-VCS-Committer: kentnl X-VCS-Committer-Name: Kent Fredric X-VCS-Revision: 827cfafd22e458208ed384e48e71e57c9c333b05 X-VCS-Branch: master Date: Sun, 17 Sep 2017 00:51:57 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 605df019-1084-4a99-aca8-f7383bc547bb X-Archives-Hash: 555b757747969c6bd26d2d34ee75dbff commit: 827cfafd22e458208ed384e48e71e57c9c333b05 Author: Kent Fredric gentoo org> AuthorDate: Sat Sep 16 06:25:35 2017 +0000 Commit: Kent Fredric gentoo org> CommitDate: Sun Sep 17 00:39:38 2017 +0000 URL: https://gitweb.gentoo.org/proj/perl-overlay.git/commit/?id=827cfafd perl-module.eclass: Reimplement src_test using perl_has_test_opt eclass/perl-module.eclass | 77 ++++++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 34 deletions(-) diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass index 5789d96bf..d94a3d554 100644 --- a/eclass/perl-module.eclass +++ b/eclass/perl-module.eclass @@ -316,7 +316,8 @@ perl-module_src_compile() { fi } -# Starting 2014-10-12: +# Historical notes for EAPI5 only on perl-experimental +# Starting 2014-10-12 # # AUTHORS: # @@ -344,51 +345,59 @@ perl-module_src_compile() { # SRC_TEST: # No longer used and completely ignored +# @ECLASS-VARIABLE: DIST_TEST +# @DESCRIPTION: +# (EAPI=6) Variable that controls if tests are run in the test phase +# at all, and if yes under which conditions. Defaults to "do parallel" +# If neither "do" nor "parallel" is recognized, tests are skipped. +# (In EAPI=5 the variable is called SRC_TEST, defaults to "skip", and +# recognizes fewer options.) +# The following space-separated keywords are recognized: +# do : run tests +# parallel : run tests in parallel +# verbose : increase test verbosity +# network : do not try to disable network tests + +# @ECLASS-VARIABLE: DIST_TEST_OVERRIDE +# @DEFAULT_UNSET +# @DESCRIPTION: +# (EAPI=6) Variable that controls if tests are run in the test phase +# at all, and if yes under which conditions. It is intended for use in +# make.conf or the environment by ebuild authors during testing, and +# accepts the same values as DIST_TEST. If set, it overrides DIST_TEST +# completely. DO NOT USE THIS IN EBUILDS! + +# @FUNCTION: perl-module_src-test +# @DESCRIPTION: +# This code attempts to work out your threadingness and runs tests +# according to the settings of DIST_TEST using Test::Harness. perl-module_src_test() { debug-print-function $FUNCNAME "$@" + local my_test_verbose=0 - # Turn it off globally per user choice. - if has 'parallel-test' ${USER_PERL_RESTRICT}; then - einfo "Disabling Parallel Testing: USER_PERL_RESTRICT=parallel-test"; - export HARNESS_OPTIONS=""; - - # If user has TEST_VERBOSE globally, disable parallelism because verboseness - # can break parallel testing. - elif ! has "${TEST_VERBOSE:-0}" 0; then - einfo "Disabling Parallel Testing: TEST_VERBOSE=${TEST_VERBOSE}"; - export HARNESS_OPTIONS=""; - - # If ebuild says parallel tests dont work, turn them off. - elif has 'parallel-test' ${PERL_RESTRICT}; then - einfo "Disabling Parallel Testing: PERL_RESTRICT=parallel-test"; - export HARNESS_OPTIONS=""; - else - # Default is on. + + if perl_has_test_opt skip; then + return; + fi + + perl_has_test_opt verbose && my_test_verbose=1 + + if perl_has_test_opt parallel; then einfo "Test::Harness Jobs=$(makeopts_jobs)" export HARNESS_OPTIONS=j$(makeopts_jobs) + else + export HARNESS_OPTIONS="" fi - # If a user says "USER_PERL_RESTRICT=network-test", - # then assume many CPAN dists will respect NO_NETWORK_TESTING and friends - # even if Gentoo haven't made the entire dist "no network testing" - if has 'network-test' ${USER_PERL_RESTRICT}; then + if ! perl_has_test_opt network; then export NO_NETWORK_TESTING=1 fi - # However, if CPAN don't auto trigger on the above, Gentoo - # Can still disable them package wide with PERL_RESTRICT=network-test - # But they'll run by default unless USER_PERL_RESTRICT=network-test - if has 'network-test' ${USER_PERL_RESTRICT} && has 'network-test' ${PERL_RESTRICT}; then - einfo "Skipping Tests: USER_PERL_RESTRICT=network-test && PERL_RESTRICT=network-test"; - return true; - fi - - ${perlinfo_done} || perl_set_version - + perl_set_version if [[ -f Build ]] ; then - ./Build test verbose=${TEST_VERBOSE:-0} || die "test failed" + ./Build test verbose=${my_test_verbose} || die "test failed" elif [[ -f Makefile ]] ; then - emake test TEST_VERBOSE=${TEST_VERBOSE:-0} || die "test failed" + emake test TEST_VERBOSE=${my_test_verbose} || die "test failed" fi }