]> git.vpit.fr Git - perl/modules/VPIT-TestHelpers.git/blobdiff - lib/VPIT/TestHelpers.pm
Also disable the capture feature on OS/2
[perl/modules/VPIT-TestHelpers.git] / lib / VPIT / TestHelpers.pm
index bae97851cc47e8a8ac86eed95cc9e77f56db42d0..2396cade85c2812fbf0cadcf5c3a81e1b613adde 100644 (file)
@@ -288,11 +288,19 @@ Dependencies :
 
 =item -
 
-Not VMS
+Neither VMS nor OS/2
 
 =item -
 
-L<IO::Handle>, L<IO::Select>, L<IPC::Open3>
+L<IO::Handle>
+
+=item -
+
+L<IO::Select>
+
+=item -
+
+L<IPC::Open3>
 
 =item -
 
@@ -331,7 +339,8 @@ C<CAPTURE_PERL_FAILED $details> (possibly prefixed by C<$p>)
 sub init_capture {
  my $p = sanitize_prefix(shift);
 
- skip_all 'Cannot capture output on VMS' if $^O eq 'VMS';
+ skip_all 'Cannot capture output on VMS'  if $^O eq 'VMS';
+ skip_all 'Cannot capture output on OS/2' if $^O eq 'os2';
 
  load_or_skip_all 'IO::Handle', '0', [ ];
  load_or_skip_all 'IO::Select', '0', [ ];
@@ -476,6 +485,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 {