line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Run::Plugin::ColorFileVerdicts; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
2465196
|
use warnings; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
107
|
|
4
|
3
|
|
|
3
|
|
15
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
60
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
441
|
use MRO::Compat; |
|
3
|
|
|
|
|
1309
|
|
|
3
|
|
|
|
|
35
|
|
7
|
3
|
|
|
3
|
|
1850
|
use Term::ANSIColor; |
|
3
|
|
|
|
|
16815
|
|
|
3
|
|
|
|
|
222
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
649
|
use Moose; |
|
3
|
|
|
|
|
416504
|
|
|
3
|
|
|
|
|
21
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
extends('Test::Run::Plugin::ColorFileVerdicts::ColorBase'); |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
20839
|
use Test::Run::Plugin::ColorFileVerdicts::CanonFailedObj; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
293
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Test::Run::Plugin::ColorFileVerdicts - make the file verdict ("ok", "NOT OK") |
19
|
|
|
|
|
|
|
colorful. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 VERSION |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Version 0.0124 |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
our $VERSION = '0.0124'; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 SYNOPSIS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
package MyTestRun; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
use vars qw(@ISA); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
@ISA = (qw(Test::Run::Plugin::ColorFileVerdicts Test::Run::Obj)); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
my $tester = MyTestRun->new( |
38
|
|
|
|
|
|
|
{ |
39
|
|
|
|
|
|
|
test_files => |
40
|
|
|
|
|
|
|
[ |
41
|
|
|
|
|
|
|
"t/sample-tests/one-ok.t", |
42
|
|
|
|
|
|
|
"t/sample-tests/several-oks.t" |
43
|
|
|
|
|
|
|
], |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
$tester->runtests(); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 METHODS |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
has 'individual_test_file_verdict_colors' => |
56
|
|
|
|
|
|
|
(is => "rw", isa => "Maybe[HashRef]") |
57
|
|
|
|
|
|
|
; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub _report_all_ok_test |
60
|
|
|
|
|
|
|
{ |
61
|
7
|
|
|
7
|
|
1137075
|
my ($self, $args) = @_; |
62
|
|
|
|
|
|
|
|
63
|
7
|
|
|
|
|
159
|
my $test = $self->last_test_obj; |
64
|
7
|
|
|
|
|
207
|
my $elapsed = $self->last_test_elapsed; |
65
|
|
|
|
|
|
|
|
66
|
7
|
|
|
|
|
145
|
my $color = $self->_get_individual_test_file_color("success"); |
67
|
|
|
|
|
|
|
|
68
|
7
|
|
|
|
|
209
|
$self->output()->print_message($test->ml().color($color)."ok$elapsed".color("reset")); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub _get_dubious_verdict_message |
73
|
|
|
|
|
|
|
{ |
74
|
1
|
|
|
1
|
|
83506
|
my $self = shift; |
75
|
|
|
|
|
|
|
|
76
|
1
|
|
|
|
|
11
|
return color($self->_get_individual_test_file_color("dubious")) |
77
|
|
|
|
|
|
|
. $self->next::method() . |
78
|
|
|
|
|
|
|
color("reset"); |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub _get_canonfailed_params |
82
|
|
|
|
|
|
|
{ |
83
|
6
|
|
|
6
|
|
145335
|
my $self = shift; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
return |
86
|
|
|
|
|
|
|
[ |
87
|
6
|
|
|
|
|
17
|
@{$self->next::method()}, |
|
6
|
|
|
|
|
38
|
|
88
|
|
|
|
|
|
|
individual_test_file_verdict_colors => |
89
|
|
|
|
|
|
|
$self->individual_test_file_verdict_colors(), |
90
|
|
|
|
|
|
|
]; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 $self->private_canon_failed_obj_plugins() |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
A method that specifies the extra plugins for the CanonFailedObj helper |
96
|
|
|
|
|
|
|
object. Required by the pluggable helper semantics. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=cut |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub private_canon_failed_obj_plugins |
101
|
|
|
|
|
|
|
{ |
102
|
6
|
|
|
6
|
1
|
38291
|
my $self = shift; |
103
|
|
|
|
|
|
|
|
104
|
6
|
|
|
|
|
39
|
return [qw(Test::Run::Plugin::ColorFileVerdicts::CanonFailedObj)]; |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 AUTHOR |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Shlomi Fish, C<< <shlomif at cpan.org> >> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 BUGS |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
114
|
|
|
|
|
|
|
C<bug-test-run-plugin-colorfileverdicts at rt.cpan.org>, or through the web interface at |
115
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Run-Plugin-ColorFileVerdicts>. |
116
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
117
|
|
|
|
|
|
|
your bug as I make changes. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 SUPPORT |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
perldoc Test::Run::Plugin::ColorFileVerdicts |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
You can also look for information at: |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=over 4 |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
L<http://annocpan.org/dist/Test-Run-Plugin-ColorFileVerdicts> |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=item * CPAN Ratings |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
L<http://cpanratings.perl.org/d/Test-Run-Plugin-ColorFileVerdicts> |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Run-Plugin-ColorFileVerdicts> |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=item * MetaCPAN |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
L<http://metacpan.org/releaseTest-Run-Plugin-ColorFileVerdicts> |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=back |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
Copyright 2007 Shlomi Fish, all rights reserved. |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
This program is released under the following license: MIT X11 |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=cut |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
1; # End of Test::Run::Plugin::ColorFileVerdicts |