]> git.vpit.fr Git - perl/modules/VPIT-TestHelpers.git/blobdiff - lib/VPIT/TestHelpers.pm
Work around old IPC::Open3 reporting exceptions on STDERR
[perl/modules/VPIT-TestHelpers.git] / lib / VPIT / TestHelpers.pm
index 01aff874a8f7a8563554437cf3aee322870b405a..e8cfa710ea73aec55801f5f9fcdd03548cb8a3e8 100644 (file)
@@ -476,6 +476,15 @@ sub capture {
   1;
  };
 
+ if ("$]" < 5.014 and $ok and ($status >> 8) == 255 and defined $content_err
+                  and $content_err =~ /^open3/) {
+  # Before perl commit 8960aa87 (between 5.12 and 5.14), exceptions in open3
+  # could be reported to STDERR instead of being propagated, so work around
+  # this.
+  $ok = 0;
+  $@  = $content_err;
+ }
+
  if ($ok) {
   return ($status, $content_out, $content_err);
  } else {
@@ -568,10 +577,6 @@ L<threads> 1.67
 
 L<threads::shared> 1.14
 
-=item -
-
-L<Test::Leaner>
-
 =back
 
 =item *
@@ -633,8 +638,6 @@ sub init_threads {
  load_or_skip_all 'threads',         $force ? '0' : '1.67', [ ];
  load_or_skip_all 'threads::shared', $force ? '0' : '1.14', [ ];
 
- require Test::Leaner;
-
  diag "Threads testing forced by \$ENV{$force_var}" if $force;
 
  return spawn => \&spawn;