3 # This file is part of GNU Stow.
5 # GNU Stow is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # GNU Stow is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see https://www.gnu.org/licenses/.
18 # Load perlbrew environment
19 # Load before setting safety to keep
20 # perlbrew scripts from breaking due to
22 .
/usr
/local
/perlbrew
/etc
/bashrc
24 # Standard safety protocol
28 test_perl_version
() {
30 perlbrew use
$perl_version
32 echo $
(perl
--version)
36 eval `perl -V:siteprefix`
37 .
/configure
--prefix=$siteprefix && make
42 perl Build.PL
&& .
/Build build
&& cover
-test
46 if [[ -n "$LIST_PERL_VERSIONS" ]]; then
47 echo "Listing Perl versions available from perlbrew ..."
49 elif [[ -z "$PERL_VERSION" ]]; then
50 echo "Testing all versions ..."
51 for perl_version
in $
(perlbrew list |
sed 's/ //g'); do
52 test_perl_version
$perl_version
56 echo "Testing with Perl $PERL_VERSION"
57 # Test a specific version requested via $PERL_VERSION environment
58 # variable. Make sure set -e doesn't cause us to bail on failure
59 # before we start an interactive shell.
60 test_perl_version
$PERL_VERSION ||
:
61 # N.B. Don't distclean since we probably want to debug this Perl
62 # version interactively.
64 To run a specific test, type something like:
66 perl -Ilib -Ibin -It t/cli_options.t
68 Code can be edited on the host and will immediately take effect inside