line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Proto::Formatter; |
2
|
2
|
|
|
2
|
|
21444
|
use 5.008; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
64
|
|
3
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
49
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
51
|
|
5
|
2
|
|
|
2
|
|
772
|
use Moo; |
|
2
|
|
|
|
|
15350
|
|
|
2
|
|
|
|
|
10
|
|
6
|
2
|
|
|
2
|
|
1766
|
use base 'Test::Builder::Module'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
311
|
|
7
|
|
|
|
|
|
|
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 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
|
|
|
|
|
|
|
sub event { |
39
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
40
|
0
|
|
|
|
|
|
my $target = shift; |
41
|
0
|
|
|
|
|
|
my $eventType = shift; |
42
|
0
|
0
|
|
|
|
|
if ( 'new' eq $eventType ) { |
|
|
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
|
|
|
|
|
|
|
sub format { |
62
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
63
|
0
|
|
|
|
|
|
my $target = shift; |
64
|
0
|
|
|
|
|
|
return $self; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 OTHER INFORMATION |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
For author, version, bug reports, support, etc, please see L. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|