]> git.vpit.fr Git - perl/modules/Lexical-Types.git/blobdiff - t/31-threads-teardown.t
Preserve the PATH environment variable when running a sub-perl on cygwin
[perl/modules/Lexical-Types.git] / t / 31-threads-teardown.t
index c15ebec106664732e45bbbd9836b68da01936e87..e636acde54985c275144c8563de2278ff29e6c98 100644 (file)
@@ -11,9 +11,10 @@ use Test::More 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;
 }