From: Nicholas Clark Date: Sun, 30 Aug 2009 12:42:44 +0000 (+0100) Subject: Remove the $ENV{PERL_CORE} boilerplate from B's tests. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=74517a3a4d32901662e188ad8c7a66d4500d3ff3;p=p5sagit%2Fp5-mst-13.2.git Remove the $ENV{PERL_CORE} boilerplate from B's tests. --- diff --git a/ext/B/t/b.t b/ext/B/t/b.t index 96d8ee6..f0211bd 100644 --- a/ext/B/t/b.t +++ b/ext/B/t/b.t @@ -1,17 +1,7 @@ #!./perl BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - if ($^O eq 'MacOS') { - @INC = qw(: ::lib ::macos:lib); - } else { - @INC = '.'; - push @INC, '../lib'; - } - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/concise-xs.t b/ext/B/t/concise-xs.t index b849af5..b50cbb2 100644 --- a/ext/B/t/concise-xs.t +++ b/ext/B/t/concise-xs.t @@ -95,13 +95,7 @@ Looking at ../foo2, you'll see 34 occurrences of the following error: =cut BEGIN { - if ($ENV{PERL_CORE}) { - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - push @INC, "../../t"; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/concise.t b/ext/B/t/concise.t index 5cd5543..3eb22ce 100644 --- a/ext/B/t/concise.t +++ b/ext/B/t/concise.t @@ -1,13 +1,7 @@ #!./perl BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - push @INC, "../../t"; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/f_map.t b/ext/B/t/f_map.t index 420e649..11877ef 100644 --- a/ext/B/t/f_map.t +++ b/ext/B/t/f_map.t @@ -1,13 +1,7 @@ #!perl BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/B/t'); - } else { - unshift @INC, 't'; - push @INC, "../../t"; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/f_sort.t b/ext/B/t/f_sort.t index 4117298e..6a36fcb 100644 --- a/ext/B/t/f_sort.t +++ b/ext/B/t/f_sort.t @@ -1,13 +1,7 @@ #!perl BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/B/t'); - } else { - unshift @INC, 't'; - push @INC, "../../t"; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/o.t b/ext/B/t/o.t index 2b84f39..f1c8ae3 100644 --- a/ext/B/t/o.t +++ b/ext/B/t/o.t @@ -1,13 +1,7 @@ #!./perl -w BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', 'lib', '../lib'); - } else { - unshift @INC, 't'; - push @INC, "../../t"; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/optree_check.t b/ext/B/t/optree_check.t index a099295..1629677 100644 --- a/ext/B/t/optree_check.t +++ b/ext/B/t/optree_check.t @@ -1,13 +1,7 @@ #!perl BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/B/t'); - } else { - unshift @INC, 't'; - push @INC, "../../t"; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/optree_concise.t b/ext/B/t/optree_concise.t index 3191447..00a7849 100644 --- a/ext/B/t/optree_concise.t +++ b/ext/B/t/optree_concise.t @@ -1,13 +1,7 @@ #!perl BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/B/t'); - } else { - unshift @INC, 't'; - push @INC, "../../t"; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/optree_constants.t b/ext/B/t/optree_constants.t index bf6384b..47afea4 100644 --- a/ext/B/t/optree_constants.t +++ b/ext/B/t/optree_constants.t @@ -1,13 +1,7 @@ #!perl BEGIN { - if ($ENV{PERL_CORE}) { - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/B/t'); - } else { - unshift @INC, 't'; - push @INC, "../../t"; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/optree_misc.t b/ext/B/t/optree_misc.t index bcb0f2e..7a8f25a 100644 --- a/ext/B/t/optree_misc.t +++ b/ext/B/t/optree_misc.t @@ -1,13 +1,7 @@ #!perl BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/B/t'); - } else { - unshift @INC, 't'; - push @INC, "../../t"; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/optree_samples.t b/ext/B/t/optree_samples.t index 5e9d1db..065fcad 100644 --- a/ext/B/t/optree_samples.t +++ b/ext/B/t/optree_samples.t @@ -1,13 +1,7 @@ #!perl BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/B/t'); - } else { - unshift @INC, 't'; - push @INC, "../../t"; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/optree_sort.t b/ext/B/t/optree_sort.t index 0a5047e..e4dd416 100644 --- a/ext/B/t/optree_sort.t +++ b/ext/B/t/optree_sort.t @@ -1,13 +1,7 @@ #!perl BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/B/t'); - } else { - unshift @INC, 't'; - push @INC, "../../t"; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/optree_specials.t b/ext/B/t/optree_specials.t index c5aba7b..1f81323 100644 --- a/ext/B/t/optree_specials.t +++ b/ext/B/t/optree_specials.t @@ -8,13 +8,7 @@ # spaces. BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/B/t'); - } else { - unshift @INC, 't'; - push @INC, "../../t"; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/optree_varinit.t b/ext/B/t/optree_varinit.t index 5c8f619..f748ab8 100644 --- a/ext/B/t/optree_varinit.t +++ b/ext/B/t/optree_varinit.t @@ -1,13 +1,7 @@ #!perl BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib', '../ext/B/t'); - } else { - unshift @INC, 't'; - push @INC, "../../t"; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/pragma.t b/ext/B/t/pragma.t index 2278cc1..2ed390d 100644 --- a/ext/B/t/pragma.t +++ b/ext/B/t/pragma.t @@ -2,12 +2,9 @@ BEGIN { ## no critic strict if ( $ENV{PERL_CORE} ) { - chdir('t') if -d 't'; - @INC = qw(../lib . lib); - } - else { - unshift @INC, '../../t/lib'; # FIXME when PERL_CORE works again - # unshift @INC, 't'; + unshift @INC, '../../t/lib'; + } else { + unshift @INC, 't'; } require Config; if ( ( $Config::Config{'extensions'} !~ /\bB\b/ ) ) { diff --git a/ext/B/t/showlex.t b/ext/B/t/showlex.t index 3cb28da..257b9c9 100644 --- a/ext/B/t/showlex.t +++ b/ext/B/t/showlex.t @@ -1,18 +1,7 @@ #!./perl BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - if ($^O eq 'MacOS') { - @INC = qw(: ::lib ::macos:lib); - } else { - @INC = '.'; - push @INC, '../lib'; - } - } else { - unshift @INC, 't'; - push @INC, "../../t"; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/terse.t b/ext/B/t/terse.t index 8d86a49..7c1d396 100644 --- a/ext/B/t/terse.t +++ b/ext/B/t/terse.t @@ -1,12 +1,7 @@ #!./perl BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/ext/B/t/xref.t b/ext/B/t/xref.t index 450582b..5d9cb38 100644 --- a/ext/B/t/xref.t +++ b/ext/B/t/xref.t @@ -1,12 +1,7 @@ #!./perl BEGIN { - if ($ENV{PERL_CORE}){ - chdir('t') if -d 't'; - @INC = ('.', '../lib'); - } else { - unshift @INC, 't'; - } + unshift @INC, 't'; require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; diff --git a/t/TEST b/t/TEST index 1a8e835..b43c9f1 100755 --- a/t/TEST +++ b/t/TEST @@ -25,7 +25,6 @@ my %dir_to_switch = my %temp_no_core = ('../ext/Attribute-Handlers' => 1, - '../ext/B' => 'fixme', '../ext/B-Debug' => 1, '../ext/Compress-Raw-Bzip2' => 1, '../ext/Compress-Raw-Zlib' => 1,