]> git.vpit.fr Git - perl/modules/autovivification.git/blobdiff - t/51-threads-teardown.t
Preserve the PATH environment variable when running a sub-perl on cygwin
[perl/modules/autovivification.git] / t / 51-threads-teardown.t
index a688df8e8a92d3a1fc42278755438da9d96eaa85..862717d7dffd7e44278eb7ad96d3e8ee1757f4dc 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;
 }