Ive written some tests that verify writing to STDOUT, etc, which were easy to do as `$X ... ` jobs.
but these dont get covered by default, so my coverage results are not what they should be.
I tried to do the following, but it didnt work out.
my @args = ($^X,
(defined %Devel::Cover::) ? '-MDevel::Cover' : undef,
'-e', $code, '>auto.stdout1', '2>auto.stderr1');
my $cmd = join ' ', @args;
qx{$cmd};
warn"$? returned-by $cmd\n" if $?;
ok (content_matches("auto.stdout1", qr/^\$foo = 'baz to stdout';$/),
"auto.stdout1 has expected content");
The results suggest that the embedded tests trump the outer ones, cuz the line-counts thru most of the module-report are 6, matching the number of embedded $^X tests.
Is there an easy way to do what Im trying ?
tia Jim Cromie