| 1 | package TAP::Formatter::Bamboo::Session; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use MooseX::NonMoose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | extends qw( | |||||||||||||||||||||||||||
| 6 | TAP::Formatter::Console::Session | ||||||||||||||||||||||||||||
| 7 | ); | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 1 | has '_output' => ( | |||||||||||||||||||||||||||
| 10 | is => 'rw', | ||||||||||||||||||||||||||||
| 11 | isa => 'Str', | ||||||||||||||||||||||||||||
| 12 | default => '', | ||||||||||||||||||||||||||||
| 13 | ); | ||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 0 | ▶ | sub _initialize { | ||||||||||||||||||||||||||
|
Subroutine
_initialize: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 16 | 0 | my ($self, $arg_for) = @_; | |||||||||||||||||||||||||||
| 17 | 0 | ▶ | $arg_for ||= {}; | ||||||||||||||||||||||||||
|
Condition0%0/2
$arg_for ||= {}
MC/DC0%0/1
$arg_for ||= {}
$arg_for
Truth table0%0/2
A
A= $arg_for
| |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 0 | return $self->SUPER::_initialize($arg_for); | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | sub result { | ||||||||||||||||||||||||||
|
Subroutine
result: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 23 | 0 | my ($self, $result) = @_; | |||||||||||||||||||||||||||
| 24 | 0 | $self->_output( $self->_output . $result->raw() . "\n" ); | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 0 | ▶ | sub close_test { | ||||||||||||||||||||||||||
|
Subroutine
close_test: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 28 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 29 | 0 | my $parser = $self->parser; | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 0 | my $results = { | |||||||||||||||||||||||||||
| 32 | description => $self->name, | ||||||||||||||||||||||||||||
| 33 | start_time => $parser->start_time, | ||||||||||||||||||||||||||||
| 34 | end_time => $parser->end_time, | ||||||||||||||||||||||||||||
| 35 | tests_run => $parser->tests_run, | ||||||||||||||||||||||||||||
| 36 | failed => scalar($parser->failed), | ||||||||||||||||||||||||||||
| 37 | parse_errors => scalar($parser->parse_errors), | ||||||||||||||||||||||||||||
| 38 | output => $self->_output, | ||||||||||||||||||||||||||||
| 39 | }; | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 0 | my @fail_reasons = _fail_reasons($parser); | |||||||||||||||||||||||||||
| 42 | 0 | ▶ | if(@fail_reasons) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | 0 | $results->{fail_reasons} = \@fail_reasons; | |||||||||||||||||||||||||||
| 44 | print STDERR "FAIL " . $self->name . "\n" . | ||||||||||||||||||||||||||||
| 45 | 0 | join("", map { " $_\n" } @fail_reasons); | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | else { | ||||||||||||||||||||||||||||
| 48 | 0 | print { $self->formatter->stdout } "PASS " . $self->name . "\n"; | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 0 | push(@{$self->formatter->_test_results}, $results); | |||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 0 | ▶ | sub _fail_reasons { | ||||||||||||||||||||||||||
|
Subroutine
_fail_reasons: not called CC=8 SCAR=42.8
| |||||||||||||||||||||||||||||
| 55 | 0 | my( $parser ) = @_; | |||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 0 | my @reasons = (); | |||||||||||||||||||||||||||
| 58 | 0 | ▶ | if( $parser->failed ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 59 | 0 | push(@reasons, "failed tests (" . join( ', ', $parser->failed ) . ")"); | |||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | 0 | ▶ | if( $parser->todo_passed ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 62 | 0 | push(@reasons, "unexpected TODO passed (" . join( ', ', $parser->todo_passed ) . ")"); | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | 0 | ▶ | if( $parser->parse_errors ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 65 | 0 | push(@reasons, "parse errors (" . join( ', ', $parser->parse_errors ) . ")"); | |||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||
| 67 | 0 | ▶ | if( !@reasons && $parser->exit != 0) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not @reasons and $parser->exit != 0
MC/DC0%0/2
not @reasons and $parser->exit != 0
not @reasons
$parser->exit != 0
Truth table0%0/3
not(A) and B
A= not @reasonsB= $parser->exit != 0
| |||||||||||||||||||||||||||||
| 68 | 0 | push(@reasons, "non-zero exit code (" . $parser->exit . ")"); | |||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | 0 | ▶ | if( !@reasons && $parser->has_problems ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not @reasons and $parser->has_problems
MC/DC0%0/2
not @reasons and $parser->has_problems
not @reasons
$parser->has_problems
Truth table0%0/3
not(A) and B
A= not @reasonsB= $parser->has_problems
| |||||||||||||||||||||||||||||
| 72 | 0 | push(@reasons, "unknown reason (probably some bug encountered)"); | |||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | 0 | return @reasons; | |||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | 1 | 1; | |||||||||||||||||||||||||||