« lib/Module/Provision/Base.pm
↑ Summary
blib/lib/auto/share/dist/Module-Provision/boilerplate_whitelist.pm »
| 1 | package t::boilerplate; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | use File::Spec::Functions qw( catdir catfile updir ); | ||
| 6 | use FindBin qw( $Bin ); | ||
| 7 | use lib catdir( $Bin, updir, 'lib' ), catdir( $Bin, 'lib' ); | ||
| 8 | |||
| 9 | use Module::Build; | ||
| 10 | use Sys::Hostname; | ||
| 11 | |||
| 12 | sub plan (;@) { | ||
| 13 | $_[ 0 ] eq 'skip_all' and print '1..0 # SKIP '.$_[ 1 ]."\n" and exit 0; | ||
| 14 | } | ||
| 15 | |||
| 16 | my ($builder, $host, $notes, $perl_ver); | ||
| 17 | |||
| 18 | BEGIN { | ||
| 19 | $host = lc hostname; | ||
| 20 | $builder = eval { Module::Build->current }; | ||
| 21 | $notes = $builder ? $builder->notes : {}; | ||
| 22 | $perl_ver = $notes->{min_perl_version} || 5.008; | ||
| 23 | |||
| 24 | eval { require Test::Requires }; $@ and plan skip_all => 'No Test::Requires'; | ||
| 25 | |||
| 26 | $Bin =~ m{ : .+ : }mx and plan skip_all => 'Two colons in $Bin path'; | ||
| 27 | |||
| 28 | if ($notes->{testing}) { | ||
| 29 | my $dumped = catfile( 't', 'exceptions.dd' ); | ||
| 30 | my $except = {}; -f $dumped and $except = do $dumped; | ||
| 31 | |||
| 32 | exists $except->{ $host } and plan skip_all => | ||
| 33 | 'Broken smoker '.$except->{ $host }; | ||
| 34 | |||
| 35 | for my $key (keys %{ $except }) { | ||
| 36 | $host =~ m{ $key \z }mx and plan skip_all => | ||
| 37 | 'Broken smoker '.$except->{ $key }; | ||
| 38 | } | ||
| 39 | } | ||
| 40 | } | ||
| 41 | |||
| 42 | use Test::Requires "${perl_ver}"; | ||
| 43 | use Test::Requires { version => 0.88 }; | ||
| 44 | |||
| 45 | use version; our $VERSION = qv( '0.3' ); | ||
| 46 | |||
| 47 | sub import { | ||
| 48 | strict->import; | ||
| 49 | $] < 5.008 ? warnings->import : warnings->import( NONFATAL => 'all' ); | ||
| 50 | return; | ||
| 51 | } | ||
| 52 | |||
| 53 | 1; | ||
| 54 | |||
| 55 | # Local Variables: | ||
| 56 | # mode: perl | ||
| 57 | # tab-width: 3 | ||
| 58 | # End: | ||
| 59 | # vim: expandtab shiftwidth=3: |