diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-02-21 11:29:27 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-02-21 11:29:27 +0000 |
commit | 2e13e92e859db8a9984d3791e0bc2d4de60ddd98 (patch) | |
tree | 7dfbf39e956a5262aebc454b94087291b87dc7e0 /t/run/runenv.t | |
parent | 62a1213a862266b141f7120a84c0757eda594f76 (diff) | |
download | perl-2e13e92e859db8a9984d3791e0bc2d4de60ddd98.tar.gz |
In runenv.t, don't automatically add -I../lib to the test program's arguments.
Instead, add -I../lib explicitly to the program's arguments when needed.
This makes the test pass with miniperl, and simplifies the later tests which
inspect the entirety of @INC.
miniperl will have been failing since 5e4c4c91bd52a48d, because it now loads
$INC[0]/buildcustomize.pl if present, resetting @INC, and always providing
-I../lib will cause it to find the buildcustomize.pl script.
Diffstat (limited to 't/run/runenv.t')
-rw-r--r-- | t/run/runenv.t | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/t/run/runenv.t b/t/run/runenv.t index 9af0b29e1c..b3e47a6e17 100644 --- a/t/run/runenv.t +++ b/t/run/runenv.t @@ -15,7 +15,7 @@ BEGIN { require './test.pl' } -plan tests => 98; +plan tests => 84; my $STDOUT = tempfile(); my $STDERR = tempfile(); @@ -31,7 +31,6 @@ delete $ENV{PERL5OPT}; sub runperl_and_capture { local *F; my ($env, $args) = @_; - unshift @$args, '-I../lib'; local %ENV = %ENV; delete $ENV{PERLLIB}; @@ -85,20 +84,20 @@ try({PERL5OPT => '-w'}, ['-e', 'print $::x'], "", qq{Name "main::x" used only once: possible typo at -e line 1.\nUse of uninitialized value \$x in print at -e line 1.\n}); -try({PERL5OPT => '-Mstrict'}, ['-e', 'print $::x'], +try({PERL5OPT => '-Mstrict'}, ['-I../lib', '-e', 'print $::x'], "", ""); -try({PERL5OPT => '-Mstrict'}, ['-e', 'print $x'], +try({PERL5OPT => '-Mstrict'}, ['-I../lib', '-e', 'print $x'], "", qq{Global symbol "\$x" requires explicit package name at -e line 1.\nExecution of -e aborted due to compilation errors.\n}); # Fails in 5.6.0 -try({PERL5OPT => '-Mstrict -w'}, ['-e', 'print $x'], +try({PERL5OPT => '-Mstrict -w'}, ['-I../lib', '-e', 'print $x'], "", qq{Global symbol "\$x" requires explicit package name at -e line 1.\nExecution of -e aborted due to compilation errors.\n}); # Fails in 5.6.0 -try({PERL5OPT => '-w -Mstrict'}, ['-e', 'print $::x'], +try({PERL5OPT => '-w -Mstrict'}, ['-I../lib', '-e', 'print $::x'], "", <<ERROR Name "main::x" used only once: possible typo at -e line 1. @@ -107,7 +106,7 @@ ERROR ); # Fails in 5.6.0 -try({PERL5OPT => '-w -Mstrict'}, ['-e', 'print $::x'], +try({PERL5OPT => '-w -Mstrict'}, ['-I../lib', '-e', 'print $::x'], "", <<ERROR Name "main::x" used only once: possible typo at -e line 1. @@ -115,17 +114,17 @@ Use of uninitialized value \$x in print at -e line 1. ERROR ); -try({PERL5OPT => '-MExporter'}, ['-e0'], +try({PERL5OPT => '-MExporter'}, ['-I../lib', '-e0'], "", ""); # Fails in 5.6.0 -try({PERL5OPT => '-MExporter -MExporter'}, ['-e0'], +try({PERL5OPT => '-MExporter -MExporter'}, ['-I../lib', '-e0'], "", ""); try({PERL5OPT => '-Mstrict -Mwarnings'}, - ['-e', 'print "ok" if $INC{"strict.pm"} and $INC{"warnings.pm"}'], + ['-I../lib', '-e', 'print "ok" if $INC{"strict.pm"} and $INC{"warnings.pm"}'], "ok", ""); @@ -155,7 +154,7 @@ try({PERL5OPT => '-t'}, ''); try({PERL5OPT => '-W'}, - ['-e', 'local $^W = 0; no warnings; print $x'], + ['-I../lib','-e', 'local $^W = 0; no warnings; print $x'], '', <<ERROR Name "main::x" used only once: possible typo at -e line 1. @@ -205,7 +204,7 @@ is ($err, '', 'No errors when determining @INC'); my @default_inc = split /\n/, $out; -is (shift @default_inc, '../lib', 'Our -I../lib is at the front'); +is ($default_inc[-1], '.', '. is last in @INC'); my $sep = $Config{path_sep}; foreach (['nothing', ''], @@ -233,8 +232,6 @@ foreach (['nothing', ''], my @inc = split /\n/, $out; - is (shift @inc, '../lib', 'Our -I../lib is at the front for $name'); - is (scalar @inc, scalar @expect, "expected number of elements in \@INC for $name"); |