| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Test::Run::Plugin::FailSummaryComponents; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
22408
|
use warnings; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
36
|
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
36
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
25
|
use 5.008; |
|
|
1
|
|
|
|
|
7
|
|
|
|
1
|
|
|
|
|
41
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
485
|
use Moose; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use MRO::Compat; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use Scalar::Util (); |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
extends ("Test::Run::Base"); |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Test::Run::Plugin::FailSummaryComponents - A Test::Run plugin that |
|
19
|
|
|
|
|
|
|
customizes the failure summary line. |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.0100_03'; |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my @params = (qw( |
|
26
|
|
|
|
|
|
|
failsumm_remove_test_scripts_number |
|
27
|
|
|
|
|
|
|
failsumm_remove_test_scripts_percent |
|
28
|
|
|
|
|
|
|
failsumm_remove_subtests_percent |
|
29
|
|
|
|
|
|
|
)); |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
has 'failsumm_remove_subtests_percent' => (is => "rw", isa => "Bool",); |
|
32
|
|
|
|
|
|
|
has 'failsumm_remove_test_scripts_number' => (is => "rw", isa => "Bool",); |
|
33
|
|
|
|
|
|
|
has 'failsumm_remove_test_scripts_percent' => (is => "rw", isa => "Bool",); |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
package MyTestRun; |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
use vars qw(@ISA); |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
@ISA = (qw(Test::Run::Plugin::FailSummaryComponents Test::Run::Obj)); |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my $tester = MyTestRun->new( |
|
46
|
|
|
|
|
|
|
test_files => |
|
47
|
|
|
|
|
|
|
[ |
|
48
|
|
|
|
|
|
|
"t/sample-tests/one-ok.t", |
|
49
|
|
|
|
|
|
|
"t/sample-tests/several-oks.t" |
|
50
|
|
|
|
|
|
|
], |
|
51
|
|
|
|
|
|
|
); |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$tester->runtests(); |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 EXTRA PARAMETERS TO NEW |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
We accept three new named parameters to the new constructor: |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 failsumm_remove_test_scripts_number |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
If set, removes the $N-out-of-$N test scripts number from the failure line. |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 failsumm_remove_test_scripts_percent |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
If set, removes the percent of the test scripts that failed. |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 failsumm_remove_subtests_percent |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
If set, removes the percent of the subtests that failed. |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub _get_fail_test_scripts_string |
|
74
|
|
|
|
|
|
|
{ |
|
75
|
|
|
|
|
|
|
my $self = shift; |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
if ($self->failsumm_remove_test_scripts_number()) |
|
78
|
|
|
|
|
|
|
{ |
|
79
|
|
|
|
|
|
|
return "test scripts"; |
|
80
|
|
|
|
|
|
|
} |
|
81
|
|
|
|
|
|
|
else |
|
82
|
|
|
|
|
|
|
{ |
|
83
|
|
|
|
|
|
|
return $self->next::method(); |
|
84
|
|
|
|
|
|
|
} |
|
85
|
|
|
|
|
|
|
} |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub _get_fail_tests_good_percent_string |
|
88
|
|
|
|
|
|
|
{ |
|
89
|
|
|
|
|
|
|
my $self = shift; |
|
90
|
|
|
|
|
|
|
if ($self->failsumm_remove_test_scripts_percent()) |
|
91
|
|
|
|
|
|
|
{ |
|
92
|
|
|
|
|
|
|
return ""; |
|
93
|
|
|
|
|
|
|
} |
|
94
|
|
|
|
|
|
|
else |
|
95
|
|
|
|
|
|
|
{ |
|
96
|
|
|
|
|
|
|
return $self->next::method(); |
|
97
|
|
|
|
|
|
|
} |
|
98
|
|
|
|
|
|
|
} |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub _get_sub_percent_msg |
|
101
|
|
|
|
|
|
|
{ |
|
102
|
|
|
|
|
|
|
my $self = shift; |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
if (!$self->failsumm_remove_subtests_percent()) |
|
105
|
|
|
|
|
|
|
{ |
|
106
|
|
|
|
|
|
|
return $self->next::method(); |
|
107
|
|
|
|
|
|
|
} |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
my $tot = $self->tot(); |
|
110
|
|
|
|
|
|
|
return sprintf(" %d/%d subtests failed.", |
|
111
|
|
|
|
|
|
|
$tot->max() - $tot->ok(), $tot->max(), |
|
112
|
|
|
|
|
|
|
); |
|
113
|
|
|
|
|
|
|
} |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 AUTHOR |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Shlomi Fish, C<< <shlomif@iglu.org.il> >> |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 BUGS |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
|
123
|
|
|
|
|
|
|
C<bug-test-run-plugin-failsummarycomponents@rt.cpan.org>, or through the web interface at |
|
124
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Run-Plugin-FailSummaryComponents>. |
|
125
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
|
126
|
|
|
|
|
|
|
your bug as I make changes. |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
L<Test::Run::Obj>, L<Test::Run::CmdLine::Plugin::FailSummaryComponents>. |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Copyright 2006 Shlomi Fish, all rights reserved. |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
This program is released under the MIT X11 License. |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=cut |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
1; |