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 D55661396D0 for ; Sun, 17 Sep 2017 00:52:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 320251FC100; 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 13D7E1FC0DA for ; Sun, 17 Sep 2017 00:52:02 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 4A46C3402FE 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 C58DF9094 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.0e14c664b964314a0a4830100ac63b3d604c27ab.kentnl@gentoo> Subject: [gentoo-commits] proj/perl-overlay:master commit in: eclass/ X-VCS-Repository: proj/perl-overlay X-VCS-Files: eclass/perl-functions.eclass X-VCS-Directories: eclass/ X-VCS-Committer: kentnl X-VCS-Committer-Name: Kent Fredric X-VCS-Revision: 0e14c664b964314a0a4830100ac63b3d604c27ab 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: 06832919-7448-43f4-83a8-428e3a7948ca X-Archives-Hash: c9e764376f78e92cb975537fb946a518 commit: 0e14c664b964314a0a4830100ac63b3d604c27ab Author: Kent Fredric gentoo org> AuthorDate: Sat Sep 16 03:56:30 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=0e14c664 perl-functions.eclass: Add (not in ::gentoo) perl_get_test_opts function eclass/perl-functions.eclass | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass index 194bbc820..1c40dac61 100644 --- a/eclass/perl-functions.eclass +++ b/eclass/perl-functions.eclass @@ -827,3 +827,38 @@ _perl_get_test_opts_eapi6() { printf "\n" return } + +# @FUNCTION: perl_get_test_opts +# @DESCRIPTION: +# Decodes a dizzying collection of options and returns a list of flags +# Returns a list of the following possible strings +# skip : tests should be skipped +# test : tests should run +# parallel : tests should run in parallel +# verbose : tests should be run verbosely +# network : network tests should run +# +# On first invocation, any atypical configurations will be ewarn'd about +# and then cached in perl_test_opts +# +# @CODE +# local opts="$(perl_get_test_opts)" +# if has verbose ${opts}; then +# ... +# fi +# if has network ${opts}; then +# ... +# fi +# @CODE +perl_get_test_opts() { + debug-print-function $FUNCNAME "$@" + + if [[ ! -v _perl_test_opts ]]; then + if [[ ${EAPI:-0} == 5 ]]; then + _perl_test_opts="$(_perl_get_test_opts_eapi5)" + else + _perl_test_opts="$(_perl_get_test_opts_eapi6)" + fi + fi + echo "${_perl_test_opts}" +}