summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2017-02-05 00:31:51 +0000
committerafresh1 <afresh1@openbsd.org>2017-02-05 00:31:51 +0000
commitb8851fcc53cbe24fd20b090f26dd149e353f6174 (patch)
tree4b7c1695865f00ab7a0da30b5632d514848ea3a2 /gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib
parentAdd option PCIVERBOSE. (diff)
downloadwireguard-openbsd-b8851fcc53cbe24fd20b090f26dd149e353f6174.tar.xz
wireguard-openbsd-b8851fcc53cbe24fd20b090f26dd149e353f6174.zip
Fix merge issues, remove excess files - match perl-5.24.1 dist
Diffstat (limited to 'gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib')
-rw-r--r--gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/NoXS.pm9
-rw-r--r--gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/Unicode.pm90
-rw-r--r--gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/XS.pm11
-rw-r--r--gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm11
4 files changed, 113 insertions, 8 deletions
diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/NoXS.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/NoXS.pm
index 45faf7e2306..df36e82c217 100644
--- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/NoXS.pm
+++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/NoXS.pm
@@ -10,6 +10,15 @@ require XSLoader;
# Things like Cwd key on this to decide if they're running miniperl
delete $DynaLoader::{boot_DynaLoader};
+if ($^O eq 'MSWin32') {
+ require Win32;
+ my $GetCwd = *{'Win32::GetCwd'}{CODE};
+ my $SetChildShowWindow = *{'Win32::SetChildShowWindow'}{CODE};
+ %{*main::Win32::{HASH}} = ();
+ *{'Win32::GetCwd'} = $GetCwd;
+ *{'Win32::SetChildShowWindow'} = $SetChildShowWindow;
+}
+
# This isn't 100%. Things like Win32.pm will crap out rather than
# just not load. See ExtUtils::MM->_is_win95 for an example
no warnings 'redefine';
diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/Unicode.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/Unicode.pm
new file mode 100644
index 00000000000..76641f055cd
--- /dev/null
+++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/Unicode.pm
@@ -0,0 +1,90 @@
+package MakeMaker::Test::Setup::Unicode;
+
+@ISA = qw(Exporter);
+require Exporter;
+@EXPORT = qw(setup_recurs teardown_recurs);
+
+use strict;
+use File::Path;
+use File::Basename;
+use MakeMaker::Test::Utils;
+use utf8;
+use Config;
+
+my %Files = (
+ 'Problem-Module/Makefile.PL' => <<'PL_END',
+use ExtUtils::MakeMaker;
+use utf8;
+
+WriteMakefile(
+ NAME => 'Problem::Module',
+ ABSTRACT_FROM => 'lib/Problem/Module.pm',
+ AUTHOR => q{Danijel Tašov},
+ EXE_FILES => [ qw(bin/probscript) ],
+ INSTALLMAN1DIR => "some", # even if disabled in $Config{man1dir}
+ MAN1EXT => 1, # set to 0 if man pages disabled
+);
+PL_END
+
+ 'Problem-Module/lib/Problem/Module.pm' => <<'pm_END',
+use utf8;
+
+=pod
+
+=encoding utf8
+
+=head1 NAME
+
+Problem::Module - Danijel Tašov's great new module
+
+=cut
+
+1;
+pm_END
+
+ 'Problem-Module/bin/probscript' => <<'pl_END',
+#!/usr/bin/perl
+use utf8;
+
+=encoding utf8
+
+=head1 NAME
+
+文档 - Problem script
+pl_END
+);
+
+
+sub setup_recurs {
+ while(my($file, $text) = each %Files) {
+ # Convert to a relative, native file path.
+ $file = File::Spec->catfile(File::Spec->curdir, split m{\/}, $file);
+
+ my $dir = dirname($file);
+ mkpath $dir;
+ my $utf8 = ($] < 5.008 or !$Config{useperlio}) ? "" : ":utf8";
+ open(FILE, ">$utf8", $file) || die "Can't create $file: $!";
+ print FILE $text;
+ close FILE;
+
+ # ensure file at least 1 second old for makes that assume
+ # files with the same time are out of date.
+ my $time = calibrate_mtime();
+ utime $time, $time - 1, $file;
+ }
+
+ return 1;
+}
+
+sub teardown_recurs {
+ foreach my $file (keys %Files) {
+ my $dir = dirname($file);
+ if( -e $dir ) {
+ rmtree($dir) || return;
+ }
+ }
+ return 1;
+}
+
+
+1;
diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/XS.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/XS.pm
index f47da75e5e5..6ebca598342 100644
--- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/XS.pm
+++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/XS.pm
@@ -8,8 +8,11 @@ use strict;
use File::Path;
use File::Basename;
use MakeMaker::Test::Utils;
+use Config;
-my $Is_VMS = $^O eq 'VMS';
+use ExtUtils::MM;
+my $typemap = 'type map';
+$typemap =~ s/ //g unless MM->new({NAME=>'name'})->can_dep_space;
my %Files = (
'XS-Test/lib/XS/Test.pm' => <<'END',
@@ -27,15 +30,19 @@ bootstrap XS::Test $VERSION;
1;
END
- 'XS-Test/Makefile.PL' => <<'END',
+ 'XS-Test/Makefile.PL' => <<END,
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'XS::Test',
VERSION_FROM => 'lib/XS/Test.pm',
+ TYPEMAPS => [ '$typemap' ],
+ PERL => "\$^X -w",
);
END
+ "XS-Test/$typemap" => '',
+
'XS-Test/Test.xs' => <<'END',
#include "EXTERN.h"
#include "perl.h"
diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm
index 7d739277898..16d668895ee 100644
--- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm
+++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm
@@ -30,6 +30,7 @@ our @EXPORT = qw(which_perl perl_lib makefile_name makefile_backup
HARNESS_VERBOSE
PREFIX
MAKEFLAGS
+ PERL_INSTALL_QUIET
);
my %default_env_keys;
@@ -97,7 +98,7 @@ MakeMaker::Test::Utils - Utility routines for testing MakeMaker
=head1 DESCRIPTION
-A consolidation of little utility functions used through out the
+A consolidation of little utility functions used throughout the
MakeMaker test suite.
=head2 Functions
@@ -138,6 +139,7 @@ sub which_perl {
last if -x $perlpath;
}
}
+ $perlpath = qq{"$perlpath"}; # "safe... in a command line" even with spaces
return $perlpath;
}
@@ -213,7 +215,7 @@ sub make {
my $make = $Config{make};
$make = $ENV{MAKE} if exists $ENV{MAKE};
- return $make;
+ return $Is_VMS ? $make : qq{"$make"};
}
=item B<make_run>
@@ -304,10 +306,7 @@ sub run {
# Unix, modern Windows and OS/2 from 5.005_54 up can handle 2>&1
# This makes our failure diagnostics nicer to read.
- if( MM->os_flavor_is('Unix') or
- (MM->os_flavor_is('Win32') and !MM->os_flavor_is('Win9x')) or
- ($] > 5.00554 and MM->os_flavor_is('OS/2'))
- ) {
+ if (MM->can_redirect_error) {
return `$cmd 2>&1`;
}
else {