Subject: | calling Devel::Cover::report on exec() |
It may be a matter of opinion whether this is actually a bug...
Starting with version 0.63, Devel::Cover calls Devel::Cover::report
automatically when a process does an exec. (See line 1135 of Cover.xs
version 0.63.) This means that information about coverage will appear
in the process's standard output. Because of this, it's easy to
construct code that runs differently under Devel::Cover than on its own;
I attach an example. (The real problem, of course, is unit tests that
pass when run normally but fail under Devel::Cover.)
I infer that this behavior is deliberate, so maybe it doesn't constitute
a bug, but I would prefer if it were removed or at least made optional.
Maybe I could:
use Devel::Cover 'silent'
or something similar?
Subject: | test.pl |
#! /usr/bin/perl
use strict;
use warnings;
use IO::Pipe;
my $pipe = new IO::Pipe;
defined(my $pid = fork) or die $!;
if ($pid) {
$pipe->reader;
print "Output is: ***\n";
print '* ', $_ for <$pipe>;
print "***\n";
close $pipe or die $!;
waitpid $pid, 0;
} else {
$pipe->writer;
open STDOUT, '>&', $pipe or die $!;
exec 'date';
}