summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm')
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm24
1 files changed, 17 insertions, 7 deletions
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm
index 6dc4c8627a4..0df382fc6aa 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm
@@ -12,6 +12,7 @@ use File::Path ();
BEGIN {
# Environment variables which might effect our testing
my @delete_env_keys = qw(
+ HOME
DEVEL_COVER_OPTIONS
MODULEBUILDRC
PERL_MB_OPT
@@ -54,12 +55,10 @@ BEGIN {
my $t_lib = File::Spec->catdir('t', 'bundled');
push @INC, $t_lib; # Let user's installed version override
- if ($ENV{PERL_CORE}) {
- # We change directories, so expand @INC and $^X to absolute paths
- # Also add .
- @INC = (map(File::Spec->rel2abs($_), @INC), ".");
- $^X = File::Spec->rel2abs($^X);
- }
+ # We change directories, so expand @INC and $^X to absolute paths
+ # Also add .
+ @INC = (map(File::Spec->rel2abs($_), @INC), ".");
+ $^X = File::Spec->rel2abs($^X);
}
use Exporter;
@@ -96,7 +95,11 @@ __PACKAGE__->export(scalar caller, @extra_exports);
# always return to the current directory
{
- my $cwd = File::Spec->rel2abs(Cwd::cwd);
+ my $cwd;
+ # must be done in BEGIN because tmpdir uses it in BEGIN for $ENV{HOME}
+ BEGIN {
+ $cwd = File::Spec->rel2abs(Cwd::cwd);
+ }
sub original_cwd { return $cwd }
@@ -123,6 +126,10 @@ sub tmpdir {
return File::Temp::tempdir('MB-XXXXXXXX', CLEANUP => 1, DIR => $dir, @args);
}
+BEGIN {
+ $ENV{HOME} = tmpdir; # don't want .modulebuildrc or other things interfering
+}
+
sub save_handle {
my ($handle, $subr) = @_;
my $outfile = File::Spec->catfile(File::Spec->tmpdir, temp_file_name());
@@ -201,6 +208,9 @@ sub check_compiler {
my $have_c_compiler;
stderr_of( sub {$have_c_compiler = $mb->have_c_compiler} );
+ # XXX link_executable() is not yet implemented for Windows
+ # and noexec tmpdir is irrelevant on Windows
+ return ($have_c_compiler, 1) if $^O eq "MSWin32";
# check noexec tmpdir
my $tmp_exec;