commit:     60b86b0b85f41fe4a288410c27f928e27f987c4a
Author:     Kent Fredric <kentnl <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 16 03:58:31 2017 +0000
Commit:     Kent Fredric <kentnl <AT> gentoo <DOT> org>
CommitDate: Sun Sep 17 00:39:38 2017 +0000
URL:        https://gitweb.gentoo.org/proj/perl-overlay.git/commit/?id=60b86b0b

perl-functions.eclass: add (Not in ::gentoo) perl_has_test_opt function

 eclass/perl-functions.eclass | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass
index 1c40dac61..45d4da617 100644
--- a/eclass/perl-functions.eclass
+++ b/eclass/perl-functions.eclass
@@ -862,3 +862,30 @@ perl_get_test_opts() {
        fi
        echo "${_perl_test_opts}"
 }
+
+# @FUNCTION: perl_has_test_opt
+# @USAGE: <option name>
+# @DESCRIPTION:
+# Compute if a given test flag is enabled by computing a bunch of environment 
values
+#
+# See perl_get_test_opts for the various values and meanings
+#
+# @CODE
+# src_test() {
+#  if ! perl_has_test_opt network; then
+#     ...
+#  fi
+#  perl-module_src_test
+# }
+# @CODE
+perl_has_test_opt() {
+       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
+       has "$1" ${_perl_test_opts}
+}

Reply via email to