diff options
author | Kent Fredric <kentnl@gentoo.org> | 2017-09-16 14:12:17 +1200 |
---|---|---|
committer | Kent Fredric <kentnl@gentoo.org> | 2017-09-17 12:39:37 +1200 |
commit | a02c6eaf26f440d9cdca673672f7cccf3fc1535f (patch) | |
tree | fd709a153d606a664b984c650ac86ec12af63418 /eclass | |
parent | perl-module.eclass: run perl_check_eapi in src_configure (diff) | |
download | perl-overlay-a02c6eaf26f440d9cdca673672f7cccf3fc1535f.tar.gz perl-overlay-a02c6eaf26f440d9cdca673672f7cccf3fc1535f.tar.bz2 perl-overlay-a02c6eaf26f440d9cdca673672f7cccf3fc1535f.zip |
perl-functions.eclass: add internal option-decoder for eapi5
This is an internal function that produces a canonical option string
as per EAPI5 as per the deviated API I introduced on overlay
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/perl-functions.eclass | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass index 21fe60592..28657799f 100644 --- a/eclass/perl-functions.eclass +++ b/eclass/perl-functions.eclass @@ -740,3 +740,46 @@ perl_check_eapi() { eerror "Your ebuild/env contains eclass variables that are known invalid/legacy and indicate author oversight." die "Please file a bug for this ebuild as per above details." } + +# Internal: this is specific to EAPI5 on the overlay +_perl_get_test_opts_eapi5() { + local can_test=1 + local is_parallel=1 + local is_verbose=0 + local is_network=1 + debug-print-function $FUNCNAME "$@" + + if has 'parallel-test' ${USER_PERL_RESTRICT}; then + ewarn "Parallel tests disabled via USER_PERL_RESTRICT=parallel-test" + is_parallel=0 + elif ! has "${TEST_VERBOSE:-0}" 0; then + ewarn "Parallel tests disabled via TEST_VERBOSE=1" + ewarn "Verbose tests enabled via TEST_VERBOSE=1" + is_verbose=1 + is_parallel=0 + elif has 'parallel-test' ${PERL_RESTRICT}; then + ewarn "Parallel tests disabled via PERL_RESTRICT=parallel-test" + is_parallel=0 + fi + + if has 'network-test' ${USER_PERL_RESTRICT} && has 'network-test' ${PERL_RESTRICT}; then + ewarn "Tests disabled via USER_PERL_RESTRICT & PERL_RESTRICT = network-test" + can_test=0 + elif has 'network-test' ${USER_PERL_RESTRICT}; then + ewarn "Network tests disabled via USER_PERL_RESTRICT=network-test" + is_network=0 + fi + + if [[ ${can_test} == 0 ]]; then + printf "skip\n" + return; + fi + + printf "test " + [[ ${is_parallel} == 1 ]] && printf "parallel " + [[ ${is_verbose} == 1 ]] && printf "verbose " + [[ ${is_network} == 1 ]] && printf "network " + printf "\n" + return +} + |