From: Peter Rabbitson Date: Sun, 11 Mar 2012 12:49:04 +0000 (+0100) Subject: No extra tests on ancient perls X-Git-Tag: v1.003001~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=084caaf3333363995b31eb2f4b2e7c6bcfda9146;p=p5sagit%2Fstrictures.git No extra tests on ancient perls --- diff --git a/Changes b/Changes index 463a6de..89498d3 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + - disable extra tests on perls <= 5.008003, things do not work there as + expected 1.002002 - 2011-02-25 - only try and mkdir the .git if it doesn't already exist so repeated test runs don't explode diff --git a/lib/strictures.pm b/lib/strictures.pm index 06301c0..911746d 100644 --- a/lib/strictures.pm +++ b/lib/strictures.pm @@ -3,6 +3,8 @@ package strictures; use strict; use warnings FATAL => 'all'; +use constant _PERL_LT_5_8_4 => ($] < 5.008004) ? 1 : 0; + our $VERSION = '1.002002'; # 1.2.2 sub VERSION { @@ -22,10 +24,15 @@ sub VERSION { sub import { strict->import; warnings->import(FATAL => 'all'); + my $extra_tests = do { if (exists $ENV{PERL_STRICTURES_EXTRA}) { - $ENV{PERL_STRICTURES_EXTRA} - } else { + if (_PERL_LT_5_8_4 and $ENV{PERL_STRICTURES_EXTRA}) { + die 'PERL_STRICTUTRES_EXTRA checks are not available on perls older than 5.8.4, ' + . "please unset \$ENV{PERL_STRICTURES_EXTRA}\n"; + } + $ENV{PERL_STRICTURES_EXTRA}; + } elsif (! _PERL_LT_5_8_4) { !!($0 =~ /^x?t\/.*(?:load|compile|coverage|use_ok).*\.t$/ and (-e '.git' or -e '.svn')) } @@ -41,7 +48,8 @@ sub import { multidimensional->unimport; bareword::filehandles->unimport; } else { - die "strictures.pm extra testing active but couldn't load modules. + die <