diff options
Diffstat (limited to 'cpan/ExtUtils-MakeMaker/t')
-rw-r--r-- | cpan/ExtUtils-MakeMaker/t/03-xsstatic.t | 2 | ||||
-rw-r--r-- | cpan/ExtUtils-MakeMaker/t/MM_Cygwin.t | 2 | ||||
-rw-r--r-- | cpan/ExtUtils-MakeMaker/t/PL_FILES.t | 20 | ||||
-rw-r--r-- | cpan/ExtUtils-MakeMaker/t/basic.t | 8 | ||||
-rw-r--r-- | cpan/ExtUtils-MakeMaker/t/fixin.t | 34 | ||||
-rw-r--r-- | cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/BFD.pm | 3 | ||||
-rw-r--r-- | cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm | 2 | ||||
-rw-r--r-- | cpan/ExtUtils-MakeMaker/t/parse_version.t | 6 | ||||
-rw-r--r-- | cpan/ExtUtils-MakeMaker/t/unicode.t | 4 | ||||
-rw-r--r-- | cpan/ExtUtils-MakeMaker/t/vstrings.t | 2 |
10 files changed, 67 insertions, 16 deletions
diff --git a/cpan/ExtUtils-MakeMaker/t/03-xsstatic.t b/cpan/ExtUtils-MakeMaker/t/03-xsstatic.t index bfe3dc96c3..faf56e3339 100644 --- a/cpan/ExtUtils-MakeMaker/t/03-xsstatic.t +++ b/cpan/ExtUtils-MakeMaker/t/03-xsstatic.t @@ -20,7 +20,7 @@ plan skip_all => "ExtUtils::CBuilder not installed or couldn't find a compiler" unless have_compiler(); plan skip_all => 'Shared perl library' if $Config{useshrplib} eq 'true'; plan skip_all => $^O if $^O =~ m!^(MSWin32|cygwin|haiku|darwin)$!; -plan skip_all => 'Skipped when not PERL_CORE or in git repo' unless $ENV{PERL_CORE} or $release; +plan skip_all => 'Skipped when not PERL_CORE nor in git repo' unless $ENV{PERL_CORE} or $release; my @tests = list_static(); plan skip_all => "No tests" unless @tests; plan tests => 6 * @tests; diff --git a/cpan/ExtUtils-MakeMaker/t/MM_Cygwin.t b/cpan/ExtUtils-MakeMaker/t/MM_Cygwin.t index 4e7336c1ed..a37cb62765 100644 --- a/cpan/ExtUtils-MakeMaker/t/MM_Cygwin.t +++ b/cpan/ExtUtils-MakeMaker/t/MM_Cygwin.t @@ -80,7 +80,7 @@ like( $res, qr/manifypods.*foo.*foo.1/s, '... should add MAN3PODS targets' ); # init_linker { my $libperl = $Config{libperl} || 'libperl.a'; - $libperl =~ s/\.a/.dll.a/ if $] >= 5.006002; + $libperl =~ s/\.a/.dll.a/ if "$]" >= 5.006002; $libperl = "\$(PERL_INC)/$libperl"; my $export = ''; diff --git a/cpan/ExtUtils-MakeMaker/t/PL_FILES.t b/cpan/ExtUtils-MakeMaker/t/PL_FILES.t index 51aed5e5d0..7e627db543 100644 --- a/cpan/ExtUtils-MakeMaker/t/PL_FILES.t +++ b/cpan/ExtUtils-MakeMaker/t/PL_FILES.t @@ -13,7 +13,7 @@ use ExtUtils::MM; use Test::More !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'} ? (skip_all => "cross-compiling and make not available") - : (tests => 10); + : (tests => 12); use File::Spec; use File::Temp qw[tempdir]; use File::Path; @@ -36,6 +36,8 @@ WriteMakefile( NAME => 'PL::Module', PL_FILES => { 'single.PL' => 'single.out', 'multi.PL' => [qw(1.out 2.out)], + 'single-in.PL' => { 'single-in.out' => 'single.in' }, + 'multi-in.PL' => { 'multi-in.out' => [qw(1.in 2.in)] }, 'Bar_pm.PL' => '$(INST_LIB)/PL/Bar.pm', 'Bar2.pm.PL' => 'Bar2.pm', }, @@ -53,6 +55,11 @@ END 'multi.PL' => _gen_pl_files(), 'Bar_pm.PL' => _gen_pm_files(), 'Bar2.pm.PL' => _gen_pm_files(), + 'single-in.PL' => _gen_pm_files(1), + 'multi-in.PL' => _gen_pm_files(2), + 'single.in' => '', + '1.in' => '', + '2.in' => '', 'lib/PL/Foo.pm' => <<'END', # Module to load to ensure PL_FILES have blib in @INC. package PL::Foo; @@ -76,7 +83,11 @@ cmp_ok( $?, '==', 0 ); my $make_out = run("$make"); is( $?, 0 ) || diag $make_out; -foreach my $file (qw(single.out 1.out 2.out blib/lib/PL/Bar.pm blib/lib/PL/Bar2.pm)) { +foreach my $file (qw( + single.out 1.out 2.out + single-in.out multi-in.out + blib/lib/PL/Bar.pm blib/lib/PL/Bar2.pm +)) { ok( -e $file, "$file was created" ); } @@ -105,7 +116,8 @@ END } sub _gen_pm_files { - my $test = <<'END'; + my $inputs = (shift || 0) + 1; + my $test = sprintf <<'END', $inputs; #!/usr/bin/perl -w # Ensure we do NOT have blib in @INC when building a module @@ -114,7 +126,7 @@ eval { require PL::Foo; }; # Had a bug where PL_FILES weren't sent the file to generate die "argv empty\n" unless @ARGV; -die "too many in argv: @ARGV\n" unless @ARGV == 1; +die "wrong number in argv: @ARGV\n" unless @ARGV == %d; my $file = $ARGV[0]; open OUT, ">$file" or die $!; diff --git a/cpan/ExtUtils-MakeMaker/t/basic.t b/cpan/ExtUtils-MakeMaker/t/basic.t index 534bf219f6..7c87c75212 100644 --- a/cpan/ExtUtils-MakeMaker/t/basic.t +++ b/cpan/ExtUtils-MakeMaker/t/basic.t @@ -35,7 +35,11 @@ my $Is_VMS = $^O eq 'VMS'; my $OLD_CP; # crude but... my $w32worked; # or whether we had to fallback to chcp if ($^O eq "MSWin32") { - eval { require Win32; $w32worked = $OLD_CP = Win32::GetConsoleCP() }; + eval { + require Win32; + local $SIG{__WARN__} = sub {} if ( "$]" < 5.014 ); # suppress deprecation warning for inherited AUTOLOAD of Win32::GetConsoleCP() + $w32worked = $OLD_CP = Win32::GetConsoleCP(); + }; $OLD_CP = $1 if !$w32worked and qx(chcp) =~ /(\d+)$/ and $? == 0; if (defined $OLD_CP) { if ($w32worked) { @@ -128,7 +132,7 @@ like( $ppd_html, qr{^\s*<REQUIRE NAME="strict::" />}m, ' <REQUIRE>' ); unlike( $ppd_html, qr{^\s*<REQUIRE NAME="warnings::" />}m, 'no <REQUIRE> for build_require' ); my $archname = $Config{archname}; -if( $] >= 5.008 ) { +if( "$]" >= 5.008 ) { # XXX This is a copy of the internal logic, so it's not a great test $archname .= "-$Config{PERL_REVISION}.$Config{PERL_VERSION}"; } diff --git a/cpan/ExtUtils-MakeMaker/t/fixin.t b/cpan/ExtUtils-MakeMaker/t/fixin.t index 061e456247..6c6ada5619 100644 --- a/cpan/ExtUtils-MakeMaker/t/fixin.t +++ b/cpan/ExtUtils-MakeMaker/t/fixin.t @@ -9,7 +9,7 @@ BEGIN { use File::Spec; -use Test::More tests => 22; +use Test::More tests => 30; use Config; use TieOut; @@ -123,3 +123,35 @@ END } ); } + +SKIP: { + eval { chmod(0755, "usrbin/interp") } + or skip "no chmod", 8; + skip "Not relevant on VMS or MSWin32", 8 if $^O eq 'VMS' || $^O eq 'MSWin32'; + + my $dir = getcwd(); + local $ENV{PATH} = join $Config{path_sep}, map "$dir/$_", qw(usrbin bin); + + test_fixin(<<END, +#!$dir/bin/interp + +blah blah blah +END + sub { + is $_[0], "#!$dir/usrbin/interp\n", 'interpreter updated to one found in PATH'; + } + ); + + eval { symlink("../usrbin/interp", "bin/interp") } + or skip "no symlinks", 4; + + test_fixin(<<END, +#!$dir/bin/interp + +blah blah blah +END + sub { + is $_[0], "#!$dir/bin/interp\n", 'symlinked interpreter later in PATH not mangled'; + } + ); +} diff --git a/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/BFD.pm b/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/BFD.pm index 3d093fcfbd..cfe49e5465 100644 --- a/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/BFD.pm +++ b/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/BFD.pm @@ -54,6 +54,9 @@ program - this is a program 1; END + 'Big-Dummy/usrbin/interp' => <<'END', +This is a dummy interpreter +END 'Big-Dummy/test.pl' => <<'END', print "1..1\n"; diff --git a/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm b/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm index ce73b30b77..76c1ad5010 100644 --- a/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm +++ b/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm @@ -407,7 +407,7 @@ sub hash2files { $file = File::Spec->catfile(File::Spec->curdir, $prefix, split m{\/}, $file); my $dir = dirname($file); mkpath $dir; - my $utf8 = ($] < 5.008 or !$Config{useperlio}) ? "" : ":utf8"; + my $utf8 = ("$]" < 5.008 or !$Config{useperlio}) ? "" : ":utf8"; open(FILE, ">$utf8", $file) || die "Can't create $file: $!"; print FILE $text; close FILE; diff --git a/cpan/ExtUtils-MakeMaker/t/parse_version.t b/cpan/ExtUtils-MakeMaker/t/parse_version.t index 2dbd064c03..dc9919a551 100644 --- a/cpan/ExtUtils-MakeMaker/t/parse_version.t +++ b/cpan/ExtUtils-MakeMaker/t/parse_version.t @@ -53,7 +53,7 @@ if( $Has_Version ) { $versions{q[$VERSION = v1.2.3]} = 'v1.2.3'; } -if( $] >= 5.011001 ) { +if( "$]" >= 5.011001 ) { $versions{'package Foo 1.23;' } = '1.23'; $versions{'package Foo::Bar 1.23;' } = '1.23'; $versions{'package Foo v1.2.3;' } = 'v1.2.3'; @@ -81,7 +81,7 @@ our $VERSION = 2.34; END } -if( $] >= 5.014 ) { +if( "$]" >= 5.014 ) { $versions{'package Foo 1.23 { }' } = '1.23'; $versions{'package Foo::Bar 1.23 { }' } = '1.23'; $versions{'package Foo v1.2.3 { }' } = 'v1.2.3'; @@ -110,7 +110,7 @@ our $VERSION = 2.34; END } -if ( $] > 5.009 && $] < 5.012 ) { +if ( "$]" < 5.012 ) { delete $versions{'$VERSION = -1.0'}; } diff --git a/cpan/ExtUtils-MakeMaker/t/unicode.t b/cpan/ExtUtils-MakeMaker/t/unicode.t index 557ac77540..14a0c8501b 100644 --- a/cpan/ExtUtils-MakeMaker/t/unicode.t +++ b/cpan/ExtUtils-MakeMaker/t/unicode.t @@ -14,7 +14,7 @@ use File::Path; use utf8; BEGIN { plan skip_all => 'Need perlio and perl 5.8+.' - if $] < 5.008 or !$Config{useperlio}; + if "$]" < 5.008 or !$Config{useperlio}; plan skip_all => 'cross-compiling and make not available' if !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}; @@ -76,7 +76,7 @@ END { ok( chdir $DIRNAME, "chdir'd to $DIRNAME" ) || diag("chdir failed: $!"); -if ($] >= 5.008) { +if ("$]" >= 5.008) { eval { require ExtUtils::MakeMaker::Locale; }; note "ExtUtils::MakeMaker::Locale vars: $ExtUtils::MakeMaker::Locale::ENCODING_LOCALE;$ExtUtils::MakeMaker::Locale::ENCODING_LOCALE_FS;$ExtUtils::MakeMaker::Locale::ENCODING_CONSOLE_IN;$ExtUtils::MakeMaker::Locale::ENCODING_CONSOLE_OUT\n" unless $@; note "Locale env vars: " . join(';', map { diff --git a/cpan/ExtUtils-MakeMaker/t/vstrings.t b/cpan/ExtUtils-MakeMaker/t/vstrings.t index 9f88399ebd..63ef8e292b 100644 --- a/cpan/ExtUtils-MakeMaker/t/vstrings.t +++ b/cpan/ExtUtils-MakeMaker/t/vstrings.t @@ -93,7 +93,7 @@ sub run_test { local $_; SKIP: { skip "No vstring test <5.8", 2 - if $] < 5.008 && $pkg eq 'BareV2String' && $descrip =~ m!^2-part!; + if "$]" < 5.008 && $pkg eq 'BareV2String' && $descrip =~ m!^2-part!; my $warnings; eval { $warnings = capture_make("Fake::$pkg" => $version); }; is($@, '', "$descrip not fatal") or skip "$descrip WM failed", 1; |