From: Nicholas Clark Date: Sun, 30 Aug 2009 10:43:13 +0000 (+0100) Subject: Remove the $ENV{PERL_CORE} boilerplate from Storable's tests. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=48c887ddc33dfbf3b9e6fb6dd8b46ff33407caa0;p=p5sagit%2Fp5-mst-13.2.git Remove the $ENV{PERL_CORE} boilerplate from Storable's tests. --- diff --git a/ext/Storable/t/attach_errors.t b/ext/Storable/t/attach_errors.t index 85971db..ffa41f9 100644 --- a/ext/Storable/t/attach_errors.t +++ b/ext/Storable/t/attach_errors.t @@ -13,12 +13,7 @@ # which Storable should (correctly) throw errors. sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/attach_singleton.t b/ext/Storable/t/attach_singleton.t index 475204f..e850a16 100644 --- a/ext/Storable/t/attach_singleton.t +++ b/ext/Storable/t/attach_singleton.t @@ -10,12 +10,7 @@ # which should see both structs pointing to the same object. sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/blessed.t b/ext/Storable/t/blessed.t index 842674f..7c0494c 100644 --- a/ext/Storable/t/blessed.t +++ b/ext/Storable/t/blessed.t @@ -7,12 +7,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/canonical.t b/ext/Storable/t/canonical.t index 7b7936c..204a235 100644 --- a/ext/Storable/t/canonical.t +++ b/ext/Storable/t/canonical.t @@ -7,12 +7,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/circular_hook.t b/ext/Storable/t/circular_hook.t index 782b3d3..48f4be4 100644 --- a/ext/Storable/t/circular_hook.t +++ b/ext/Storable/t/circular_hook.t @@ -13,12 +13,7 @@ # which Storable should (correctly) throw errors. sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/code.t b/ext/Storable/t/code.t index c3c988b..dd2a96e 100644 --- a/ext/Storable/t/code.t +++ b/ext/Storable/t/code.t @@ -7,12 +7,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/compat01.t b/ext/Storable/t/compat01.t index 536d85e..9b47212 100644 --- a/ext/Storable/t/compat01.t +++ b/ext/Storable/t/compat01.t @@ -1,12 +1,7 @@ #!perl -w BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/compat06.t b/ext/Storable/t/compat06.t index 7dbf1b8..6d8ade3 100644 --- a/ext/Storable/t/compat06.t +++ b/ext/Storable/t/compat06.t @@ -7,12 +7,7 @@ # BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/croak.t b/ext/Storable/t/croak.t index 96c7cb3..ecd2bf8 100644 --- a/ext/Storable/t/croak.t +++ b/ext/Storable/t/croak.t @@ -6,10 +6,6 @@ # In particular, don't use Test; as this covers up the problem. sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } if ($ENV{PERL_CORE}) { require Config; import Config; %Config=%Config if 0; # cease -w diff --git a/ext/Storable/t/dclone.t b/ext/Storable/t/dclone.t index c3aa180..078cd81 100644 --- a/ext/Storable/t/dclone.t +++ b/ext/Storable/t/dclone.t @@ -7,12 +7,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/downgrade.t b/ext/Storable/t/downgrade.t index d977a00..76bd05a 100644 --- a/ext/Storable/t/downgrade.t +++ b/ext/Storable/t/downgrade.t @@ -13,12 +13,7 @@ # are encountered. sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/forgive.t b/ext/Storable/t/forgive.t index 1c07a57..495edc3 100644 --- a/ext/Storable/t/forgive.t +++ b/ext/Storable/t/forgive.t @@ -10,12 +10,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/freeze.t b/ext/Storable/t/freeze.t index d69e3b4..e76b669 100644 --- a/ext/Storable/t/freeze.t +++ b/ext/Storable/t/freeze.t @@ -7,12 +7,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/integer.t b/ext/Storable/t/integer.t index ec7961e..2c22235 100644 --- a/ext/Storable/t/integer.t +++ b/ext/Storable/t/integer.t @@ -13,12 +13,7 @@ # are encountered. sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/interwork56.t b/ext/Storable/t/interwork56.t index 5339c0f..4e9b414 100644 --- a/ext/Storable/t/interwork56.t +++ b/ext/Storable/t/interwork56.t @@ -13,12 +13,7 @@ # on Unix systems with IV as long long works. sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/just_plain_nasty.t b/ext/Storable/t/just_plain_nasty.t index 77271fb..85eaa90 100644 --- a/ext/Storable/t/just_plain_nasty.t +++ b/ext/Storable/t/just_plain_nasty.t @@ -6,12 +6,7 @@ # Everyone's invited! :-D sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/lock.t b/ext/Storable/t/lock.t index e93cef4..14b5f42 100644 --- a/ext/Storable/t/lock.t +++ b/ext/Storable/t/lock.t @@ -7,12 +7,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/malice.t b/ext/Storable/t/malice.t index 648b15f..ddb65dd 100644 --- a/ext/Storable/t/malice.t +++ b/ext/Storable/t/malice.t @@ -14,13 +14,8 @@ # It also acts as a test for read_header sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - # This lets us distribute Test::More in t/ - unshift @INC, 't'; - } + # This lets us distribute Test::More in t/ + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/overload.t b/ext/Storable/t/overload.t index 93f0794..22fccfb 100644 --- a/ext/Storable/t/overload.t +++ b/ext/Storable/t/overload.t @@ -7,12 +7,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/recurse.t b/ext/Storable/t/recurse.t index 18b461b..d7dcb0e 100644 --- a/ext/Storable/t/recurse.t +++ b/ext/Storable/t/recurse.t @@ -7,12 +7,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/restrict.t b/ext/Storable/t/restrict.t index d5c4bd6..be7f408 100644 --- a/ext/Storable/t/restrict.t +++ b/ext/Storable/t/restrict.t @@ -7,9 +7,8 @@ # sub BEGIN { - chdir('t') if -d 't'; + unshift @INC, 't'; if ($ENV{PERL_CORE}){ - @INC = ('.', '../lib', '../ext/Storable/t'); require Config; if ($Config::Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/retrieve.t b/ext/Storable/t/retrieve.t index b022511..2e44d5d 100644 --- a/ext/Storable/t/retrieve.t +++ b/ext/Storable/t/retrieve.t @@ -7,12 +7,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/sig_die.t b/ext/Storable/t/sig_die.t index 0350752..d2390a7 100644 --- a/ext/Storable/t/sig_die.t +++ b/ext/Storable/t/sig_die.t @@ -7,12 +7,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/store.t b/ext/Storable/t/store.t index fc2141c..61bcf7d 100644 --- a/ext/Storable/t/store.t +++ b/ext/Storable/t/store.t @@ -7,12 +7,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/threads.t b/ext/Storable/t/threads.t index 664566e..72efdda 100644 --- a/ext/Storable/t/threads.t +++ b/ext/Storable/t/threads.t @@ -17,12 +17,7 @@ # thread when it starts sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/tied.t b/ext/Storable/t/tied.t index 662d9ae..9a7f571 100644 --- a/ext/Storable/t/tied.t +++ b/ext/Storable/t/tied.t @@ -7,12 +7,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/tied_hook.t b/ext/Storable/t/tied_hook.t index 28b5363..8f2846e 100644 --- a/ext/Storable/t/tied_hook.t +++ b/ext/Storable/t/tied_hook.t @@ -7,12 +7,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/tied_items.t b/ext/Storable/t/tied_items.t index ba918bf..bd15e5c 100644 --- a/ext/Storable/t/tied_items.t +++ b/ext/Storable/t/tied_items.t @@ -11,12 +11,7 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/utf8.t b/ext/Storable/t/utf8.t index ab0f62c..67b7917 100644 --- a/ext/Storable/t/utf8.t +++ b/ext/Storable/t/utf8.t @@ -12,12 +12,7 @@ sub BEGIN { print "1..0 # Skip: no utf8 support\n"; exit 0; } - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/ext/Storable/t/utf8hash.t b/ext/Storable/t/utf8hash.t index a529ea5..7eac651 100644 --- a/ext/Storable/t/utf8hash.t +++ b/ext/Storable/t/utf8hash.t @@ -5,17 +5,7 @@ sub BEGIN { print "1..0 # Skip: no utf8 hash key support\n"; exit 0; } - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - if ($^O eq 'MacOS') { - # Look, I'm using this fully-qualified variable more than once! - my $arch = $MacPerl::Architecture; - push @INC, "::lib:${MacPerl::Architecture}:"; - } - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE}){ if($Config{'extensions'} !~ /\bStorable\b/) { diff --git a/ext/Storable/t/weak.t b/ext/Storable/t/weak.t index a8b708b..a2be7a1 100644 --- a/ext/Storable/t/weak.t +++ b/ext/Storable/t/weak.t @@ -7,13 +7,8 @@ # sub BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/Storable/t'); - } else { - # This lets us distribute Test::More in t/ - unshift @INC, 't'; - } + # This lets us distribute Test::More in t/ + unshift @INC, 't'; require Config; import Config; if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { print "1..0 # Skip: Storable was not built\n"; diff --git a/t/TEST b/t/TEST index 0231332..470d6f1 100755 --- a/t/TEST +++ b/t/TEST @@ -39,7 +39,6 @@ my %temp_no_core = '../ext/IPC-SysV' => 1, '../ext/MIME-Base64' => 1, '../ext/Safe' => 'fixme', - '../ext/Storable' => 'fixme', '../ext/Time-HiRes' => 1, '../ext/Unicode-Normalize' => 1, );