use TAPx::Parser::Source::Perl;
my $source = TAPx::Parser::Source::Perl->new;
my $file = 't/00-load.t';
my $stream = $source->filename($file)->get_stream;
while ( defined( my $line = $stream->next ) ) {
print "$line\n";
}
####
sub get_stream {
my ( $self ) = @_;
my $command = $self->_get_command;
local *FH;
# -| is safer, but not portable.
if ( open FH, "$command |" ) {
return TAPx::Parser::Iterator->new(\*FH);
}
else {
$self->error("Could not execute ($command): $!");
return;
}
}
####
% perl -Ilib examples/tprove2 t/00-load.t
Can't dup STDOUT: Bad file descriptor at /usr/local/lib/perl5/5.8.7/Test/Builder.pm line 1322.
Compilation failed in require at /usr/local/lib/perl5/5.8.7/Test/Builder/Module.pm line 3.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.8.7/Test/Builder/Module.pm line 3.
Compilation failed in require at /usr/local/lib/perl5/5.8.7/Test/More.pm line 22.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.8.7/Test/More.pm line 22.
Compilation failed in require at t/00-load.t line 3.
BEGIN failed--compilation aborted at t/00-load.t line 3.
...