]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - t/41-threads-teardown.t
Preserve the PATH environment variable when running a sub-perl on cygwin
[perl/modules/indirect.git] / t / 41-threads-teardown.t
index 42d4ae8e282151cbc4eb40db6c8fea8c24067b99..9de009fb0ba33b458f07547d858b5a12bb4591e6 100644 (file)
@@ -11,9 +11,10 @@ use Test::Leaner tests => 1;
 sub run_perl {
  my $code = shift;
 
- my $SystemRoot   = $ENV{SystemRoot};
+ my ($SystemRoot, $PATH) = @ENV{qw<SystemRoot PATH>};
  local %ENV;
  $ENV{SystemRoot} = $SystemRoot if $^O eq 'MSWin32' and defined $SystemRoot;
+ $ENV{PATH}       = $PATH       if $^O eq 'cygwin'  and defined $PATH;
 
  system { $^X } $^X, '-T', map("-I$_", @INC), '-e', $code;
 }