Proto/Formatter.pm

filter: Statementstmt 66.6% 16 / 24 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 100% 2 / 2 totaltotal 62.1% 23 / 37 CC 3 SCAR 15.6
CC
3
Cov
57%
event
12.0
format
2.0
BEGIN
1.0
CRAP 4.8
« Proto/Formatter/TestBuilder.pm ↑ Summary Proto/TestRunner.pm »
1 package Test::Proto::Formatter;
2 2 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use base 'Test::Builder::Module';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 my $CLASS = __PACKAGE__;
8  
9 =pod
10  
11 =head1 NAME
12  
13 Test::Proto::Formatter - handles output, formatting of RunnerEvents.
14  
15 =head1 SYNOPSIS
16  
17 my $formatter = Test::Proto::Formatter->new();
18 $formatter->begin($testRunner); #? -> current_state?
19 $formatter->format($_) foreach @runnerEvents; # no, this doesn't look right
20 $formatter->end($testRunner);
21  
22 The formatter is only used by the L<Test::Proto::TestRunner> class. There is no reason to call it anywhere else. However, if you are writing a test script you might want to write your own formatter to give it to the TestRunner.
23  
24 This minimal formatter does precisely nothing.
25  
26 =head1 METHODS
27  
28 =cut
29  
30 =head3 event
31  
32 $formatter->event($runner, 'new');
33  
34 There are two supported events, 'new' and 'done'. The formatter reads the test runner to find out more.
35  
36 =cut
37  
38 0 ▶sub event {
Subroutine event: not called CC=3 SCAR=24.8
Pod documented
39 0 my $self = shift;
40 0 my $target = shift;
41 0 my $eventType = shift;
42 0 ▶ if ( 'new' eq $eventType ) {
Branch: 2 branches
BranchTrueFalseTotal
if ('new' eq $eventType) { } 0 0 0
elsif ('done' eq $eventType) { } 0 0 0
43  
44 # ...
45 }
46 elsif ( 'done' eq $eventType ) {
47  
48 # ...
49 }
50 0 return $self;
51 }
52  
53 =head3 format
54  
55 $formatter->format($runner);
56  
57 NOT YET IMPLEMENTED.
58  
59 =cut
60  
61 0 ▶sub format {
Subroutine format: not called CC=1 SCAR=6.9
Pod documented
62 0 my $self = shift;
63 0 my $target = shift;
64 0 return $self;
65 }
66  
67 2 1;
68  
69 =head1 OTHER INFORMATION
70  
71 For author, version, bug reports, support, etc, please see L<Test::Proto>.
72  
73 =cut
74  
« Proto/Formatter/TestBuilder.pm ↑ Summary Proto/TestRunner.pm »