summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorKent Fredric <kentnl@gentoo.org>2017-09-16 15:56:30 +1200
committerKent Fredric <kentnl@gentoo.org>2017-09-17 12:39:38 +1200
commit0e14c664b964314a0a4830100ac63b3d604c27ab (patch)
treeb03beffca80dd59da574cb09f362557f315ab456 /eclass
parentperl-functions.eclass: Add internal option decoder for eapi6 (diff)
downloadperl-overlay-0e14c664b964314a0a4830100ac63b3d604c27ab.tar.gz
perl-overlay-0e14c664b964314a0a4830100ac63b3d604c27ab.tar.bz2
perl-overlay-0e14c664b964314a0a4830100ac63b3d604c27ab.zip
perl-functions.eclass: Add (not in ::gentoo) perl_get_test_opts function
Diffstat (limited to 'eclass')
-rw-r--r--eclass/perl-functions.eclass35
1 files changed, 35 insertions, 0 deletions
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}"
+}