Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I see that output from test was caught, and the $result is defined, but is_test and is_bailout are false. Probably that is OK. Also noticed that $spool is undef. I found that the value for that variable is configured via `PERL_TEST_HARNESS_DUMP_TAP` environment variable.
- /home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/5.30.3/TAP/Parser/Grammar.pm
- x296: for my $token_data ( @{ $self->{ordered_tokens} } ) {
- x297: if ( $line =~ $token_data->{syntax} ) {
- x298: my $handler = $token_data->{handler};
- x299: $token = $self->$handler($line);
- x300: last;
- 301: }
- 302: }
- 303:
- x304: $token = $self->_make_unknown_token($line) unless $token;
- 305:
- >>306: return $self->{parser}->make_result($token);
- 307: }
- DBG>$token
- {
- raw => Execution of t1.t aborted due to compilation errors.,
- type => unknown,
- }
- /home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/5.30.3/TAP/Parser.pm
- 1456: } # _has_callbacks
- 1457: else {
- 1458: return sub {
- x1459: my $result = eval { $grammar->tokenize };
- x1460: $self->_add_error($@) if $@;
- 1461:
- x1462: if ( defined $result ) {
- x1463: $result = $next_state->($result);
- 1464:
- 1465: # Echo TAP to spool file
- >>1466: print {$spool} $result->raw, "\n" if $spool;
- 1467: }
- 1468: else {
- x1469: $result = $end_handler->();
- 1470: }
- 1471:
- x1472: return $result;
- x1473: };
- 1474: } # no callbacks
- 1475: }
- DBG>$spool
- undef
- /home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/5.30.3/TAP/Harness.pm
- x608: my $mux = $self->_construct( $self->multiplexer_class );
- 609:
- 610: RESULT: {
- 611:
- 612: # Keep multiplexer topped up
- x613: FILL:
- x614: while ( $mux->parsers < $jobs ) {
- x615: my $job = $scheduler->get_job;
- 616:
- 617: # If we hit a spinner stop filling and start running.
- x618: last FILL if !defined $job || $job->is_spinner;
- 619:
- x620: my ( $parser, $session ) = $self->make_parser($job);
- x621: $mux->add( $parser, [ $session, $job ] );
- 622: }
- 623:
- x624: DB::x;
- x625: if ( my ( $parser, $stash, $result ) = $mux->next ) {
- x626: my ( $session, $job ) = @$stash;
- x627: if ( defined $result ) {
- 1>628: $session->result($result);
- x629: $self->_bailout($result) if $result->is_bailout;
- 630: }
- 631: else {
- 632:
- 633: # End of parser. Automatically removed from the mux.
- x634: $self->finish_parser( $parser, $session );
- x635: $self->_after_test( $aggregate, $job, $parser );
- x636: $job->finish;
- 637: }
- x638: redo RESULT;
- DBG>l 0
- /home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/5.30.3/TAP/Formatter/Console/ParallelSession.pm
- 118:
- 119: =cut
- 120:
- 121: sub result {
- x122: my ( $self, $result ) = @_;
- x123: my $formatter = $self->formatter;
- 124:
- 125: # my $really_quiet = $formatter->really_quiet;
- 126: # my $show_count = $self->_should_show_count;
- 127:
- >>128: if ( $result->is_test ) {
- x129: my $context = $shared{$formatter};
- x130: $context->{tests}++;
- 131:
- x132: my $active = $context->{active};
- x133: if ( @$active == 1 ) {
- 134:
- 135: # There is only one test, so use the serial output format.
- x136: return $self->SUPER::result($result);
- 137: }
- 138:
- x139: $self->_output_ruler( $self->parser->tests_run == 1 );
- 140: }
- x141: elsif ( $result->is_bailout ) {
- x142: $formatter->_failure_output(
- 143: "Bailout called. Further testing stopped: "
- 144: . $result->explanation
- 145: . "\n" );
- 146: }
- 147: }
- 148:
- DBG>$result
- TAP::Parser::Result::Unknown {
- raw => syntax error at t1.t line 1, at EOF,
- type => unknown,
- }
- DBG>$result->is_test
- DBG>$result->is_bailout
- ...
- /home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/5.30.3/TAP/Harness.pm
- x608: my $mux = $self->_construct( $self->multiplexer_class );
- 609:
- 610: RESULT: {
- 611:
- 612: # Keep multiplexer topped up
- x613: FILL:
- x614: while ( $mux->parsers < $jobs ) {
- x615: my $job = $scheduler->get_job;
- 616:
- 617: # If we hit a spinner stop filling and start running.
- x618: last FILL if !defined $job || $job->is_spinner;
- 619:
- x620: my ( $parser, $session ) = $self->make_parser($job);
- x621: $mux->add( $parser, [ $session, $job ] );
- 622: }
- 623:
- x624: DB::x;
- x625: if ( my ( $parser, $stash, $result ) = $mux->next ) {
- x626: my ( $session, $job ) = @$stash;
- x627: if ( defined $result ) {
- 1>628: $session->result($result);
- x629: $self->_bailout($result) if $result->is_bailout;
- 630: }
- 631: else {
- 632:
- 633: # End of parser. Automatically removed from the mux.
- x634: $self->finish_parser( $parser, $session );
- x635: $self->_after_test( $aggregate, $job, $parser );
- x636: $job->finish;
- 637: }
- x638: redo RESULT;
- DBG>l 0
- /home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/5.30.3/TAP/Formatter/Console/ParallelSession.pm
- 118:
- 119: =cut
- 120:
- 121: sub result {
- x122: my ( $self, $result ) = @_;
- x123: my $formatter = $self->formatter;
- 124:
- 125: # my $really_quiet = $formatter->really_quiet;
- 126: # my $show_count = $self->_should_show_count;
- 127:
- >>128: if ( $result->is_test ) {
- x129: my $context = $shared{$formatter};
- x130: $context->{tests}++;
- 131:
- x132: my $active = $context->{active};
- x133: if ( @$active == 1 ) {
- 134:
- 135: # There is only one test, so use the serial output format.
- x136: return $self->SUPER::result($result);
- 137: }
- 138:
- x139: $self->_output_ruler( $self->parser->tests_run == 1 );
- 140: }
- x141: elsif ( $result->is_bailout ) {
- x142: $formatter->_failure_output(
- 143: "Bailout called. Further testing stopped: "
- 144: . $result->explanation
- 145: . "\n" );
- 146: }
- 147: }
- 148:
- DBG>$result
- TAP::Parser::Result::Unknown {
- raw => Execution of t1.t aborted due to compilation errors.,
- type => unknown,
- }
- DBG>$result->is_test
- DBG>$result->is_bailout
- Both are false.
- /home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/5.30.3/TAP/Harness.pm
- x873: $session->close_test;
- x874: $self->_close_spool($parser);
- 875:
- x876: return $parser;
- 877: }
- 878:
- 879: sub _open_spool {
- x880: my $self = shift;
- x881: my $test = shift;
- 882:
- >>883: if ( my $spool_dir = $ENV{PERL_TEST_HARNESS_DUMP_TAP} ) {
- 884:
- x885: my $spool = File::Spec->catfile( $spool_dir, $test );
- 886:
- 887: # Make the directory
- x888: my ( $vol, $dir, undef ) = File::Spec->splitpath($spool);
- x889: my $path = File::Spec->catpath( $vol, $dir, '' );
- x890: eval { mkpath($path) };
- x891: $self->_croak($@) if $@;
- 892:
- x893: my $spool_handle = IO::Handle->new;
- x894: open( $spool_handle, ">$spool" )
- 895: or $self->_croak(" Can't write $spool ( $! ) ");
- 896:
- x897: return $spool_handle;
- 898: }
- 899:
- x900: return;
- 901: }
Advertisement
Add Comment
Please, Sign In to add comment