line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Run::Core; |
2
|
|
|
|
|
|
|
|
3
|
14
|
|
|
14
|
|
7899
|
use strict; |
|
14
|
|
|
|
|
32
|
|
|
14
|
|
|
|
|
352
|
|
4
|
14
|
|
|
14
|
|
58
|
use warnings; |
|
14
|
|
|
|
|
23
|
|
|
14
|
|
|
|
|
358
|
|
5
|
|
|
|
|
|
|
|
6
|
14
|
|
|
14
|
|
4035
|
use Moose; |
|
14
|
|
|
|
|
3582358
|
|
|
14
|
|
|
|
|
101
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends('Test::Run::Base::PlugHelpers'); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
14
|
|
|
14
|
|
91306
|
use vars qw($VERSION); |
|
14
|
|
|
|
|
32
|
|
|
14
|
|
|
|
|
658
|
|
12
|
|
|
|
|
|
|
|
13
|
14
|
|
|
14
|
|
78
|
use MRO::Compat; |
|
14
|
|
|
|
|
24
|
|
|
14
|
|
|
|
|
372
|
|
14
|
|
|
|
|
|
|
|
15
|
14
|
|
|
14
|
|
8661
|
use List::MoreUtils (); |
|
14
|
|
|
|
|
156089
|
|
|
14
|
|
|
|
|
444
|
|
16
|
|
|
|
|
|
|
|
17
|
14
|
|
|
14
|
|
8445
|
use Fatal qw(opendir); |
|
14
|
|
|
|
|
173308
|
|
|
14
|
|
|
|
|
92
|
|
18
|
|
|
|
|
|
|
|
19
|
14
|
|
|
14
|
|
13641
|
use Time::HiRes (); |
|
14
|
|
|
|
|
17224
|
|
|
14
|
|
|
|
|
354
|
|
20
|
14
|
|
|
14
|
|
95
|
use List::Util (); |
|
14
|
|
|
|
|
107
|
|
|
14
|
|
|
|
|
270
|
|
21
|
|
|
|
|
|
|
|
22
|
14
|
|
|
14
|
|
72
|
use File::Spec; |
|
14
|
|
|
|
|
22
|
|
|
14
|
|
|
|
|
423
|
|
23
|
|
|
|
|
|
|
|
24
|
14
|
|
|
14
|
|
5898
|
use Test::Run::Assert qw/ assert /; |
|
14
|
|
|
|
|
33
|
|
|
14
|
|
|
|
|
849
|
|
25
|
14
|
|
|
14
|
|
5327
|
use Test::Run::Obj::Error (); |
|
14
|
|
|
|
|
45
|
|
|
14
|
|
|
|
|
450
|
|
26
|
14
|
|
|
14
|
|
7257
|
use Test::Run::Straps (); |
|
14
|
|
|
|
|
51
|
|
|
14
|
|
|
|
|
486
|
|
27
|
14
|
|
|
14
|
|
7072
|
use Test::Run::Obj::IntOrUnknown (); |
|
14
|
|
|
|
|
49
|
|
|
14
|
|
|
|
|
89393
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Test::Run::Core - Base class to run standard TAP scripts. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 VERSION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Version 0.0305 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
$VERSION = '0.0305'; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
$ENV{HARNESS_ACTIVE} = 1; |
42
|
|
|
|
|
|
|
$ENV{HARNESS_NG_VERSION} = $VERSION; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
END |
45
|
|
|
|
|
|
|
{ |
46
|
|
|
|
|
|
|
# For VMS. |
47
|
14
|
|
|
14
|
|
19957
|
delete $ENV{HARNESS_ACTIVE}; |
48
|
14
|
|
|
|
|
293
|
delete $ENV{HARNESS_NG_VERSION}; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
has "_bonusmsg" => (is => "rw", isa => "Str"); |
52
|
|
|
|
|
|
|
has "dir_files" => (is => "rw", isa => "ArrayRef", lazy => 1, |
53
|
|
|
|
|
|
|
default => sub { [] }, |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
has "_new_dir_files" => (is => "rw", isa => "Maybe[ArrayRef]"); |
56
|
|
|
|
|
|
|
has "failed_tests" => (is => "rw", isa => "HashRef"); |
57
|
|
|
|
|
|
|
has "format_columns" => (is => "rw", isa => "Num"); |
58
|
|
|
|
|
|
|
has "last_test_elapsed" => (is => "rw", isa => "Str"); |
59
|
|
|
|
|
|
|
has "last_test_obj" => (is => "rw", isa => "Test::Run::Obj::TestObj"); |
60
|
|
|
|
|
|
|
has "last_test_results" => (is => "rw", isa => "Test::Run::Straps::StrapsTotalsObj"); |
61
|
|
|
|
|
|
|
has "list_len" => (is => "rw", isa => "Num", default => 0); |
62
|
|
|
|
|
|
|
has "max_namelen" => (is => "rw", isa => "Num"); |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# I don't know for sure what output is. It is Test::Run::Output in |
65
|
|
|
|
|
|
|
# Test::Run::Plugin::CmdLine::Output but could be different elsewhere. |
66
|
|
|
|
|
|
|
has "output" => (is => "rw", isa => "Ref"); |
67
|
|
|
|
|
|
|
has "_start_time" => (is => "rw", isa => "Num"); |
68
|
|
|
|
|
|
|
has "Strap" => (is => "rw", isa => "Test::Run::Straps", |
69
|
|
|
|
|
|
|
lazy => 1, builder => "_get_new_strap" |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
has "tot" => (is => "rw", isa => "Test::Run::Obj::TotObj"); |
72
|
|
|
|
|
|
|
has "width" => (is => "rw", isa => "Num"); |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# Private Simple Params of _get_private_simple_params |
75
|
|
|
|
|
|
|
has "Columns" => (is => "rw", isa => "Num", default => "80"); |
76
|
|
|
|
|
|
|
has "Debug" => (is => "rw", isa => "Bool"); |
77
|
|
|
|
|
|
|
has "Leaked_Dir" => (is => "rw", isa => "Str"); |
78
|
|
|
|
|
|
|
has "NoTty" => (is => "rw", isa => "Bool"); |
79
|
|
|
|
|
|
|
has "Switches" => (is => "rw", isa => "Maybe[Str]", default => "-w",); |
80
|
|
|
|
|
|
|
has "Switches_Env" => (is => "rw", isa => "Maybe[Str]"); |
81
|
|
|
|
|
|
|
has "test_files" => (is => "rw", isa => "ArrayRef"); |
82
|
|
|
|
|
|
|
has "test_files_data" => (is => "rw", isa => "HashRef", |
83
|
|
|
|
|
|
|
default => sub { +{} }, |
84
|
|
|
|
|
|
|
); |
85
|
|
|
|
|
|
|
has "Test_Interpreter" => (is => "rw", isa => "Maybe[Str]"); |
86
|
|
|
|
|
|
|
has "Timer" => (is => "rw", isa => "Bool"); |
87
|
|
|
|
|
|
|
has "Verbose" => (is => "rw", isa => "Bool"); |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub _get_new_strap |
90
|
|
|
|
|
|
|
{ |
91
|
52
|
|
|
52
|
|
111
|
my $self = shift; |
92
|
|
|
|
|
|
|
|
93
|
52
|
|
|
|
|
353
|
return $self->create_pluggable_helper_obj( |
94
|
|
|
|
|
|
|
{ |
95
|
|
|
|
|
|
|
id => "straps", |
96
|
|
|
|
|
|
|
args => {}, |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
); |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head2 BUILD |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
For Moose. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=cut |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub BUILD |
108
|
|
|
|
|
|
|
{ |
109
|
52
|
|
|
52
|
1
|
156653
|
my $self = shift; |
110
|
|
|
|
|
|
|
|
111
|
52
|
|
|
|
|
579
|
$self->register_pluggable_helper( |
112
|
|
|
|
|
|
|
{ |
113
|
|
|
|
|
|
|
id => "straps", |
114
|
|
|
|
|
|
|
base => "Test::Run::Straps", |
115
|
|
|
|
|
|
|
collect_plugins_method => "private_straps_plugins", |
116
|
|
|
|
|
|
|
}, |
117
|
|
|
|
|
|
|
); |
118
|
|
|
|
|
|
|
|
119
|
52
|
|
|
|
|
338
|
$self->register_pluggable_helper( |
120
|
|
|
|
|
|
|
{ |
121
|
|
|
|
|
|
|
id => "failed", |
122
|
|
|
|
|
|
|
base => "Test::Run::Obj::FailedObj", |
123
|
|
|
|
|
|
|
collect_plugins_method => "private_failed_obj_plugins", |
124
|
|
|
|
|
|
|
}, |
125
|
|
|
|
|
|
|
); |
126
|
|
|
|
|
|
|
|
127
|
52
|
|
|
|
|
315
|
$self->register_pluggable_helper( |
128
|
|
|
|
|
|
|
{ |
129
|
|
|
|
|
|
|
id => "test", |
130
|
|
|
|
|
|
|
base => "Test::Run::Obj::TestObj", |
131
|
|
|
|
|
|
|
collect_plugins_method => "private_test_obj_plugins", |
132
|
|
|
|
|
|
|
}, |
133
|
|
|
|
|
|
|
); |
134
|
|
|
|
|
|
|
|
135
|
52
|
|
|
|
|
276
|
$self->register_pluggable_helper( |
136
|
|
|
|
|
|
|
{ |
137
|
|
|
|
|
|
|
id => "tot", |
138
|
|
|
|
|
|
|
base => "Test::Run::Obj::TotObj", |
139
|
|
|
|
|
|
|
collect_plugins_method => "private_tot_obj_plugins", |
140
|
|
|
|
|
|
|
}, |
141
|
|
|
|
|
|
|
); |
142
|
|
|
|
|
|
|
|
143
|
52
|
|
|
|
|
325
|
$self->register_pluggable_helper( |
144
|
|
|
|
|
|
|
{ |
145
|
|
|
|
|
|
|
id => "canon_failed", |
146
|
|
|
|
|
|
|
base => "Test::Run::Obj::CanonFailedObj", |
147
|
|
|
|
|
|
|
collect_plugins_method => "private_canon_failed_obj_plugins", |
148
|
|
|
|
|
|
|
}, |
149
|
|
|
|
|
|
|
); |
150
|
|
|
|
|
|
|
|
151
|
52
|
|
|
|
|
443
|
$self->_register_obj_formatter( |
152
|
|
|
|
|
|
|
{ |
153
|
|
|
|
|
|
|
name => "fail_other_except", |
154
|
|
|
|
|
|
|
format => "Failed %(_get_fail_test_scripts_string)s%(_get_fail_tests_good_percent_string)s.%(_get_sub_percent_msg)s\n" |
155
|
|
|
|
|
|
|
}, |
156
|
|
|
|
|
|
|
); |
157
|
|
|
|
|
|
|
|
158
|
52
|
|
|
|
|
178
|
return 0; |
159
|
|
|
|
|
|
|
} |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=head2 $self->helpers_base_namespace() |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
See L<Test::Run::Base::PlugHelpers>. |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=cut |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
sub helpers_base_namespace |
168
|
|
|
|
|
|
|
{ |
169
|
201
|
|
|
201
|
1
|
430
|
my $self = shift; |
170
|
|
|
|
|
|
|
|
171
|
201
|
|
|
|
|
3506
|
return "Test::Run::Core::__HelperObjects"; |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=head2 Object Parameters |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
These parameters are accessors. They can be set at object creation by passing |
177
|
|
|
|
|
|
|
their name along with a value on the constructor (along with the compulsory |
178
|
|
|
|
|
|
|
C<'test_files'> argument): |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
my $tester = Test::Run::Obj->new( |
181
|
|
|
|
|
|
|
{ |
182
|
|
|
|
|
|
|
'test_files' => \@mytests, |
183
|
|
|
|
|
|
|
'Verbose' => 1, |
184
|
|
|
|
|
|
|
} |
185
|
|
|
|
|
|
|
); |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
Alternatively, before C<runtests()> is called, they can be set by passing a |
188
|
|
|
|
|
|
|
value to their accessor: |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
$tester->Verbose(1); |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=over 4 |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
=item C<$self-E<gt>Verbose()> |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
The object variable C<$self-E<gt>Verbose()> can be used to let C<runtests()> |
197
|
|
|
|
|
|
|
display the standard output of the script without altering the behavior |
198
|
|
|
|
|
|
|
otherwise. The F<runprove> utility's C<-v> flag will set this. |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=item C<$self-E<gt>Leaked_Dir()> |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
When set to the name of a directory, C<$tester> will check after each |
203
|
|
|
|
|
|
|
test whether new files appeared in that directory, and report them as |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
LEAKED FILES: scr.tmp 0 my.db |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
If relative, directory name is with respect to the current directory at |
208
|
|
|
|
|
|
|
the moment C<$tester-E<gt>runtests()> was called. Putting the absolute path |
209
|
|
|
|
|
|
|
into C<Leaked_Dir> will give more predictable results. |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
=item C<$self-E<gt>Debug()> |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
If C<$self-E<gt>Debug()> is true, Test::Run will print debugging information |
214
|
|
|
|
|
|
|
about itself as it runs the tests. This is different from |
215
|
|
|
|
|
|
|
C<$self-E<gt>Verbose()>, which prints the output from the test being run. |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=item C<$self-E<gt>Columns()> |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
This value will be used for the width of the terminal. If it is not |
220
|
|
|
|
|
|
|
set then it will default to 80. |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=item C<$self-E<gt>Timer()> |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
If set to true, and C<Time::HiRes> is available, print elapsed seconds |
225
|
|
|
|
|
|
|
after each test file. |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
=item C<$self-E<gt>NoTty()> |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
When set to a true value, forces it to behave as though STDOUT were |
230
|
|
|
|
|
|
|
not a console. You may need to set this if you don't want harness to |
231
|
|
|
|
|
|
|
output more frequent progress messages using carriage returns. Some |
232
|
|
|
|
|
|
|
consoles may not handle carriage returns properly (which results in a |
233
|
|
|
|
|
|
|
somewhat messy output). |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=item C<$self-E<gt>Test_Interprter()> |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
Usually your tests will be run by C<$^X>, the currently-executing Perl. |
238
|
|
|
|
|
|
|
However, you may want to have it run by a different executable, such as |
239
|
|
|
|
|
|
|
a threading perl, or a different version. |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=item C<$self-E<gt>Switches()> and C<$self-E<gt>Switches_Env()> |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
These two values will be prepended to the switches used to invoke perl on |
244
|
|
|
|
|
|
|
each test. For example, setting one of them to C<-W> will |
245
|
|
|
|
|
|
|
run all tests with all warnings enabled. |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
The difference between them is that C<Switches_Env()> is expected to be |
248
|
|
|
|
|
|
|
filled in by the environment and C<Switches()> from other sources (like the |
249
|
|
|
|
|
|
|
programmer). |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
=back |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
=head2 METHODS |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
Test::Run currently has only one interface method. |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
=head2 $tester->runtests() |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
my $all_ok = $tester->runtests() |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
Runs the tests, see if they are OK. Returns true if they are OK, or |
262
|
|
|
|
|
|
|
throw an exception otherwise. |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
=cut |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
=head2 $self->_report_leaked_files({leaked_files => [@files]}) |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
Should report (or ignore) the files that were leaked in the directories |
271
|
|
|
|
|
|
|
that were specifies as leaking directories. |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
=cut |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
=head2 $self->_report_failed_with_results_seen({%args}) |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
Should report (or ignore) the failed tests in the test file. |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
Arguments are: |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
=over 4 |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
=item * test_struct |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
The test struct as returned by straps. |
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
=item * filename |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
The filename |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
=item * estatus |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
Exit status. |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
=item * wstatus |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
Wait status. |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
=item * results |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
The results of the test. |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
=back |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
=cut |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
=head2 $self->_recheck_dir_files() |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
Called to recheck that the dir files is OK. |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
=cut |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
sub _recheck_dir_files |
316
|
|
|
|
|
|
|
{ |
317
|
55
|
|
|
55
|
|
153
|
my $self = shift; |
318
|
|
|
|
|
|
|
|
319
|
55
|
100
|
|
|
|
2054
|
if (defined($self->Leaked_Dir())) |
320
|
|
|
|
|
|
|
{ |
321
|
2
|
|
|
|
|
55
|
return $self->_real_recheck_dir_files(); |
322
|
|
|
|
|
|
|
} |
323
|
|
|
|
|
|
|
} |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
sub _calc_leaked_files_since_last_update |
326
|
|
|
|
|
|
|
{ |
327
|
2
|
|
|
2
|
|
10
|
my $self = shift; |
328
|
|
|
|
|
|
|
|
329
|
2
|
|
|
|
|
13
|
my %found; |
330
|
|
|
|
|
|
|
|
331
|
2
|
|
|
|
|
10
|
@found{@{$self->_new_dir_files()}} = (1) x @{$self->_new_dir_files()}; |
|
2
|
|
|
|
|
71
|
|
|
2
|
|
|
|
|
76
|
|
332
|
|
|
|
|
|
|
|
333
|
2
|
|
|
|
|
16
|
delete(@found{@{$self->dir_files()}}); |
|
2
|
|
|
|
|
64
|
|
334
|
|
|
|
|
|
|
|
335
|
2
|
|
|
|
|
47
|
return [sort keys(%found)]; |
336
|
|
|
|
|
|
|
} |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
sub _real_recheck_dir_files |
339
|
|
|
|
|
|
|
{ |
340
|
2
|
|
|
2
|
|
10
|
my $self = shift; |
341
|
|
|
|
|
|
|
|
342
|
2
|
|
|
|
|
29
|
$self->_new_dir_files($self->_get_dir_files()); |
343
|
|
|
|
|
|
|
|
344
|
2
|
|
|
|
|
31
|
$self->_report_leaked_files( |
345
|
|
|
|
|
|
|
{ |
346
|
|
|
|
|
|
|
leaked_files => $self->_calc_leaked_files_since_last_update() |
347
|
|
|
|
|
|
|
} |
348
|
|
|
|
|
|
|
); |
349
|
2
|
|
|
|
|
92
|
$self->_update_dir_files(); |
350
|
|
|
|
|
|
|
} |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
sub _update_dir_files |
353
|
|
|
|
|
|
|
{ |
354
|
2
|
|
|
2
|
|
7
|
my $self = shift; |
355
|
|
|
|
|
|
|
|
356
|
2
|
|
|
|
|
71
|
$self->dir_files($self->_new_dir_files()); |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
# Reset it to prevent dangerous behaviour. |
359
|
2
|
|
|
|
|
60
|
$self->_new_dir_files(undef); |
360
|
|
|
|
|
|
|
|
361
|
2
|
|
|
|
|
11
|
return; |
362
|
|
|
|
|
|
|
} |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
sub _glob_dir |
365
|
|
|
|
|
|
|
{ |
366
|
4
|
|
|
4
|
|
20
|
my ($self, $dirname) = @_; |
367
|
|
|
|
|
|
|
|
368
|
4
|
|
|
|
|
10
|
my $dir; |
369
|
4
|
|
|
|
|
134
|
opendir $dir, $dirname; |
370
|
4
|
|
|
|
|
666
|
my @contents = readdir($dir); |
371
|
4
|
|
|
|
|
70
|
closedir($dir); |
372
|
|
|
|
|
|
|
|
373
|
4
|
|
|
|
|
456
|
return [File::Spec->no_upwards(@contents)]; |
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
sub _get_num_tests_files |
377
|
|
|
|
|
|
|
{ |
378
|
51
|
|
|
51
|
|
98
|
my $self = shift; |
379
|
|
|
|
|
|
|
|
380
|
51
|
|
|
|
|
96
|
return scalar(@{$self->test_files()}); |
|
51
|
|
|
|
|
1287
|
|
381
|
|
|
|
|
|
|
} |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
sub _get_tot_counter_tests |
384
|
|
|
|
|
|
|
{ |
385
|
51
|
|
|
51
|
|
120
|
my $self = shift; |
386
|
|
|
|
|
|
|
|
387
|
51
|
|
|
|
|
203
|
return [ tests => $self->_get_num_tests_files() ]; |
388
|
|
|
|
|
|
|
} |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
sub _init_tot_obj_instance |
391
|
|
|
|
|
|
|
{ |
392
|
51
|
|
|
51
|
|
120
|
my $self = shift; |
393
|
|
|
|
|
|
|
return $self->create_pluggable_helper_obj( |
394
|
|
|
|
|
|
|
{ |
395
|
|
|
|
|
|
|
id => "tot", |
396
|
51
|
|
|
|
|
131
|
args => { @{$self->_get_tot_counter_tests()} }, |
|
51
|
|
|
|
|
228
|
|
397
|
|
|
|
|
|
|
} |
398
|
|
|
|
|
|
|
); |
399
|
|
|
|
|
|
|
} |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
sub _init_tot |
402
|
|
|
|
|
|
|
{ |
403
|
51
|
|
|
51
|
|
113
|
my $self = shift; |
404
|
51
|
|
|
|
|
202
|
$self->tot( |
405
|
|
|
|
|
|
|
$self->_init_tot_obj_instance() |
406
|
|
|
|
|
|
|
); |
407
|
|
|
|
|
|
|
} |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
sub _tot_inc |
410
|
|
|
|
|
|
|
{ |
411
|
115
|
|
|
115
|
|
714
|
my ($self, $field) = @_; |
412
|
|
|
|
|
|
|
|
413
|
115
|
|
|
|
|
3269
|
$self->tot()->inc($field); |
414
|
|
|
|
|
|
|
} |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
sub _tot_add_results |
417
|
|
|
|
|
|
|
{ |
418
|
55
|
|
|
55
|
|
195
|
my ($self, $results) = @_; |
419
|
|
|
|
|
|
|
|
420
|
55
|
|
|
|
|
1885
|
return $self->tot->add_results($results); |
421
|
|
|
|
|
|
|
} |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
sub _create_failed_obj_instance |
424
|
|
|
|
|
|
|
{ |
425
|
19
|
|
|
19
|
|
2445
|
my $self = shift; |
426
|
19
|
|
|
|
|
40
|
my $args = shift; |
427
|
19
|
|
|
|
|
217
|
return $self->create_pluggable_helper_obj( |
428
|
|
|
|
|
|
|
{ |
429
|
|
|
|
|
|
|
id => "failed", |
430
|
|
|
|
|
|
|
args => $args, |
431
|
|
|
|
|
|
|
} |
432
|
|
|
|
|
|
|
); |
433
|
|
|
|
|
|
|
} |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
sub _create_test_obj_instance |
436
|
|
|
|
|
|
|
{ |
437
|
55
|
|
|
55
|
|
236
|
my ($self, $args) = @_; |
438
|
55
|
|
|
|
|
1703
|
return $self->create_pluggable_helper_obj( |
439
|
|
|
|
|
|
|
{ |
440
|
|
|
|
|
|
|
id => "test", |
441
|
|
|
|
|
|
|
args => $args, |
442
|
|
|
|
|
|
|
} |
443
|
|
|
|
|
|
|
); |
444
|
|
|
|
|
|
|
} |
445
|
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
sub _is_failed_and_max |
447
|
|
|
|
|
|
|
{ |
448
|
24
|
|
|
24
|
|
58
|
my $self = shift; |
449
|
|
|
|
|
|
|
|
450
|
24
|
|
|
|
|
611
|
return $self->last_test_obj->is_failed_and_max(); |
451
|
|
|
|
|
|
|
} |
452
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
sub _strap_test_handler |
454
|
|
|
|
|
|
|
{ |
455
|
208
|
|
|
208
|
|
463
|
my ($self, $args) = @_; |
456
|
|
|
|
|
|
|
|
457
|
208
|
|
|
|
|
881
|
$args->{totals}->update_based_on_last_detail(); |
458
|
|
|
|
|
|
|
|
459
|
208
|
|
|
|
|
930
|
$self->_report_test_progress($args); |
460
|
|
|
|
|
|
|
|
461
|
208
|
|
|
|
|
1747
|
return; |
462
|
|
|
|
|
|
|
} |
463
|
|
|
|
|
|
|
|
464
|
|
|
|
|
|
|
sub _strap_header_handler |
465
|
|
|
|
|
|
|
{ |
466
|
52
|
|
|
52
|
|
208
|
my ($self, $args) = @_; |
467
|
|
|
|
|
|
|
|
468
|
52
|
|
|
|
|
150
|
my $totals = $args->{totals}; |
469
|
|
|
|
|
|
|
|
470
|
52
|
50
|
|
|
|
2142
|
if ($self->Strap()->_seen_header()) |
471
|
|
|
|
|
|
|
{ |
472
|
0
|
|
|
|
|
0
|
warn "Test header seen more than once!\n"; |
473
|
|
|
|
|
|
|
} |
474
|
|
|
|
|
|
|
|
475
|
52
|
|
|
|
|
1214
|
$self->Strap()->_inc_seen_header(); |
476
|
|
|
|
|
|
|
|
477
|
52
|
50
|
|
|
|
693
|
if ($totals->in_the_middle()) |
478
|
|
|
|
|
|
|
{ |
479
|
0
|
|
|
|
|
0
|
warn "1..M can only appear at the beginning or end of tests\n"; |
480
|
|
|
|
|
|
|
} |
481
|
|
|
|
|
|
|
|
482
|
52
|
|
|
|
|
520
|
return; |
483
|
|
|
|
|
|
|
} |
484
|
|
|
|
|
|
|
|
485
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
sub _tap_event_strap_callback |
487
|
|
|
|
|
|
|
{ |
488
|
289
|
|
|
289
|
|
854
|
my ($self, $args) = @_; |
489
|
|
|
|
|
|
|
|
490
|
289
|
|
|
|
|
1855
|
$self->_report_tap_event($args); |
491
|
|
|
|
|
|
|
|
492
|
289
|
|
|
|
|
974
|
return $self->_tap_event_handle_strap($args); |
493
|
|
|
|
|
|
|
} |
494
|
|
|
|
|
|
|
|
495
|
|
|
|
|
|
|
sub _tap_event__calc_conds |
496
|
|
|
|
|
|
|
{ |
497
|
289
|
|
|
289
|
|
513
|
my $self = shift; |
498
|
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
return |
500
|
|
|
|
|
|
|
[ |
501
|
289
|
|
|
|
|
2466
|
{ cond => "is_plan", handler => "_strap_header_handler", }, |
502
|
|
|
|
|
|
|
{ cond => "is_bailout", handler => "_strap_bailout_handler", }, |
503
|
|
|
|
|
|
|
{ cond => "is_test", handler => "_strap_test_handler"}, |
504
|
|
|
|
|
|
|
]; |
505
|
|
|
|
|
|
|
} |
506
|
|
|
|
|
|
|
|
507
|
|
|
|
|
|
|
sub _tap_event_handle_strap |
508
|
|
|
|
|
|
|
{ |
509
|
289
|
|
|
289
|
|
679
|
my ($self, $args) = @_; |
510
|
289
|
|
|
|
|
715
|
my $event = $args->{event}; |
511
|
|
|
|
|
|
|
|
512
|
289
|
|
|
|
|
462
|
foreach my $c (@{$self->_tap_event__calc_conds()}) |
|
289
|
|
|
|
|
756
|
|
513
|
|
|
|
|
|
|
{ |
514
|
761
|
|
|
|
|
7165
|
my $cond = $c->{cond}; |
515
|
761
|
|
|
|
|
1073
|
my $handler = $c->{handler}; |
516
|
|
|
|
|
|
|
|
517
|
761
|
100
|
|
|
|
2396
|
if ($event->$cond()) |
518
|
|
|
|
|
|
|
{ |
519
|
262
|
|
|
|
|
4464
|
return $self->$handler($args); |
520
|
|
|
|
|
|
|
} |
521
|
|
|
|
|
|
|
} |
522
|
27
|
|
|
|
|
480
|
return; |
523
|
|
|
|
|
|
|
} |
524
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
=begin _private |
526
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
=over 4 |
528
|
|
|
|
|
|
|
|
529
|
|
|
|
|
|
|
=item B<_all_ok> |
530
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
my $ok = $self->_all_ok(); |
532
|
|
|
|
|
|
|
|
533
|
|
|
|
|
|
|
Tells you if the current test run is OK or not. |
534
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
=cut |
536
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
sub _all_ok |
538
|
|
|
|
|
|
|
{ |
539
|
88
|
|
|
88
|
|
20140
|
my $self = shift; |
540
|
88
|
|
|
|
|
2602
|
return $self->tot->all_ok(); |
541
|
|
|
|
|
|
|
} |
542
|
|
|
|
|
|
|
|
543
|
|
|
|
|
|
|
=back |
544
|
|
|
|
|
|
|
|
545
|
|
|
|
|
|
|
=cut |
546
|
|
|
|
|
|
|
|
547
|
|
|
|
|
|
|
sub _get_dir_files |
548
|
|
|
|
|
|
|
{ |
549
|
4
|
|
|
4
|
|
21
|
my $self = shift; |
550
|
|
|
|
|
|
|
|
551
|
4
|
|
|
|
|
169
|
return $self->_glob_dir($self->Leaked_Dir()); |
552
|
|
|
|
|
|
|
} |
553
|
|
|
|
|
|
|
|
554
|
|
|
|
|
|
|
sub _calc_strap_callback_map |
555
|
|
|
|
|
|
|
{ |
556
|
|
|
|
|
|
|
return |
557
|
|
|
|
|
|
|
{ |
558
|
346
|
|
|
346
|
|
4690
|
"tap_event" => "_tap_event_strap_callback", |
559
|
|
|
|
|
|
|
"report_start_env" => "_report_script_start_environment", |
560
|
|
|
|
|
|
|
"could_not_run_script" => "_report_could_not_run_script", |
561
|
|
|
|
|
|
|
"test_file_opening_error" => "_handle_test_file_opening_error", |
562
|
|
|
|
|
|
|
"test_file_closing_error" => "_handle_test_file_closing_error", |
563
|
|
|
|
|
|
|
}; |
564
|
|
|
|
|
|
|
} |
565
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
sub _strap_callback |
567
|
|
|
|
|
|
|
{ |
568
|
346
|
|
|
346
|
|
1506
|
my ($self, $args) = @_; |
569
|
|
|
|
|
|
|
|
570
|
346
|
|
|
|
|
1058
|
my $type = $args->{type}; |
571
|
346
|
|
|
|
|
1601
|
my $cb = $self->_calc_strap_callback_map()->{$type}; |
572
|
|
|
|
|
|
|
|
573
|
346
|
|
|
|
|
3575
|
return $self->$cb($args); |
574
|
|
|
|
|
|
|
} |
575
|
|
|
|
|
|
|
|
576
|
|
|
|
|
|
|
sub _inc_bad |
577
|
|
|
|
|
|
|
{ |
578
|
19
|
|
|
19
|
|
55
|
my $self = shift; |
579
|
|
|
|
|
|
|
|
580
|
19
|
|
|
|
|
103
|
$self->_tot_inc('bad'); |
581
|
|
|
|
|
|
|
|
582
|
19
|
|
|
|
|
39
|
return; |
583
|
|
|
|
|
|
|
} |
584
|
|
|
|
|
|
|
|
585
|
|
|
|
|
|
|
sub _ser_failed_results |
586
|
|
|
|
|
|
|
{ |
587
|
12
|
|
|
12
|
|
30
|
my $self = shift; |
588
|
|
|
|
|
|
|
|
589
|
12
|
|
|
|
|
100
|
return $self->_canonfailed()->get_ser_results(); |
590
|
|
|
|
|
|
|
} |
591
|
|
|
|
|
|
|
|
592
|
|
|
|
|
|
|
sub _get_current_time |
593
|
|
|
|
|
|
|
{ |
594
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
595
|
|
|
|
|
|
|
|
596
|
0
|
|
|
|
|
0
|
return Time::HiRes::time(); |
597
|
|
|
|
|
|
|
} |
598
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
sub _set_start_time |
600
|
|
|
|
|
|
|
{ |
601
|
57
|
|
|
57
|
|
127
|
my $self = shift; |
602
|
|
|
|
|
|
|
|
603
|
57
|
50
|
|
|
|
1464
|
if ($self->Timer()) |
604
|
|
|
|
|
|
|
{ |
605
|
0
|
|
|
|
|
0
|
$self->_start_time($self->_get_current_time()); |
606
|
|
|
|
|
|
|
} |
607
|
|
|
|
|
|
|
} |
608
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
sub _get_failed_with_results_seen_msg |
610
|
|
|
|
|
|
|
{ |
611
|
12
|
|
|
12
|
|
40
|
my $self = shift; |
612
|
|
|
|
|
|
|
|
613
|
|
|
|
|
|
|
return |
614
|
12
|
100
|
|
|
|
91
|
$self->_is_failed_and_max() |
615
|
|
|
|
|
|
|
? $self->_get_failed_and_max_msg() |
616
|
|
|
|
|
|
|
: $self->_get_dont_know_which_tests_failed_msg() |
617
|
|
|
|
|
|
|
; |
618
|
|
|
|
|
|
|
} |
619
|
|
|
|
|
|
|
|
620
|
|
|
|
|
|
|
sub _get_dont_know_which_tests_failed_msg |
621
|
|
|
|
|
|
|
{ |
622
|
2
|
|
|
2
|
|
558
|
my $self = shift; |
623
|
|
|
|
|
|
|
|
624
|
2
|
|
|
|
|
57
|
return $self->last_test_obj->_get_dont_know_which_tests_failed_msg(); |
625
|
|
|
|
|
|
|
} |
626
|
|
|
|
|
|
|
|
627
|
|
|
|
|
|
|
sub _get_elapsed |
628
|
|
|
|
|
|
|
{ |
629
|
55
|
|
|
55
|
|
132
|
my $self = shift; |
630
|
|
|
|
|
|
|
|
631
|
55
|
50
|
|
|
|
1976
|
if ($self->Timer()) |
632
|
|
|
|
|
|
|
{ |
633
|
0
|
|
|
|
|
0
|
return sprintf(" %8.3fs", |
634
|
|
|
|
|
|
|
$self->_get_current_time() - $self->_start_time() |
635
|
|
|
|
|
|
|
); |
636
|
|
|
|
|
|
|
} |
637
|
|
|
|
|
|
|
else |
638
|
|
|
|
|
|
|
{ |
639
|
55
|
|
|
|
|
2718
|
return ""; |
640
|
|
|
|
|
|
|
} |
641
|
|
|
|
|
|
|
} |
642
|
|
|
|
|
|
|
|
643
|
|
|
|
|
|
|
sub _set_last_test_elapsed |
644
|
|
|
|
|
|
|
{ |
645
|
55
|
|
|
55
|
|
160
|
my $self = shift; |
646
|
|
|
|
|
|
|
|
647
|
55
|
|
|
|
|
266
|
$self->last_test_elapsed($self->_get_elapsed()); |
648
|
|
|
|
|
|
|
} |
649
|
|
|
|
|
|
|
|
650
|
|
|
|
|
|
|
sub _get_copied_strap_fields |
651
|
|
|
|
|
|
|
{ |
652
|
57
|
|
|
57
|
|
776
|
return [qw(Debug Test_Interpreter Switches Switches_Env)]; |
653
|
|
|
|
|
|
|
} |
654
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
sub _init_strap |
656
|
|
|
|
|
|
|
{ |
657
|
57
|
|
|
57
|
|
269
|
my ($self, $args) = @_; |
658
|
|
|
|
|
|
|
|
659
|
57
|
|
|
|
|
1344
|
$self->Strap()->copy_from($self, $self->_get_copied_strap_fields()); |
660
|
|
|
|
|
|
|
} |
661
|
|
|
|
|
|
|
|
662
|
|
|
|
|
|
|
sub _get_sub_percent_msg |
663
|
|
|
|
|
|
|
{ |
664
|
7
|
|
|
7
|
|
31
|
my $self = shift; |
665
|
|
|
|
|
|
|
|
666
|
7
|
|
|
|
|
212
|
return $self->tot->get_sub_percent_msg(); |
667
|
|
|
|
|
|
|
} |
668
|
|
|
|
|
|
|
|
669
|
|
|
|
|
|
|
sub _handle_passing_test |
670
|
|
|
|
|
|
|
{ |
671
|
36
|
|
|
36
|
|
164
|
my $self = shift; |
672
|
|
|
|
|
|
|
|
673
|
36
|
|
|
|
|
257
|
$self->_process_passing_test(); |
674
|
36
|
|
|
|
|
271
|
$self->_tot_inc('good'); |
675
|
|
|
|
|
|
|
} |
676
|
|
|
|
|
|
|
|
677
|
|
|
|
|
|
|
sub _does_test_have_some_oks |
678
|
|
|
|
|
|
|
{ |
679
|
36
|
|
|
36
|
|
85
|
my $self = shift; |
680
|
|
|
|
|
|
|
|
681
|
36
|
|
|
|
|
1089
|
return $self->last_test_obj->max(); |
682
|
|
|
|
|
|
|
} |
683
|
|
|
|
|
|
|
|
684
|
|
|
|
|
|
|
sub _process_passing_test |
685
|
|
|
|
|
|
|
{ |
686
|
36
|
|
|
36
|
|
141
|
my $self = shift; |
687
|
|
|
|
|
|
|
|
688
|
36
|
100
|
|
|
|
191
|
if ($self->_does_test_have_some_oks()) |
689
|
|
|
|
|
|
|
{ |
690
|
33
|
|
|
|
|
272
|
$self->_process_test_with_some_oks(); |
691
|
|
|
|
|
|
|
} |
692
|
|
|
|
|
|
|
else |
693
|
|
|
|
|
|
|
{ |
694
|
3
|
|
|
|
|
75
|
$self->_process_all_skipped_test(); |
695
|
|
|
|
|
|
|
} |
696
|
|
|
|
|
|
|
} |
697
|
|
|
|
|
|
|
|
698
|
|
|
|
|
|
|
sub _process_test_with_some_oks |
699
|
|
|
|
|
|
|
{ |
700
|
33
|
|
|
33
|
|
135
|
my $self = shift; |
701
|
|
|
|
|
|
|
|
702
|
33
|
100
|
|
|
|
871
|
if ($self->last_test_obj->skipped_or_bonus()) |
703
|
|
|
|
|
|
|
{ |
704
|
11
|
|
|
|
|
118
|
return $self->_process_skipped_test(); |
705
|
|
|
|
|
|
|
} |
706
|
|
|
|
|
|
|
else |
707
|
|
|
|
|
|
|
{ |
708
|
22
|
|
|
|
|
187
|
return $self->_process_all_ok_test(); |
709
|
|
|
|
|
|
|
} |
710
|
|
|
|
|
|
|
} |
711
|
|
|
|
|
|
|
|
712
|
|
|
|
|
|
|
sub _process_all_ok_test |
713
|
|
|
|
|
|
|
{ |
714
|
22
|
|
|
22
|
|
82
|
my ($self) = @_; |
715
|
22
|
|
|
|
|
194
|
return $self->_report_all_ok_test(); |
716
|
|
|
|
|
|
|
} |
717
|
|
|
|
|
|
|
|
718
|
|
|
|
|
|
|
sub _process_all_skipped_test |
719
|
|
|
|
|
|
|
{ |
720
|
3
|
|
|
3
|
|
26
|
my $self = shift; |
721
|
|
|
|
|
|
|
|
722
|
3
|
|
|
|
|
82
|
$self->_report_all_skipped_test(); |
723
|
3
|
|
|
|
|
22
|
$self->_tot_inc('skipped'); |
724
|
|
|
|
|
|
|
|
725
|
3
|
|
|
|
|
8
|
return; |
726
|
|
|
|
|
|
|
} |
727
|
|
|
|
|
|
|
|
728
|
|
|
|
|
|
|
sub _fail_other_get_script_names |
729
|
|
|
|
|
|
|
{ |
730
|
7
|
|
|
7
|
|
19
|
my $self = shift; |
731
|
|
|
|
|
|
|
|
732
|
7
|
|
|
|
|
13
|
return [ sort { $a cmp $b } (keys(%{$self->failed_tests()})) ]; |
|
0
|
|
|
|
|
0
|
|
|
7
|
|
|
|
|
221
|
|
733
|
|
|
|
|
|
|
} |
734
|
|
|
|
|
|
|
|
735
|
|
|
|
|
|
|
sub _fail_other_print_all_tests |
736
|
|
|
|
|
|
|
{ |
737
|
7
|
|
|
7
|
|
18
|
my $self = shift; |
738
|
|
|
|
|
|
|
|
739
|
7
|
|
|
|
|
17
|
for my $script (@{$self->_fail_other_get_script_names()}) |
|
7
|
|
|
|
|
52
|
|
740
|
|
|
|
|
|
|
{ |
741
|
7
|
|
|
|
|
61
|
$self->_fail_other_report_test($script); |
742
|
|
|
|
|
|
|
} |
743
|
|
|
|
|
|
|
} |
744
|
|
|
|
|
|
|
|
745
|
|
|
|
|
|
|
sub _fail_other_throw_exception |
746
|
|
|
|
|
|
|
{ |
747
|
7
|
|
|
7
|
|
19
|
my $self = shift; |
748
|
|
|
|
|
|
|
|
749
|
7
|
|
|
|
|
42
|
die Test::Run::Obj::Error::TestsFail::Other->new( |
750
|
|
|
|
|
|
|
{text => $self->_get_fail_other_exception_text(),}, |
751
|
|
|
|
|
|
|
); |
752
|
|
|
|
|
|
|
} |
753
|
|
|
|
|
|
|
|
754
|
|
|
|
|
|
|
sub _process_skipped_test |
755
|
|
|
|
|
|
|
{ |
756
|
11
|
|
|
11
|
|
40
|
my ($self) = @_; |
757
|
|
|
|
|
|
|
|
758
|
11
|
|
|
|
|
130
|
return $self->_report_skipped_test(); |
759
|
|
|
|
|
|
|
} |
760
|
|
|
|
|
|
|
|
761
|
|
|
|
|
|
|
|
762
|
|
|
|
|
|
|
|
763
|
|
|
|
|
|
|
sub _time_single_test |
764
|
|
|
|
|
|
|
{ |
765
|
57
|
|
|
57
|
|
164
|
my ($self, $args) = @_; |
766
|
|
|
|
|
|
|
|
767
|
57
|
|
|
|
|
280
|
$self->_set_start_time($args); |
768
|
|
|
|
|
|
|
|
769
|
57
|
|
|
|
|
360
|
$self->_init_strap($args); |
770
|
|
|
|
|
|
|
|
771
|
57
|
|
|
346
|
|
1306
|
$self->Strap->callback(sub { return $self->_strap_callback(@_); }); |
|
346
|
|
|
|
|
3481
|
|
772
|
|
|
|
|
|
|
|
773
|
|
|
|
|
|
|
# We trap exceptions so we can nullify the callback to avoid memory |
774
|
|
|
|
|
|
|
# leaks. |
775
|
57
|
|
|
|
|
110
|
my $results; |
776
|
|
|
|
|
|
|
eval |
777
|
57
|
|
|
|
|
139
|
{ |
778
|
57
|
50
|
|
|
|
1399
|
if (! ($results = $self->Strap()->analyze_file($args->{test_file}))) |
779
|
|
|
|
|
|
|
{ |
780
|
|
|
|
|
|
|
do |
781
|
0
|
|
|
|
|
0
|
{ |
782
|
0
|
|
|
|
|
0
|
warn $self->Strap()->error(), "\n"; |
783
|
0
|
|
|
|
|
0
|
next; |
784
|
|
|
|
|
|
|
} |
785
|
|
|
|
|
|
|
} |
786
|
|
|
|
|
|
|
}; |
787
|
|
|
|
|
|
|
|
788
|
|
|
|
|
|
|
# To avoid circular references |
789
|
57
|
|
|
|
|
1462
|
$self->Strap->callback(undef); |
790
|
|
|
|
|
|
|
|
791
|
57
|
100
|
|
|
|
271
|
if ($@ ne "") |
792
|
|
|
|
|
|
|
{ |
793
|
2
|
|
|
|
|
88
|
die $@; |
794
|
|
|
|
|
|
|
} |
795
|
55
|
|
|
|
|
571
|
$self->_set_last_test_elapsed($args); |
796
|
|
|
|
|
|
|
|
797
|
55
|
|
|
|
|
2075
|
$self->last_test_results($results); |
798
|
|
|
|
|
|
|
|
799
|
55
|
|
|
|
|
715
|
return; |
800
|
|
|
|
|
|
|
} |
801
|
|
|
|
|
|
|
|
802
|
|
|
|
|
|
|
sub _fail_no_tests_output |
803
|
|
|
|
|
|
|
{ |
804
|
1
|
|
|
1
|
|
4
|
my $self = shift; |
805
|
1
|
|
|
|
|
7
|
die Test::Run::Obj::Error::TestsFail::NoOutput->new( |
806
|
|
|
|
|
|
|
{text => $self->_get_fail_no_tests_output_text(),}, |
807
|
|
|
|
|
|
|
); |
808
|
|
|
|
|
|
|
} |
809
|
|
|
|
|
|
|
|
810
|
|
|
|
|
|
|
sub _failed_canon |
811
|
|
|
|
|
|
|
{ |
812
|
12
|
|
|
12
|
|
27
|
my $self = shift; |
813
|
|
|
|
|
|
|
|
814
|
12
|
|
|
|
|
39
|
return $self->_canonfailed()->canon(); |
815
|
|
|
|
|
|
|
} |
816
|
|
|
|
|
|
|
|
817
|
|
|
|
|
|
|
sub _get_failed_and_max_msg |
818
|
|
|
|
|
|
|
{ |
819
|
10
|
|
|
10
|
|
56
|
my $self = shift; |
820
|
|
|
|
|
|
|
|
821
|
10
|
|
|
|
|
299
|
return $self->last_test_obj->ml() |
822
|
|
|
|
|
|
|
. $self->_ser_failed_results(); |
823
|
|
|
|
|
|
|
} |
824
|
|
|
|
|
|
|
|
825
|
|
|
|
|
|
|
sub _canonfailed |
826
|
|
|
|
|
|
|
{ |
827
|
24
|
|
|
24
|
|
50
|
my $self = shift; |
828
|
|
|
|
|
|
|
|
829
|
24
|
|
|
|
|
164
|
my $canon_obj = $self->_canonfailed_get_canon(); |
830
|
|
|
|
|
|
|
|
831
|
24
|
|
|
|
|
5675
|
$canon_obj->add_Failed_and_skipped($self->last_test_obj); |
832
|
|
|
|
|
|
|
|
833
|
24
|
|
|
|
|
203
|
return $canon_obj; |
834
|
|
|
|
|
|
|
# Originally returning get_ser_results, canon |
835
|
|
|
|
|
|
|
} |
836
|
|
|
|
|
|
|
|
837
|
|
|
|
|
|
|
|
838
|
|
|
|
|
|
|
sub _filter_failed |
839
|
|
|
|
|
|
|
{ |
840
|
24
|
|
|
24
|
|
71
|
my ($self, $failed_ref) = @_; |
841
|
24
|
|
|
|
|
3321
|
return [ List::MoreUtils::uniq(sort { $a <=> $b } @$failed_ref) ]; |
|
800020
|
|
|
|
|
966230
|
|
842
|
|
|
|
|
|
|
} |
843
|
|
|
|
|
|
|
|
844
|
|
|
|
|
|
|
sub _canonfailed_get_failed |
845
|
|
|
|
|
|
|
{ |
846
|
24
|
|
|
24
|
|
49
|
my $self = shift; |
847
|
|
|
|
|
|
|
|
848
|
24
|
|
|
|
|
129
|
return $self->_filter_failed($self->_get_failed_list()); |
849
|
|
|
|
|
|
|
} |
850
|
|
|
|
|
|
|
|
851
|
|
|
|
|
|
|
=head2 $self->_calc_test_struct_ml($results) |
852
|
|
|
|
|
|
|
|
853
|
|
|
|
|
|
|
Calculates the ml(). (See L<Test::Run::Output>) for the test. |
854
|
|
|
|
|
|
|
|
855
|
|
|
|
|
|
|
=cut |
856
|
|
|
|
|
|
|
|
857
|
|
|
|
|
|
|
sub _calc_test_struct_ml |
858
|
|
|
|
|
|
|
{ |
859
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
860
|
|
|
|
|
|
|
|
861
|
0
|
|
|
|
|
0
|
return ""; |
862
|
|
|
|
|
|
|
} |
863
|
|
|
|
|
|
|
|
864
|
|
|
|
|
|
|
sub _calc_last_test_obj_params |
865
|
|
|
|
|
|
|
{ |
866
|
55
|
|
|
55
|
|
160
|
my $self = shift; |
867
|
|
|
|
|
|
|
|
868
|
55
|
|
|
|
|
1644
|
my $results = $self->last_test_results; |
869
|
|
|
|
|
|
|
|
870
|
|
|
|
|
|
|
return |
871
|
|
|
|
|
|
|
[ |
872
|
|
|
|
|
|
|
( |
873
|
55
|
|
|
|
|
195
|
map { $_ => $results->$_(), } |
|
275
|
|
|
|
|
8145
|
|
874
|
|
|
|
|
|
|
(qw(bonus max ok skip_reason skip_all)) |
875
|
|
|
|
|
|
|
), |
876
|
|
|
|
|
|
|
skipped => $results->skip(), |
877
|
|
|
|
|
|
|
'next' => $self->Strap->next_test_num(), |
878
|
|
|
|
|
|
|
failed => $results->_get_failed_details(), |
879
|
|
|
|
|
|
|
ml => $self->_calc_test_struct_ml($results), |
880
|
|
|
|
|
|
|
]; |
881
|
|
|
|
|
|
|
} |
882
|
|
|
|
|
|
|
|
883
|
|
|
|
|
|
|
sub _get_fail_no_tests_run_text |
884
|
|
|
|
|
|
|
{ |
885
|
0
|
|
|
0
|
|
0
|
return "FAILED--no tests were run for some reason.\n" |
886
|
|
|
|
|
|
|
} |
887
|
|
|
|
|
|
|
|
888
|
|
|
|
|
|
|
sub _get_fail_no_tests_output_text |
889
|
|
|
|
|
|
|
{ |
890
|
1
|
|
|
1
|
|
4
|
my $self = shift; |
891
|
|
|
|
|
|
|
|
892
|
1
|
|
|
|
|
30
|
return $self->tot->_get_fail_no_tests_output_text(); |
893
|
|
|
|
|
|
|
} |
894
|
|
|
|
|
|
|
|
895
|
|
|
|
|
|
|
sub _get_success_msg |
896
|
|
|
|
|
|
|
{ |
897
|
15
|
|
|
15
|
|
35
|
my $self = shift; |
898
|
15
|
|
|
|
|
174
|
return "All tests successful" . $self->_get_bonusmsg() . "."; |
899
|
|
|
|
|
|
|
} |
900
|
|
|
|
|
|
|
|
901
|
|
|
|
|
|
|
sub _fail_no_tests_run |
902
|
|
|
|
|
|
|
{ |
903
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
904
|
0
|
|
|
|
|
0
|
die Test::Run::Obj::Error::TestsFail::NoTestsRun->new( |
905
|
|
|
|
|
|
|
{text => $self->_get_fail_no_tests_run_text(),}, |
906
|
|
|
|
|
|
|
); |
907
|
|
|
|
|
|
|
} |
908
|
|
|
|
|
|
|
|
909
|
|
|
|
|
|
|
sub _calc_test_struct |
910
|
|
|
|
|
|
|
{ |
911
|
55
|
|
|
55
|
|
156
|
my $self = shift; |
912
|
|
|
|
|
|
|
|
913
|
55
|
|
|
|
|
1605
|
my $results = $self->last_test_results; |
914
|
|
|
|
|
|
|
|
915
|
55
|
|
|
|
|
532
|
$self->_tot_add_results($results); |
916
|
|
|
|
|
|
|
|
917
|
|
|
|
|
|
|
return $self->last_test_obj( |
918
|
|
|
|
|
|
|
$self->_create_test_obj_instance( |
919
|
|
|
|
|
|
|
{ |
920
|
55
|
|
|
|
|
134
|
@{$self->_calc_last_test_obj_params()}, |
|
55
|
|
|
|
|
466
|
|
921
|
|
|
|
|
|
|
} |
922
|
|
|
|
|
|
|
) |
923
|
|
|
|
|
|
|
); |
924
|
|
|
|
|
|
|
} |
925
|
|
|
|
|
|
|
|
926
|
|
|
|
|
|
|
sub _get_failed_list |
927
|
|
|
|
|
|
|
{ |
928
|
24
|
|
|
24
|
|
55
|
my $self = shift; |
929
|
|
|
|
|
|
|
|
930
|
24
|
|
|
|
|
589
|
return $self->last_test_obj->failed; |
931
|
|
|
|
|
|
|
} |
932
|
|
|
|
|
|
|
|
933
|
|
|
|
|
|
|
sub _get_premature_test_dubious_summary |
934
|
|
|
|
|
|
|
{ |
935
|
2
|
|
|
2
|
|
18
|
my $self = shift; |
936
|
|
|
|
|
|
|
|
937
|
2
|
|
|
|
|
59
|
$self->last_test_obj->add_next_to_failed(); |
938
|
|
|
|
|
|
|
|
939
|
2
|
|
|
|
|
24
|
$self->_report_premature_test_dubious_summary(); |
940
|
|
|
|
|
|
|
|
941
|
2
|
|
|
|
|
219
|
return $self->_get_failed_and_max_params(); |
942
|
|
|
|
|
|
|
} |
943
|
|
|
|
|
|
|
|
944
|
|
|
|
|
|
|
sub _failed_before_any_test_output |
945
|
|
|
|
|
|
|
{ |
946
|
1
|
|
|
1
|
|
13
|
my $self = shift; |
947
|
|
|
|
|
|
|
|
948
|
1
|
|
|
|
|
46
|
$self->_report_failed_before_any_test_output(); |
949
|
|
|
|
|
|
|
|
950
|
1
|
|
|
|
|
22
|
$self->_inc_bad(); |
951
|
|
|
|
|
|
|
|
952
|
1
|
|
|
|
|
19
|
return $self->_calc_failed_before_any_test_obj(); |
953
|
|
|
|
|
|
|
} |
954
|
|
|
|
|
|
|
|
955
|
|
|
|
|
|
|
sub _max_len |
956
|
|
|
|
|
|
|
{ |
957
|
102
|
|
|
102
|
|
281
|
my ($self, $array_ref) = @_; |
958
|
|
|
|
|
|
|
|
959
|
102
|
|
|
|
|
208
|
return List::Util::max(map { length($_) } @$array_ref); |
|
114
|
|
|
|
|
2239
|
|
960
|
|
|
|
|
|
|
} |
961
|
|
|
|
|
|
|
|
962
|
|
|
|
|
|
|
# TODO : Add _leader_width here. |
963
|
|
|
|
|
|
|
|
964
|
|
|
|
|
|
|
|
965
|
|
|
|
|
|
|
sub _get_fn_fn |
966
|
|
|
|
|
|
|
{ |
967
|
57
|
|
|
57
|
|
194
|
my ($self, $fn) = @_; |
968
|
|
|
|
|
|
|
|
969
|
57
|
|
|
|
|
433
|
return $fn; |
970
|
|
|
|
|
|
|
} |
971
|
|
|
|
|
|
|
|
972
|
|
|
|
|
|
|
sub _get_fn_ext |
973
|
|
|
|
|
|
|
{ |
974
|
57
|
|
|
57
|
|
159
|
my ($self, $fn) = @_; |
975
|
|
|
|
|
|
|
|
976
|
57
|
100
|
|
|
|
667
|
return (($fn =~ /\.(\w+)\z/) ? $1 : ""); |
977
|
|
|
|
|
|
|
} |
978
|
|
|
|
|
|
|
|
979
|
|
|
|
|
|
|
sub _get_filename_map_max_len |
980
|
|
|
|
|
|
|
{ |
981
|
102
|
|
|
102
|
|
541
|
my ($self, $cb) = @_; |
982
|
|
|
|
|
|
|
|
983
|
|
|
|
|
|
|
return $self->_max_len( |
984
|
114
|
|
|
|
|
478
|
[ map { $self->$cb($self->_get_test_file_display_path($_)) } |
985
|
102
|
|
|
|
|
228
|
@{$self->test_files()} |
|
102
|
|
|
|
|
2725
|
|
986
|
|
|
|
|
|
|
] |
987
|
|
|
|
|
|
|
); |
988
|
|
|
|
|
|
|
} |
989
|
|
|
|
|
|
|
|
990
|
|
|
|
|
|
|
sub _get_max_ext_len |
991
|
|
|
|
|
|
|
{ |
992
|
51
|
|
|
51
|
|
124
|
my $self = shift; |
993
|
|
|
|
|
|
|
|
994
|
51
|
|
|
|
|
123
|
return $self->_get_filename_map_max_len("_get_fn_ext"); |
995
|
|
|
|
|
|
|
} |
996
|
|
|
|
|
|
|
|
997
|
|
|
|
|
|
|
sub _get_max_filename_len |
998
|
|
|
|
|
|
|
{ |
999
|
51
|
|
|
51
|
|
102
|
my $self = shift; |
1000
|
|
|
|
|
|
|
|
1001
|
51
|
|
|
|
|
252
|
return $self->_get_filename_map_max_len("_get_fn_fn"); |
1002
|
|
|
|
|
|
|
} |
1003
|
|
|
|
|
|
|
|
1004
|
|
|
|
|
|
|
=head2 $self->_leader_width() |
1005
|
|
|
|
|
|
|
|
1006
|
|
|
|
|
|
|
Calculates how long the leader should be based on the length of the |
1007
|
|
|
|
|
|
|
maximal test filename. |
1008
|
|
|
|
|
|
|
|
1009
|
|
|
|
|
|
|
=cut |
1010
|
|
|
|
|
|
|
|
1011
|
|
|
|
|
|
|
sub _leader_width |
1012
|
|
|
|
|
|
|
{ |
1013
|
51
|
|
|
51
|
|
137
|
my $self = shift; |
1014
|
|
|
|
|
|
|
|
1015
|
51
|
|
|
|
|
230
|
return $self->_get_max_filename_len() + 3 - $self->_get_max_ext_len(); |
1016
|
|
|
|
|
|
|
} |
1017
|
|
|
|
|
|
|
|
1018
|
|
|
|
|
|
|
sub _strap_bailout_handler |
1019
|
|
|
|
|
|
|
{ |
1020
|
2
|
|
|
2
|
|
14
|
my ($self, $args) = @_; |
1021
|
|
|
|
|
|
|
|
1022
|
2
|
|
|
|
|
72
|
die Test::Run::Obj::Error::TestsFail::Bailout->new( |
1023
|
|
|
|
|
|
|
{ |
1024
|
|
|
|
|
|
|
bailout_reason => $self->Strap->bailout_reason(), |
1025
|
|
|
|
|
|
|
text => "FOOBAR", |
1026
|
|
|
|
|
|
|
} |
1027
|
|
|
|
|
|
|
); |
1028
|
|
|
|
|
|
|
} |
1029
|
|
|
|
|
|
|
|
1030
|
|
|
|
|
|
|
sub _calc_failed_before_any_test_obj |
1031
|
|
|
|
|
|
|
{ |
1032
|
1
|
|
|
1
|
|
8
|
my $self = shift; |
1033
|
|
|
|
|
|
|
|
1034
|
|
|
|
|
|
|
return $self->_create_failed_obj_instance( |
1035
|
|
|
|
|
|
|
{ |
1036
|
|
|
|
|
|
|
(map |
1037
|
2
|
|
|
|
|
125
|
{ $_ => Test::Run::Obj::IntOrUnknown->create_unknown() } |
1038
|
|
|
|
|
|
|
qw(max failed) |
1039
|
|
|
|
|
|
|
), |
1040
|
|
|
|
|
|
|
canon => "??", |
1041
|
1
|
|
|
|
|
9
|
(map { $_ => "", } qw(estat wstat)), |
|
2
|
|
|
|
|
109
|
|
1042
|
|
|
|
|
|
|
percent => undef, |
1043
|
|
|
|
|
|
|
name => $self->_get_last_test_filename(), |
1044
|
|
|
|
|
|
|
}, |
1045
|
|
|
|
|
|
|
); |
1046
|
|
|
|
|
|
|
} |
1047
|
|
|
|
|
|
|
|
1048
|
|
|
|
|
|
|
sub _show_results |
1049
|
|
|
|
|
|
|
{ |
1050
|
23
|
|
|
23
|
|
109
|
my($self) = @_; |
1051
|
|
|
|
|
|
|
|
1052
|
23
|
|
|
|
|
217
|
$self->_show_success_or_failure(); |
1053
|
|
|
|
|
|
|
|
1054
|
15
|
|
|
|
|
127
|
$self->_report_final_stats(); |
1055
|
|
|
|
|
|
|
} |
1056
|
|
|
|
|
|
|
|
1057
|
|
|
|
|
|
|
sub _is_last_test_seen |
1058
|
|
|
|
|
|
|
{ |
1059
|
13
|
|
|
13
|
|
330
|
return shift->last_test_results->seen; |
1060
|
|
|
|
|
|
|
} |
1061
|
|
|
|
|
|
|
|
1062
|
|
|
|
|
|
|
sub _is_test_passing |
1063
|
|
|
|
|
|
|
{ |
1064
|
55
|
|
|
55
|
|
195
|
my $self = shift; |
1065
|
|
|
|
|
|
|
|
1066
|
55
|
|
|
|
|
1659
|
return $self->last_test_results->passing; |
1067
|
|
|
|
|
|
|
} |
1068
|
|
|
|
|
|
|
|
1069
|
|
|
|
|
|
|
sub _get_failed_and_max_params |
1070
|
|
|
|
|
|
|
{ |
1071
|
12
|
|
|
12
|
|
33
|
my $self = shift; |
1072
|
|
|
|
|
|
|
|
1073
|
12
|
|
|
|
|
303
|
my $last_test = $self->last_test_obj; |
1074
|
|
|
|
|
|
|
|
1075
|
|
|
|
|
|
|
return |
1076
|
|
|
|
|
|
|
[ |
1077
|
12
|
|
|
|
|
60
|
canon => $self->_failed_canon(), |
1078
|
|
|
|
|
|
|
failed => Test::Run::Obj::IntOrUnknown->create_int($last_test->num_failed()), |
1079
|
|
|
|
|
|
|
percent => $last_test->calc_percent(), |
1080
|
|
|
|
|
|
|
]; |
1081
|
|
|
|
|
|
|
} |
1082
|
|
|
|
|
|
|
|
1083
|
|
|
|
|
|
|
# The test program exited with a bad exit status. |
1084
|
|
|
|
|
|
|
sub _dubious_return |
1085
|
|
|
|
|
|
|
{ |
1086
|
6
|
|
|
6
|
|
35
|
my $self = shift; |
1087
|
|
|
|
|
|
|
|
1088
|
6
|
|
|
|
|
96
|
$self->_report_dubious(); |
1089
|
|
|
|
|
|
|
|
1090
|
6
|
|
|
|
|
55
|
$self->_inc_bad(); |
1091
|
|
|
|
|
|
|
|
1092
|
6
|
|
|
|
|
125
|
return $self->_calc_dubious_return_ret_value(); |
1093
|
|
|
|
|
|
|
} |
1094
|
|
|
|
|
|
|
|
1095
|
|
|
|
|
|
|
sub _get_fail_test_scripts_string |
1096
|
|
|
|
|
|
|
{ |
1097
|
7
|
|
|
7
|
|
16
|
my $self = shift; |
1098
|
|
|
|
|
|
|
|
1099
|
7
|
|
|
|
|
166
|
return $self->tot->fail_test_scripts_string(); |
1100
|
|
|
|
|
|
|
} |
1101
|
|
|
|
|
|
|
|
1102
|
|
|
|
|
|
|
sub _get_undef_tests_params |
1103
|
|
|
|
|
|
|
{ |
1104
|
2
|
|
|
2
|
|
7
|
my $self = shift; |
1105
|
|
|
|
|
|
|
|
1106
|
|
|
|
|
|
|
return |
1107
|
|
|
|
|
|
|
[ |
1108
|
2
|
|
|
|
|
21
|
canon => "??", |
1109
|
|
|
|
|
|
|
failed => Test::Run::Obj::IntOrUnknown->create_unknown(), |
1110
|
|
|
|
|
|
|
percent => undef, |
1111
|
|
|
|
|
|
|
]; |
1112
|
|
|
|
|
|
|
} |
1113
|
|
|
|
|
|
|
|
1114
|
|
|
|
|
|
|
sub _get_fail_tests_good_percent_string |
1115
|
|
|
|
|
|
|
{ |
1116
|
7
|
|
|
7
|
|
19
|
my $self = shift; |
1117
|
|
|
|
|
|
|
|
1118
|
7
|
|
|
|
|
177
|
return $self->tot->fail_tests_good_percent_string(); |
1119
|
|
|
|
|
|
|
} |
1120
|
|
|
|
|
|
|
|
1121
|
|
|
|
|
|
|
sub _get_FWRS_tests_existence_params |
1122
|
|
|
|
|
|
|
{ |
1123
|
12
|
|
|
12
|
|
41
|
my ($self) = @_; |
1124
|
|
|
|
|
|
|
|
1125
|
|
|
|
|
|
|
return |
1126
|
|
|
|
|
|
|
[ |
1127
|
|
|
|
|
|
|
$self->_is_failed_and_max() |
1128
|
10
|
|
|
|
|
75
|
? (@{$self->_get_failed_and_max_params()}) |
1129
|
12
|
100
|
|
|
|
48
|
: (@{$self->_get_undef_tests_params()}) |
|
2
|
|
|
|
|
20
|
|
1130
|
|
|
|
|
|
|
] |
1131
|
|
|
|
|
|
|
} |
1132
|
|
|
|
|
|
|
|
1133
|
|
|
|
|
|
|
sub _handle_runtests_error_text |
1134
|
|
|
|
|
|
|
{ |
1135
|
9
|
|
|
9
|
|
24
|
my $self = shift; |
1136
|
9
|
|
|
|
|
30
|
my $args = shift; |
1137
|
|
|
|
|
|
|
|
1138
|
9
|
|
|
|
|
20
|
my $text = $args->{'text'}; |
1139
|
|
|
|
|
|
|
|
1140
|
9
|
|
|
|
|
322
|
die $text; |
1141
|
|
|
|
|
|
|
} |
1142
|
|
|
|
|
|
|
|
1143
|
|
|
|
|
|
|
sub _is_error_object |
1144
|
|
|
|
|
|
|
{ |
1145
|
9
|
|
|
9
|
|
27
|
my $self = shift; |
1146
|
9
|
|
|
|
|
18
|
my $error = shift; |
1147
|
|
|
|
|
|
|
|
1148
|
|
|
|
|
|
|
return |
1149
|
|
|
|
|
|
|
( |
1150
|
9
|
|
33
|
|
|
196
|
Scalar::Util::blessed($error) && |
1151
|
|
|
|
|
|
|
$error->isa("Test::Run::Obj::Error::TestsFail") |
1152
|
|
|
|
|
|
|
); |
1153
|
|
|
|
|
|
|
} |
1154
|
|
|
|
|
|
|
|
1155
|
|
|
|
|
|
|
sub _get_runtests_error_text |
1156
|
|
|
|
|
|
|
{ |
1157
|
9
|
|
|
9
|
|
19
|
my $self = shift; |
1158
|
9
|
|
|
|
|
21
|
my $error = shift; |
1159
|
|
|
|
|
|
|
|
1160
|
|
|
|
|
|
|
return |
1161
|
9
|
50
|
|
|
|
79
|
($self->_is_error_object($error) |
1162
|
|
|
|
|
|
|
? $error->stringify() |
1163
|
|
|
|
|
|
|
: $error |
1164
|
|
|
|
|
|
|
); |
1165
|
|
|
|
|
|
|
} |
1166
|
|
|
|
|
|
|
|
1167
|
|
|
|
|
|
|
sub _is_no_tests_run |
1168
|
|
|
|
|
|
|
{ |
1169
|
8
|
|
|
8
|
|
35
|
my $self = shift; |
1170
|
|
|
|
|
|
|
|
1171
|
8
|
|
|
|
|
226
|
return (! $self->tot->tests()); |
1172
|
|
|
|
|
|
|
} |
1173
|
|
|
|
|
|
|
|
1174
|
|
|
|
|
|
|
sub _is_no_tests_output |
1175
|
|
|
|
|
|
|
{ |
1176
|
8
|
|
|
8
|
|
31
|
my $self = shift; |
1177
|
|
|
|
|
|
|
|
1178
|
8
|
|
|
|
|
192
|
return (! $self->tot->max()); |
1179
|
|
|
|
|
|
|
} |
1180
|
|
|
|
|
|
|
|
1181
|
|
|
|
|
|
|
sub _report_success |
1182
|
|
|
|
|
|
|
{ |
1183
|
15
|
|
|
15
|
|
35
|
my $self = shift; |
1184
|
15
|
|
|
|
|
304
|
$self->_report( |
1185
|
|
|
|
|
|
|
{ |
1186
|
|
|
|
|
|
|
'channel' => "success", |
1187
|
|
|
|
|
|
|
'event' => { 'type' => "success", }, |
1188
|
|
|
|
|
|
|
} |
1189
|
|
|
|
|
|
|
); |
1190
|
|
|
|
|
|
|
|
1191
|
15
|
|
|
|
|
76
|
return; |
1192
|
|
|
|
|
|
|
} |
1193
|
|
|
|
|
|
|
|
1194
|
|
|
|
|
|
|
sub _fail_other_if_bad |
1195
|
|
|
|
|
|
|
{ |
1196
|
7
|
|
|
7
|
|
18
|
my $self = shift; |
1197
|
|
|
|
|
|
|
|
1198
|
7
|
50
|
|
|
|
204
|
if ($self->tot->bad) |
1199
|
|
|
|
|
|
|
{ |
1200
|
7
|
|
|
|
|
302
|
$self->_fail_other_print_bonus_message(); |
1201
|
7
|
|
|
|
|
36
|
$self->_fail_other_throw_exception(); |
1202
|
|
|
|
|
|
|
} |
1203
|
|
|
|
|
|
|
|
1204
|
0
|
|
|
|
|
0
|
return; |
1205
|
|
|
|
|
|
|
} |
1206
|
|
|
|
|
|
|
|
1207
|
|
|
|
|
|
|
sub _calc__fail_other__callbacks |
1208
|
|
|
|
|
|
|
{ |
1209
|
7
|
|
|
7
|
|
18
|
my $self = shift; |
1210
|
|
|
|
|
|
|
|
1211
|
7
|
|
|
|
|
73
|
return [qw( |
1212
|
|
|
|
|
|
|
_create_fmts |
1213
|
|
|
|
|
|
|
_fail_other_print_top |
1214
|
|
|
|
|
|
|
_fail_other_print_all_tests |
1215
|
|
|
|
|
|
|
_fail_other_if_bad |
1216
|
|
|
|
|
|
|
)]; |
1217
|
|
|
|
|
|
|
} |
1218
|
|
|
|
|
|
|
|
1219
|
|
|
|
|
|
|
sub _fail_other |
1220
|
|
|
|
|
|
|
{ |
1221
|
7
|
|
|
7
|
|
61
|
shift->_run_sequence(); |
1222
|
|
|
|
|
|
|
|
1223
|
0
|
|
|
|
|
0
|
return; |
1224
|
|
|
|
|
|
|
} |
1225
|
|
|
|
|
|
|
|
1226
|
|
|
|
|
|
|
sub _show_success_or_failure |
1227
|
|
|
|
|
|
|
{ |
1228
|
23
|
|
|
23
|
|
65
|
my $self = shift; |
1229
|
|
|
|
|
|
|
|
1230
|
23
|
100
|
|
|
|
239
|
if ($self->_all_ok()) |
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1231
|
|
|
|
|
|
|
{ |
1232
|
15
|
|
|
|
|
412
|
return $self->_report_success(); |
1233
|
|
|
|
|
|
|
} |
1234
|
|
|
|
|
|
|
elsif ($self->_is_no_tests_run()) |
1235
|
|
|
|
|
|
|
{ |
1236
|
0
|
|
|
|
|
0
|
return $self->_fail_no_tests_run(); |
1237
|
|
|
|
|
|
|
} |
1238
|
|
|
|
|
|
|
elsif ($self->_is_no_tests_output()) |
1239
|
|
|
|
|
|
|
{ |
1240
|
1
|
|
|
|
|
17
|
return $self->_fail_no_tests_output(); |
1241
|
|
|
|
|
|
|
} |
1242
|
|
|
|
|
|
|
else |
1243
|
|
|
|
|
|
|
{ |
1244
|
7
|
|
|
|
|
56
|
return $self->_fail_other(); |
1245
|
|
|
|
|
|
|
} |
1246
|
|
|
|
|
|
|
} |
1247
|
|
|
|
|
|
|
|
1248
|
|
|
|
|
|
|
sub _handle_runtests_error |
1249
|
|
|
|
|
|
|
{ |
1250
|
9
|
|
|
9
|
|
39
|
my $self = shift; |
1251
|
9
|
|
|
|
|
22
|
my $args = shift; |
1252
|
9
|
|
|
|
|
20
|
my $error = $args->{'error'}; |
1253
|
|
|
|
|
|
|
|
1254
|
9
|
|
|
|
|
71
|
$self->_handle_runtests_error_text( |
1255
|
|
|
|
|
|
|
{ |
1256
|
|
|
|
|
|
|
'text' => $self->_get_runtests_error_text($error), |
1257
|
|
|
|
|
|
|
}, |
1258
|
|
|
|
|
|
|
); |
1259
|
|
|
|
|
|
|
} |
1260
|
|
|
|
|
|
|
|
1261
|
|
|
|
|
|
|
sub _get_canonfailed_params |
1262
|
|
|
|
|
|
|
{ |
1263
|
24
|
|
|
24
|
|
63
|
my $self = shift; |
1264
|
|
|
|
|
|
|
|
1265
|
24
|
|
|
|
|
103
|
return [failed => $self->_canonfailed_get_failed(),]; |
1266
|
|
|
|
|
|
|
} |
1267
|
|
|
|
|
|
|
|
1268
|
|
|
|
|
|
|
sub _create_canonfailed_obj_instance |
1269
|
|
|
|
|
|
|
{ |
1270
|
24
|
|
|
24
|
|
88
|
my ($self, $args) = @_; |
1271
|
|
|
|
|
|
|
|
1272
|
24
|
|
|
|
|
220
|
return $self->create_pluggable_helper_obj( |
1273
|
|
|
|
|
|
|
{ |
1274
|
|
|
|
|
|
|
id => "canon_failed", |
1275
|
|
|
|
|
|
|
args => $args, |
1276
|
|
|
|
|
|
|
} |
1277
|
|
|
|
|
|
|
); |
1278
|
|
|
|
|
|
|
} |
1279
|
|
|
|
|
|
|
|
1280
|
|
|
|
|
|
|
sub _canonfailed_get_canon |
1281
|
|
|
|
|
|
|
{ |
1282
|
24
|
|
|
24
|
|
70
|
my ($self) = @_; |
1283
|
|
|
|
|
|
|
|
1284
|
|
|
|
|
|
|
return $self->_create_canonfailed_obj_instance( |
1285
|
|
|
|
|
|
|
{ |
1286
|
24
|
|
|
|
|
54
|
@{$self->_get_canonfailed_params()}, |
|
24
|
|
|
|
|
132
|
|
1287
|
|
|
|
|
|
|
} |
1288
|
|
|
|
|
|
|
); |
1289
|
|
|
|
|
|
|
} |
1290
|
|
|
|
|
|
|
|
1291
|
|
|
|
|
|
|
sub _prepare_for_single_test_run |
1292
|
|
|
|
|
|
|
{ |
1293
|
57
|
|
|
57
|
|
161
|
my ($self, $args) = @_; |
1294
|
|
|
|
|
|
|
|
1295
|
57
|
|
|
|
|
244
|
$self->_tot_inc('files'); |
1296
|
|
|
|
|
|
|
|
1297
|
57
|
|
|
|
|
1320
|
$self->Strap()->_seen_header(0); |
1298
|
|
|
|
|
|
|
|
1299
|
57
|
|
|
|
|
529
|
$self->_report_single_test_file_start($args); |
1300
|
|
|
|
|
|
|
|
1301
|
57
|
|
|
|
|
208
|
return; |
1302
|
|
|
|
|
|
|
} |
1303
|
|
|
|
|
|
|
|
1304
|
|
|
|
|
|
|
|
1305
|
|
|
|
|
|
|
sub _calc__run_single_test__callbacks |
1306
|
|
|
|
|
|
|
{ |
1307
|
57
|
|
|
57
|
|
138
|
my $self = shift; |
1308
|
|
|
|
|
|
|
|
1309
|
57
|
|
|
|
|
256
|
return [qw( |
1310
|
|
|
|
|
|
|
_prepare_for_single_test_run |
1311
|
|
|
|
|
|
|
_time_single_test |
1312
|
|
|
|
|
|
|
_calc_test_struct |
1313
|
|
|
|
|
|
|
_process_test_file_results |
1314
|
|
|
|
|
|
|
_recheck_dir_files |
1315
|
|
|
|
|
|
|
)]; |
1316
|
|
|
|
|
|
|
} |
1317
|
|
|
|
|
|
|
|
1318
|
|
|
|
|
|
|
sub _run_single_test |
1319
|
|
|
|
|
|
|
{ |
1320
|
57
|
|
|
57
|
|
171
|
my ($self, $args) = @_; |
1321
|
|
|
|
|
|
|
|
1322
|
57
|
|
|
|
|
316
|
$self->_run_sequence([$args]); |
1323
|
|
|
|
|
|
|
|
1324
|
55
|
|
|
|
|
1377
|
return; |
1325
|
|
|
|
|
|
|
} |
1326
|
|
|
|
|
|
|
|
1327
|
|
|
|
|
|
|
sub _list_tests_as_failures |
1328
|
|
|
|
|
|
|
{ |
1329
|
19
|
|
|
19
|
|
63
|
my $self = shift; |
1330
|
|
|
|
|
|
|
|
1331
|
|
|
|
|
|
|
return |
1332
|
19
|
|
|
|
|
447
|
$self->last_test_obj->list_tests_as_failures( |
1333
|
|
|
|
|
|
|
$self->last_test_results->details() |
1334
|
|
|
|
|
|
|
); |
1335
|
|
|
|
|
|
|
} |
1336
|
|
|
|
|
|
|
|
1337
|
|
|
|
|
|
|
sub _process_test_file_results |
1338
|
|
|
|
|
|
|
{ |
1339
|
55
|
|
|
55
|
|
227
|
my ($self) = @_; |
1340
|
|
|
|
|
|
|
|
1341
|
55
|
100
|
|
|
|
617
|
if ($self->_is_test_passing()) |
1342
|
|
|
|
|
|
|
{ |
1343
|
36
|
|
|
|
|
392
|
$self->_handle_passing_test(); |
1344
|
|
|
|
|
|
|
} |
1345
|
|
|
|
|
|
|
else |
1346
|
|
|
|
|
|
|
{ |
1347
|
19
|
|
|
|
|
166
|
$self->_list_tests_as_failures(); |
1348
|
19
|
|
|
|
|
1381
|
$self->_add_to_failed_tests(); |
1349
|
|
|
|
|
|
|
} |
1350
|
|
|
|
|
|
|
|
1351
|
55
|
|
|
|
|
283
|
return; |
1352
|
|
|
|
|
|
|
} |
1353
|
|
|
|
|
|
|
|
1354
|
|
|
|
|
|
|
sub _check_for_ok |
1355
|
|
|
|
|
|
|
{ |
1356
|
16
|
|
|
16
|
|
450
|
my $self = shift; |
1357
|
|
|
|
|
|
|
|
1358
|
16
|
|
50
|
|
|
432
|
assert( ($self->_all_ok() xor keys(%{$self->failed_tests()})), |
|
16
|
|
|
|
|
596
|
|
1359
|
|
|
|
|
|
|
q{$ok is mutually exclusive with %$failed_tests} |
1360
|
|
|
|
|
|
|
); |
1361
|
|
|
|
|
|
|
|
1362
|
15
|
|
|
|
|
107
|
return; |
1363
|
|
|
|
|
|
|
|
1364
|
|
|
|
|
|
|
} |
1365
|
|
|
|
|
|
|
|
1366
|
|
|
|
|
|
|
sub _calc_test_file_data_display_path |
1367
|
|
|
|
|
|
|
{ |
1368
|
57
|
|
|
57
|
|
177
|
my ($self, $idx, $test_file) = @_; |
1369
|
|
|
|
|
|
|
|
1370
|
57
|
|
|
|
|
1692
|
return $test_file; |
1371
|
|
|
|
|
|
|
} |
1372
|
|
|
|
|
|
|
|
1373
|
|
|
|
|
|
|
sub _get_test_file_display_path |
1374
|
|
|
|
|
|
|
{ |
1375
|
174
|
|
|
174
|
|
431
|
my ($self, $test_file) = @_; |
1376
|
|
|
|
|
|
|
|
1377
|
174
|
|
|
|
|
4178
|
return $self->test_files_data()->{$test_file}->{display_path}; |
1378
|
|
|
|
|
|
|
} |
1379
|
|
|
|
|
|
|
|
1380
|
|
|
|
|
|
|
sub _calc_test_file_data_struct |
1381
|
|
|
|
|
|
|
{ |
1382
|
57
|
|
|
57
|
|
161
|
my ($self, $idx, $test_file) = @_; |
1383
|
|
|
|
|
|
|
|
1384
|
|
|
|
|
|
|
return |
1385
|
|
|
|
|
|
|
{ |
1386
|
57
|
|
|
|
|
280
|
idx => $idx, |
1387
|
|
|
|
|
|
|
real_path => $test_file, |
1388
|
|
|
|
|
|
|
display_path => $self->_calc_test_file_data_display_path($idx, $test_file), |
1389
|
|
|
|
|
|
|
}; |
1390
|
|
|
|
|
|
|
} |
1391
|
|
|
|
|
|
|
|
1392
|
|
|
|
|
|
|
sub _prepare_test_files_data |
1393
|
|
|
|
|
|
|
{ |
1394
|
51
|
|
|
51
|
|
155
|
my $self = shift; |
1395
|
|
|
|
|
|
|
|
1396
|
51
|
|
|
|
|
119
|
foreach my $idx (0 .. $#{$self->test_files()}) |
|
51
|
|
|
|
|
1903
|
|
1397
|
|
|
|
|
|
|
{ |
1398
|
57
|
|
|
|
|
1516
|
my $test_file = $self->test_files()->[$idx]; |
1399
|
|
|
|
|
|
|
|
1400
|
57
|
|
|
|
|
292
|
$self->test_files_data()->{$test_file} = |
1401
|
|
|
|
|
|
|
$self->_calc_test_file_data_struct($idx, $test_file); |
1402
|
|
|
|
|
|
|
} |
1403
|
|
|
|
|
|
|
} |
1404
|
|
|
|
|
|
|
|
1405
|
|
|
|
|
|
|
sub _calc__real_runtests__callbacks |
1406
|
|
|
|
|
|
|
{ |
1407
|
24
|
|
|
24
|
|
59
|
my $self = shift; |
1408
|
|
|
|
|
|
|
|
1409
|
|
|
|
|
|
|
return |
1410
|
24
|
|
|
|
|
119
|
[qw( |
1411
|
|
|
|
|
|
|
_run_all_tests |
1412
|
|
|
|
|
|
|
_show_results |
1413
|
|
|
|
|
|
|
_check_for_ok |
1414
|
|
|
|
|
|
|
)]; |
1415
|
|
|
|
|
|
|
} |
1416
|
|
|
|
|
|
|
|
1417
|
|
|
|
|
|
|
sub _real_runtests |
1418
|
|
|
|
|
|
|
{ |
1419
|
24
|
|
|
24
|
|
402
|
shift->_run_sequence(); |
1420
|
|
|
|
|
|
|
|
1421
|
15
|
|
|
|
|
279
|
return; |
1422
|
|
|
|
|
|
|
} |
1423
|
|
|
|
|
|
|
|
1424
|
|
|
|
|
|
|
sub runtests |
1425
|
|
|
|
|
|
|
{ |
1426
|
24
|
|
|
24
|
1
|
86
|
my $self = shift; |
1427
|
|
|
|
|
|
|
|
1428
|
24
|
|
|
|
|
101
|
local ($\, $,); |
1429
|
|
|
|
|
|
|
|
1430
|
24
|
|
|
|
|
52
|
eval { $self->_real_runtests(@_) }; |
|
24
|
|
|
|
|
204
|
|
1431
|
|
|
|
|
|
|
|
1432
|
24
|
|
|
|
|
1703
|
my $error = $@; |
1433
|
|
|
|
|
|
|
|
1434
|
24
|
|
|
|
|
166
|
my $ok = $self->_all_ok(); |
1435
|
|
|
|
|
|
|
|
1436
|
24
|
100
|
|
|
|
114
|
if ($error) |
1437
|
|
|
|
|
|
|
{ |
1438
|
9
|
|
|
|
|
142
|
return $self->_handle_runtests_error( |
1439
|
|
|
|
|
|
|
{ |
1440
|
|
|
|
|
|
|
ok => $ok, |
1441
|
|
|
|
|
|
|
error => $error, |
1442
|
|
|
|
|
|
|
} |
1443
|
|
|
|
|
|
|
); |
1444
|
|
|
|
|
|
|
} |
1445
|
|
|
|
|
|
|
else |
1446
|
|
|
|
|
|
|
{ |
1447
|
15
|
|
|
|
|
371
|
return $ok; |
1448
|
|
|
|
|
|
|
} |
1449
|
|
|
|
|
|
|
} |
1450
|
|
|
|
|
|
|
|
1451
|
|
|
|
|
|
|
sub _get_bonusmsg |
1452
|
|
|
|
|
|
|
{ |
1453
|
15
|
|
|
15
|
|
48
|
my $self = shift; |
1454
|
|
|
|
|
|
|
|
1455
|
15
|
50
|
|
|
|
605
|
if (! defined($self->_bonusmsg())) |
1456
|
|
|
|
|
|
|
{ |
1457
|
15
|
|
|
|
|
418
|
$self->_bonusmsg($self->tot()->get_bonusmsg()); |
1458
|
|
|
|
|
|
|
} |
1459
|
|
|
|
|
|
|
|
1460
|
15
|
|
|
|
|
446
|
return $self->_bonusmsg(); |
1461
|
|
|
|
|
|
|
} |
1462
|
|
|
|
|
|
|
|
1463
|
|
|
|
|
|
|
sub _autoflush_file_handles |
1464
|
|
|
|
|
|
|
{ |
1465
|
51
|
|
|
51
|
|
152
|
my $self = shift; |
1466
|
|
|
|
|
|
|
|
1467
|
51
|
|
|
|
|
463
|
STDOUT->autoflush(1); |
1468
|
51
|
|
|
|
|
3175
|
STDERR->autoflush(1); |
1469
|
|
|
|
|
|
|
} |
1470
|
|
|
|
|
|
|
|
1471
|
|
|
|
|
|
|
sub _init_failed_tests |
1472
|
|
|
|
|
|
|
{ |
1473
|
51
|
|
|
51
|
|
111
|
my $self = shift; |
1474
|
|
|
|
|
|
|
|
1475
|
51
|
|
|
|
|
1536
|
$self->failed_tests({}); |
1476
|
|
|
|
|
|
|
} |
1477
|
|
|
|
|
|
|
|
1478
|
|
|
|
|
|
|
sub _prepare_run_all_tests |
1479
|
|
|
|
|
|
|
{ |
1480
|
51
|
|
|
51
|
|
132
|
my $self = shift; |
1481
|
|
|
|
|
|
|
|
1482
|
51
|
|
|
|
|
332
|
$self->_prepare_test_files_data(); |
1483
|
|
|
|
|
|
|
|
1484
|
51
|
|
|
|
|
256
|
$self->_autoflush_file_handles(); |
1485
|
|
|
|
|
|
|
|
1486
|
51
|
|
|
|
|
1430
|
$self->_init_failed_tests(); |
1487
|
|
|
|
|
|
|
|
1488
|
51
|
|
|
|
|
262
|
$self->_init_tot(); |
1489
|
|
|
|
|
|
|
|
1490
|
51
|
|
|
|
|
494
|
$self->_init_dir_files(); |
1491
|
|
|
|
|
|
|
|
1492
|
51
|
|
|
|
|
187
|
return; |
1493
|
|
|
|
|
|
|
} |
1494
|
|
|
|
|
|
|
|
1495
|
|
|
|
|
|
|
# FWRS == failed_with_results_seen |
1496
|
|
|
|
|
|
|
sub _get_common_FWRS_params |
1497
|
|
|
|
|
|
|
{ |
1498
|
12
|
|
|
12
|
|
31
|
my $self = shift; |
1499
|
|
|
|
|
|
|
|
1500
|
|
|
|
|
|
|
return |
1501
|
|
|
|
|
|
|
[ |
1502
|
12
|
|
|
|
|
335
|
max => Test::Run::Obj::IntOrUnknown->create_int( |
1503
|
|
|
|
|
|
|
$self->last_test_obj->max() |
1504
|
|
|
|
|
|
|
), |
1505
|
|
|
|
|
|
|
name => $self->_get_last_test_filename(), |
1506
|
|
|
|
|
|
|
estat => "", |
1507
|
|
|
|
|
|
|
wstat => "", |
1508
|
|
|
|
|
|
|
list_len => $self->list_len(), |
1509
|
|
|
|
|
|
|
]; |
1510
|
|
|
|
|
|
|
} |
1511
|
|
|
|
|
|
|
|
1512
|
|
|
|
|
|
|
sub _get_failed_with_results_seen_params |
1513
|
|
|
|
|
|
|
{ |
1514
|
12
|
|
|
12
|
|
52
|
my ($self) = @_; |
1515
|
|
|
|
|
|
|
|
1516
|
|
|
|
|
|
|
return |
1517
|
|
|
|
|
|
|
{ |
1518
|
12
|
|
|
|
|
83
|
@{$self->_get_common_FWRS_params()}, |
1519
|
12
|
|
|
|
|
35
|
@{$self->_get_FWRS_tests_existence_params()}, |
|
12
|
|
|
|
|
123
|
|
1520
|
|
|
|
|
|
|
} |
1521
|
|
|
|
|
|
|
} |
1522
|
|
|
|
|
|
|
|
1523
|
|
|
|
|
|
|
sub _failed_with_results_seen |
1524
|
|
|
|
|
|
|
{ |
1525
|
12
|
|
|
12
|
|
28
|
my $self = shift; |
1526
|
|
|
|
|
|
|
|
1527
|
12
|
|
|
|
|
109
|
$self->_inc_bad(); |
1528
|
|
|
|
|
|
|
|
1529
|
12
|
|
|
|
|
125
|
$self->_report_failed_with_results_seen(); |
1530
|
|
|
|
|
|
|
|
1531
|
|
|
|
|
|
|
return |
1532
|
12
|
|
|
|
|
88
|
$self->_create_failed_obj_instance( |
1533
|
|
|
|
|
|
|
$self->_get_failed_with_results_seen_params(), |
1534
|
|
|
|
|
|
|
); |
1535
|
|
|
|
|
|
|
} |
1536
|
|
|
|
|
|
|
|
1537
|
|
|
|
|
|
|
sub _get_failed_struct |
1538
|
|
|
|
|
|
|
{ |
1539
|
19
|
|
|
19
|
|
69
|
my ($self) = @_; |
1540
|
|
|
|
|
|
|
|
1541
|
19
|
100
|
|
|
|
234
|
if ($self->_get_wstatus()) |
|
|
100
|
|
|
|
|
|
1542
|
|
|
|
|
|
|
{ |
1543
|
6
|
|
|
|
|
115
|
return $self->_dubious_return(); |
1544
|
|
|
|
|
|
|
} |
1545
|
|
|
|
|
|
|
elsif($self->_is_last_test_seen()) |
1546
|
|
|
|
|
|
|
{ |
1547
|
12
|
|
|
|
|
94
|
return $self->_failed_with_results_seen(); |
1548
|
|
|
|
|
|
|
} |
1549
|
|
|
|
|
|
|
else |
1550
|
|
|
|
|
|
|
{ |
1551
|
1
|
|
|
|
|
44
|
return $self->_failed_before_any_test_output(); |
1552
|
|
|
|
|
|
|
} |
1553
|
|
|
|
|
|
|
} |
1554
|
|
|
|
|
|
|
|
1555
|
|
|
|
|
|
|
sub _add_to_failed_tests |
1556
|
|
|
|
|
|
|
{ |
1557
|
19
|
|
|
19
|
|
64
|
my $self = shift; |
1558
|
|
|
|
|
|
|
|
1559
|
19
|
|
|
|
|
188
|
$self->failed_tests()->{$self->_get_last_test_filename()} = |
1560
|
|
|
|
|
|
|
$self->_get_failed_struct(); |
1561
|
|
|
|
|
|
|
|
1562
|
19
|
|
|
|
|
60
|
return; |
1563
|
|
|
|
|
|
|
} |
1564
|
|
|
|
|
|
|
|
1565
|
|
|
|
|
|
|
sub _get_last_test_filename |
1566
|
|
|
|
|
|
|
{ |
1567
|
32
|
|
|
32
|
|
1223
|
my $self = shift; |
1568
|
|
|
|
|
|
|
|
1569
|
32
|
|
|
|
|
887
|
return $self->last_test_results->filename(); |
1570
|
|
|
|
|
|
|
} |
1571
|
|
|
|
|
|
|
|
1572
|
|
|
|
|
|
|
sub _init_dir_files |
1573
|
|
|
|
|
|
|
{ |
1574
|
51
|
|
|
51
|
|
138
|
my $self = shift; |
1575
|
|
|
|
|
|
|
|
1576
|
51
|
100
|
|
|
|
1458
|
if (defined($self->Leaked_Dir())) |
1577
|
|
|
|
|
|
|
{ |
1578
|
2
|
|
|
|
|
33
|
$self->dir_files($self->_get_dir_files()); |
1579
|
|
|
|
|
|
|
} |
1580
|
|
|
|
|
|
|
} |
1581
|
|
|
|
|
|
|
|
1582
|
|
|
|
|
|
|
sub _run_all_tests_loop |
1583
|
|
|
|
|
|
|
{ |
1584
|
51
|
|
|
51
|
|
106
|
my $self = shift; |
1585
|
|
|
|
|
|
|
|
1586
|
51
|
|
|
|
|
105
|
foreach my $test_file_path (@{$self->test_files()}) |
|
51
|
|
|
|
|
1247
|
|
1587
|
|
|
|
|
|
|
{ |
1588
|
57
|
|
|
|
|
386
|
$self->_run_single_test({ test_file => $test_file_path}); |
1589
|
|
|
|
|
|
|
} |
1590
|
|
|
|
|
|
|
} |
1591
|
|
|
|
|
|
|
|
1592
|
|
|
|
|
|
|
sub _run_all_tests__run_loop |
1593
|
|
|
|
|
|
|
{ |
1594
|
51
|
|
|
51
|
|
145
|
my $self = shift; |
1595
|
|
|
|
|
|
|
|
1596
|
|
|
|
|
|
|
$self->tot->benchmark_callback( |
1597
|
|
|
|
|
|
|
sub { |
1598
|
51
|
|
|
51
|
|
374
|
$self->width($self->_leader_width()); |
1599
|
51
|
|
|
|
|
247
|
$self->_run_all_tests_loop(); |
1600
|
|
|
|
|
|
|
} |
1601
|
51
|
|
|
|
|
1181
|
); |
1602
|
|
|
|
|
|
|
} |
1603
|
|
|
|
|
|
|
|
1604
|
|
|
|
|
|
|
sub _finalize_run_all_tests |
1605
|
|
|
|
|
|
|
{ |
1606
|
49
|
|
|
49
|
|
122
|
my $self = shift; |
1607
|
|
|
|
|
|
|
|
1608
|
49
|
|
|
|
|
1446
|
$self->Strap()->_restore_PERL5LIB(); |
1609
|
|
|
|
|
|
|
} |
1610
|
|
|
|
|
|
|
|
1611
|
|
|
|
|
|
|
sub _calc__run_all_tests__callbacks |
1612
|
|
|
|
|
|
|
{ |
1613
|
51
|
|
|
51
|
|
112
|
my $self = shift; |
1614
|
|
|
|
|
|
|
|
1615
|
|
|
|
|
|
|
return |
1616
|
51
|
|
|
|
|
205
|
[qw( |
1617
|
|
|
|
|
|
|
_prepare_run_all_tests |
1618
|
|
|
|
|
|
|
_run_all_tests__run_loop |
1619
|
|
|
|
|
|
|
_finalize_run_all_tests |
1620
|
|
|
|
|
|
|
)]; |
1621
|
|
|
|
|
|
|
} |
1622
|
|
|
|
|
|
|
|
1623
|
|
|
|
|
|
|
sub _run_all_tests { |
1624
|
51
|
|
|
51
|
|
733
|
shift->_run_sequence(); |
1625
|
|
|
|
|
|
|
|
1626
|
49
|
|
|
|
|
489
|
return; |
1627
|
|
|
|
|
|
|
} |
1628
|
|
|
|
|
|
|
|
1629
|
|
|
|
|
|
|
|
1630
|
|
|
|
|
|
|
sub _get_dubious_summary_all_subtests_successful |
1631
|
|
|
|
|
|
|
{ |
1632
|
1
|
|
|
1
|
|
10
|
my ($self, $args) = @_; |
1633
|
|
|
|
|
|
|
|
1634
|
1
|
|
|
|
|
20
|
$self->_report_dubious_summary_all_subtests_successful(); |
1635
|
|
|
|
|
|
|
|
1636
|
|
|
|
|
|
|
return |
1637
|
|
|
|
|
|
|
[ |
1638
|
1
|
|
|
|
|
21
|
failed => Test::Run::Obj::IntOrUnknown->zero(), |
1639
|
|
|
|
|
|
|
percent => 0, |
1640
|
|
|
|
|
|
|
canon => "??", |
1641
|
|
|
|
|
|
|
]; |
1642
|
|
|
|
|
|
|
} |
1643
|
|
|
|
|
|
|
|
1644
|
|
|
|
|
|
|
sub _get_no_tests_summary |
1645
|
|
|
|
|
|
|
{ |
1646
|
3
|
|
|
3
|
|
15
|
my ($self, $args) = @_; |
1647
|
|
|
|
|
|
|
|
1648
|
|
|
|
|
|
|
return |
1649
|
|
|
|
|
|
|
[ |
1650
|
3
|
|
|
|
|
76
|
failed => Test::Run::Obj::IntOrUnknown->create_unknown(), |
1651
|
|
|
|
|
|
|
canon => "??", |
1652
|
|
|
|
|
|
|
percent => undef(), |
1653
|
|
|
|
|
|
|
]; |
1654
|
|
|
|
|
|
|
} |
1655
|
|
|
|
|
|
|
|
1656
|
|
|
|
|
|
|
sub _get_dubious_summary |
1657
|
|
|
|
|
|
|
{ |
1658
|
6
|
|
|
6
|
|
39
|
my ($self, $args) = @_; |
1659
|
|
|
|
|
|
|
|
1660
|
6
|
|
|
|
|
167
|
my $method = $self->last_test_obj->get_dubious_summary_main_obj_method(); |
1661
|
|
|
|
|
|
|
|
1662
|
6
|
|
|
|
|
102
|
return $self->$method($args); |
1663
|
|
|
|
|
|
|
} |
1664
|
|
|
|
|
|
|
|
1665
|
|
|
|
|
|
|
sub _get_skipped_bonusmsg |
1666
|
|
|
|
|
|
|
{ |
1667
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
1668
|
|
|
|
|
|
|
|
1669
|
0
|
|
|
|
|
0
|
return $self->tot->_get_skipped_bonusmsg(); |
1670
|
|
|
|
|
|
|
} |
1671
|
|
|
|
|
|
|
|
1672
|
|
|
|
|
|
|
sub _get_wstatus |
1673
|
|
|
|
|
|
|
{ |
1674
|
25
|
|
|
25
|
|
63
|
my $self = shift; |
1675
|
|
|
|
|
|
|
|
1676
|
25
|
|
|
|
|
660
|
return $self->last_test_results->wait; |
1677
|
|
|
|
|
|
|
} |
1678
|
|
|
|
|
|
|
|
1679
|
|
|
|
|
|
|
sub _get_estatus |
1680
|
|
|
|
|
|
|
{ |
1681
|
6
|
|
|
6
|
|
23
|
my $self = shift; |
1682
|
|
|
|
|
|
|
|
1683
|
6
|
|
|
|
|
183
|
return $self->last_test_results->exit; |
1684
|
|
|
|
|
|
|
} |
1685
|
|
|
|
|
|
|
|
1686
|
|
|
|
|
|
|
sub _get_format_failed_str |
1687
|
|
|
|
|
|
|
{ |
1688
|
15
|
|
|
15
|
|
36
|
my $self = shift; |
1689
|
|
|
|
|
|
|
|
1690
|
15
|
|
|
|
|
69
|
return "Failed Test"; |
1691
|
|
|
|
|
|
|
} |
1692
|
|
|
|
|
|
|
|
1693
|
|
|
|
|
|
|
sub _get_format_failed_str_len |
1694
|
|
|
|
|
|
|
{ |
1695
|
8
|
|
|
8
|
|
22
|
my $self = shift; |
1696
|
|
|
|
|
|
|
|
1697
|
8
|
|
|
|
|
51
|
return length($self->_get_format_failed_str()); |
1698
|
|
|
|
|
|
|
} |
1699
|
|
|
|
|
|
|
|
1700
|
|
|
|
|
|
|
sub _get_num_columns |
1701
|
|
|
|
|
|
|
{ |
1702
|
7
|
|
|
7
|
|
14
|
my $self = shift; |
1703
|
|
|
|
|
|
|
|
1704
|
|
|
|
|
|
|
# Some shells don't handle a full line of text well so we increment |
1705
|
|
|
|
|
|
|
# 1. |
1706
|
7
|
|
|
|
|
258
|
return ($self->Columns() - 1); |
1707
|
|
|
|
|
|
|
} |
1708
|
|
|
|
|
|
|
|
1709
|
|
|
|
|
|
|
# Find the maximal name length among the failed_tests(). |
1710
|
|
|
|
|
|
|
sub _calc_initial_max_namelen |
1711
|
|
|
|
|
|
|
{ |
1712
|
7
|
|
|
7
|
|
17
|
my $self = shift; |
1713
|
|
|
|
|
|
|
|
1714
|
7
|
|
|
|
|
40
|
my $max = $self->_get_format_failed_str_len(); |
1715
|
|
|
|
|
|
|
|
1716
|
7
|
|
|
|
|
19
|
while (my ($k, $v) = each(%{$self->failed_tests()})) |
|
14
|
|
|
|
|
395
|
|
1717
|
|
|
|
|
|
|
{ |
1718
|
7
|
|
|
|
|
20
|
my $l = length($v->{name}); |
1719
|
|
|
|
|
|
|
|
1720
|
7
|
50
|
|
|
|
43
|
if ($l > $max) |
1721
|
|
|
|
|
|
|
{ |
1722
|
7
|
|
|
|
|
21
|
$max = $l; |
1723
|
|
|
|
|
|
|
} |
1724
|
|
|
|
|
|
|
} |
1725
|
|
|
|
|
|
|
|
1726
|
7
|
|
|
|
|
208
|
$self->max_namelen($max); |
1727
|
|
|
|
|
|
|
|
1728
|
7
|
|
|
|
|
29
|
return; |
1729
|
|
|
|
|
|
|
} |
1730
|
|
|
|
|
|
|
|
1731
|
|
|
|
|
|
|
sub _calc_len_subtraction |
1732
|
|
|
|
|
|
|
{ |
1733
|
8
|
|
|
8
|
|
48
|
my ($self, $field) = @_; |
1734
|
|
|
|
|
|
|
|
1735
|
8
|
|
|
|
|
226
|
return $self->format_columns() |
1736
|
|
|
|
|
|
|
- $self->_get_fmt_mid_str_len() |
1737
|
|
|
|
|
|
|
- $self->$field() |
1738
|
|
|
|
|
|
|
; |
1739
|
|
|
|
|
|
|
} |
1740
|
|
|
|
|
|
|
|
1741
|
|
|
|
|
|
|
sub _calc_initial_list_len |
1742
|
|
|
|
|
|
|
{ |
1743
|
7
|
|
|
7
|
|
33
|
my $self = shift; |
1744
|
|
|
|
|
|
|
|
1745
|
7
|
|
|
|
|
42
|
$self->format_columns($self->_get_num_columns()); |
1746
|
|
|
|
|
|
|
|
1747
|
7
|
|
|
|
|
45
|
$self->list_len( |
1748
|
|
|
|
|
|
|
$self->_calc_len_subtraction("max_namelen") |
1749
|
|
|
|
|
|
|
); |
1750
|
|
|
|
|
|
|
|
1751
|
7
|
|
|
|
|
15
|
return; |
1752
|
|
|
|
|
|
|
} |
1753
|
|
|
|
|
|
|
|
1754
|
|
|
|
|
|
|
sub _calc_updated_lens |
1755
|
|
|
|
|
|
|
{ |
1756
|
1
|
|
|
1
|
|
15
|
my $self = shift; |
1757
|
|
|
|
|
|
|
|
1758
|
1
|
|
|
|
|
16
|
$self->list_len($self->_get_fmt_list_str_len); |
1759
|
1
|
|
|
|
|
50
|
$self->max_namelen($self->_calc_len_subtraction("list_len")); |
1760
|
|
|
|
|
|
|
} |
1761
|
|
|
|
|
|
|
|
1762
|
|
|
|
|
|
|
sub _calc_more_updated_lens |
1763
|
|
|
|
|
|
|
{ |
1764
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
1765
|
|
|
|
|
|
|
|
1766
|
0
|
|
|
|
|
0
|
$self->max_namelen($self->_get_format_failed_str_len()); |
1767
|
|
|
|
|
|
|
|
1768
|
0
|
|
|
|
|
0
|
$self->format_columns( |
1769
|
|
|
|
|
|
|
$self->max_namelen() |
1770
|
|
|
|
|
|
|
+ $self->_get_fmt_mid_str_len() |
1771
|
|
|
|
|
|
|
+ $self->list_len() |
1772
|
|
|
|
|
|
|
); |
1773
|
|
|
|
|
|
|
} |
1774
|
|
|
|
|
|
|
|
1775
|
|
|
|
|
|
|
sub _calc_fmt_list_len |
1776
|
|
|
|
|
|
|
{ |
1777
|
7
|
|
|
7
|
|
16
|
my $self = shift; |
1778
|
|
|
|
|
|
|
|
1779
|
7
|
|
|
|
|
61
|
$self->_calc_initial_list_len(); |
1780
|
|
|
|
|
|
|
|
1781
|
7
|
100
|
|
|
|
186
|
if ($self->list_len() < $self->_get_fmt_list_str_len()) { |
1782
|
1
|
|
|
|
|
53
|
$self->_calc_updated_lens(); |
1783
|
1
|
50
|
|
|
|
36
|
if ($self->max_namelen() < $self->_get_format_failed_str_len()) |
1784
|
|
|
|
|
|
|
{ |
1785
|
0
|
|
|
|
|
0
|
$self->_calc_more_updated_lens(); |
1786
|
|
|
|
|
|
|
} |
1787
|
|
|
|
|
|
|
} |
1788
|
|
|
|
|
|
|
|
1789
|
7
|
|
|
|
|
20
|
return; |
1790
|
|
|
|
|
|
|
} |
1791
|
|
|
|
|
|
|
|
1792
|
|
|
|
|
|
|
sub _calc_format_widths |
1793
|
|
|
|
|
|
|
{ |
1794
|
7
|
|
|
7
|
|
21
|
my $self = shift; |
1795
|
|
|
|
|
|
|
|
1796
|
7
|
|
|
|
|
107
|
$self->_calc_initial_max_namelen(); |
1797
|
|
|
|
|
|
|
|
1798
|
7
|
|
|
|
|
59
|
$self->_calc_fmt_list_len(); |
1799
|
|
|
|
|
|
|
|
1800
|
7
|
|
|
|
|
42
|
return; |
1801
|
|
|
|
|
|
|
} |
1802
|
|
|
|
|
|
|
|
1803
|
|
|
|
|
|
|
sub _get_format_middle_str |
1804
|
|
|
|
|
|
|
{ |
1805
|
15
|
|
|
15
|
|
28
|
my $self = shift; |
1806
|
|
|
|
|
|
|
|
1807
|
15
|
|
|
|
|
272
|
return " Stat Wstat Total Fail Failed "; |
1808
|
|
|
|
|
|
|
} |
1809
|
|
|
|
|
|
|
|
1810
|
|
|
|
|
|
|
sub _get_fmt_mid_str_len |
1811
|
|
|
|
|
|
|
{ |
1812
|
8
|
|
|
8
|
|
21
|
my $self = shift; |
1813
|
|
|
|
|
|
|
|
1814
|
8
|
|
|
|
|
81
|
return length($self->_get_format_middle_str()); |
1815
|
|
|
|
|
|
|
} |
1816
|
|
|
|
|
|
|
|
1817
|
|
|
|
|
|
|
sub _get_fmt_list_str_len |
1818
|
|
|
|
|
|
|
{ |
1819
|
8
|
|
|
8
|
|
25
|
my $self = shift; |
1820
|
|
|
|
|
|
|
|
1821
|
8
|
|
|
|
|
60
|
return length($self->_get_format_list_str()); |
1822
|
|
|
|
|
|
|
} |
1823
|
|
|
|
|
|
|
|
1824
|
|
|
|
|
|
|
sub _get_format_list_str |
1825
|
|
|
|
|
|
|
{ |
1826
|
15
|
|
|
15
|
|
24
|
my $self = shift; |
1827
|
|
|
|
|
|
|
|
1828
|
15
|
|
|
|
|
206
|
return "List of Failed"; |
1829
|
|
|
|
|
|
|
} |
1830
|
|
|
|
|
|
|
|
1831
|
|
|
|
|
|
|
sub _create_fmts |
1832
|
|
|
|
|
|
|
{ |
1833
|
7
|
|
|
7
|
|
27
|
my $self = shift; |
1834
|
|
|
|
|
|
|
|
1835
|
7
|
|
|
|
|
63
|
$self->_calc_format_widths(); |
1836
|
|
|
|
|
|
|
|
1837
|
7
|
|
|
|
|
23
|
return; |
1838
|
|
|
|
|
|
|
} |
1839
|
|
|
|
|
|
|
|
1840
|
|
|
|
|
|
|
sub _get_fail_other_exception_text |
1841
|
|
|
|
|
|
|
{ |
1842
|
7
|
|
|
7
|
|
17
|
my $self = shift; |
1843
|
|
|
|
|
|
|
|
1844
|
7
|
|
|
|
|
45
|
return $self->_format_self("fail_other_except"); |
1845
|
|
|
|
|
|
|
} |
1846
|
|
|
|
|
|
|
|
1847
|
|
|
|
|
|
|
sub _calc_dubious_return_ret_value |
1848
|
|
|
|
|
|
|
{ |
1849
|
6
|
|
|
6
|
|
26
|
my $self = shift; |
1850
|
|
|
|
|
|
|
|
1851
|
6
|
|
|
|
|
78
|
return $self->_create_failed_obj_instance( |
1852
|
|
|
|
|
|
|
$self->_calc_dubious_return_failed_obj_params(), |
1853
|
|
|
|
|
|
|
); |
1854
|
|
|
|
|
|
|
} |
1855
|
|
|
|
|
|
|
|
1856
|
|
|
|
|
|
|
sub _calc_dubious_return_failed_obj_params |
1857
|
|
|
|
|
|
|
{ |
1858
|
6
|
|
|
6
|
|
23
|
my $self = shift; |
1859
|
|
|
|
|
|
|
|
1860
|
|
|
|
|
|
|
return |
1861
|
|
|
|
|
|
|
{ |
1862
|
6
|
|
|
|
|
52
|
@{$self->_get_dubious_summary()}, |
1863
|
6
|
|
|
|
|
807
|
@{$self->last_test_obj->get_failed_obj_params()}, |
1864
|
6
|
|
|
|
|
16
|
@{$self->last_test_results->get_failed_obj_params()}, |
|
6
|
|
|
|
|
730
|
|
1865
|
|
|
|
|
|
|
}; |
1866
|
|
|
|
|
|
|
} |
1867
|
|
|
|
|
|
|
|
1868
|
|
|
|
|
|
|
=head2 $self->_report_failed_before_any_test_output(); |
1869
|
|
|
|
|
|
|
|
1870
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
1871
|
|
|
|
|
|
|
|
1872
|
|
|
|
|
|
|
=cut |
1873
|
|
|
|
|
|
|
|
1874
|
|
|
|
|
|
|
=head2 $self->_report_skipped_test() |
1875
|
|
|
|
|
|
|
|
1876
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
1877
|
|
|
|
|
|
|
|
1878
|
|
|
|
|
|
|
Should report the skipped test. |
1879
|
|
|
|
|
|
|
|
1880
|
|
|
|
|
|
|
=cut |
1881
|
|
|
|
|
|
|
|
1882
|
|
|
|
|
|
|
=head2 $self->_report_all_ok_test() |
1883
|
|
|
|
|
|
|
|
1884
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
1885
|
|
|
|
|
|
|
|
1886
|
|
|
|
|
|
|
Should report the all OK test. |
1887
|
|
|
|
|
|
|
|
1888
|
|
|
|
|
|
|
=cut |
1889
|
|
|
|
|
|
|
|
1890
|
|
|
|
|
|
|
=head2 $self->_report_all_skipped_test() |
1891
|
|
|
|
|
|
|
|
1892
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
1893
|
|
|
|
|
|
|
|
1894
|
|
|
|
|
|
|
Should report the all-skipped test. |
1895
|
|
|
|
|
|
|
|
1896
|
|
|
|
|
|
|
=cut |
1897
|
|
|
|
|
|
|
|
1898
|
|
|
|
|
|
|
=head2 $self->_report_single_test_file_start({test_file => "t/my_test_file.t"}) |
1899
|
|
|
|
|
|
|
|
1900
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
1901
|
|
|
|
|
|
|
|
1902
|
|
|
|
|
|
|
Should start the report for the C<test_file> file. |
1903
|
|
|
|
|
|
|
|
1904
|
|
|
|
|
|
|
=cut |
1905
|
|
|
|
|
|
|
|
1906
|
|
|
|
|
|
|
=head2 $self->_report('channel' => $channel, 'event' => $event_handle); |
1907
|
|
|
|
|
|
|
|
1908
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
1909
|
|
|
|
|
|
|
|
1910
|
|
|
|
|
|
|
Reports the C<$event_handle> event to channel C<$channel>. This should be |
1911
|
|
|
|
|
|
|
overrided by derived classes to do alternate functionality besides calling |
1912
|
|
|
|
|
|
|
output()->print_message(), also different based on the channel. |
1913
|
|
|
|
|
|
|
|
1914
|
|
|
|
|
|
|
Currently available channels are: |
1915
|
|
|
|
|
|
|
|
1916
|
|
|
|
|
|
|
=over 4 |
1917
|
|
|
|
|
|
|
|
1918
|
|
|
|
|
|
|
=item 'success' |
1919
|
|
|
|
|
|
|
|
1920
|
|
|
|
|
|
|
The success report. |
1921
|
|
|
|
|
|
|
|
1922
|
|
|
|
|
|
|
=back |
1923
|
|
|
|
|
|
|
|
1924
|
|
|
|
|
|
|
An event is a hash ref that should contain a 'type' property. Currently |
1925
|
|
|
|
|
|
|
supported types are: |
1926
|
|
|
|
|
|
|
|
1927
|
|
|
|
|
|
|
=over 4 |
1928
|
|
|
|
|
|
|
|
1929
|
|
|
|
|
|
|
=item * success |
1930
|
|
|
|
|
|
|
|
1931
|
|
|
|
|
|
|
A success type. |
1932
|
|
|
|
|
|
|
|
1933
|
|
|
|
|
|
|
=back |
1934
|
|
|
|
|
|
|
|
1935
|
|
|
|
|
|
|
=cut |
1936
|
|
|
|
|
|
|
|
1937
|
|
|
|
|
|
|
=head2 $self->_report_final_stats() |
1938
|
|
|
|
|
|
|
|
1939
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
1940
|
|
|
|
|
|
|
|
1941
|
|
|
|
|
|
|
Reports the final statistics. |
1942
|
|
|
|
|
|
|
|
1943
|
|
|
|
|
|
|
=cut |
1944
|
|
|
|
|
|
|
|
1945
|
|
|
|
|
|
|
=head2 $self->_fail_other_print_top() |
1946
|
|
|
|
|
|
|
|
1947
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
1948
|
|
|
|
|
|
|
|
1949
|
|
|
|
|
|
|
Prints the header of the files that failed. |
1950
|
|
|
|
|
|
|
|
1951
|
|
|
|
|
|
|
=cut |
1952
|
|
|
|
|
|
|
|
1953
|
|
|
|
|
|
|
=head2 $self->_fail_other_report_test($script_name) |
1954
|
|
|
|
|
|
|
|
1955
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
1956
|
|
|
|
|
|
|
|
1957
|
|
|
|
|
|
|
In case of failure from a different reason - report that test script. |
1958
|
|
|
|
|
|
|
Test::Run iterates over all the scripts and reports them one by one. |
1959
|
|
|
|
|
|
|
|
1960
|
|
|
|
|
|
|
=cut |
1961
|
|
|
|
|
|
|
|
1962
|
|
|
|
|
|
|
|
1963
|
|
|
|
|
|
|
=head2 $self->_fail_other_print_bonus_message() |
1964
|
|
|
|
|
|
|
|
1965
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
1966
|
|
|
|
|
|
|
|
1967
|
|
|
|
|
|
|
Should report the bonus message in case of failure from a different |
1968
|
|
|
|
|
|
|
reason. |
1969
|
|
|
|
|
|
|
|
1970
|
|
|
|
|
|
|
=cut |
1971
|
|
|
|
|
|
|
|
1972
|
|
|
|
|
|
|
=head2 $self->_report_tap_event($args) |
1973
|
|
|
|
|
|
|
|
1974
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
1975
|
|
|
|
|
|
|
|
1976
|
|
|
|
|
|
|
=head2 $self->_report_script_start_environment() |
1977
|
|
|
|
|
|
|
|
1978
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
1979
|
|
|
|
|
|
|
|
1980
|
|
|
|
|
|
|
Should report the environment of the script at its beginning. |
1981
|
|
|
|
|
|
|
|
1982
|
|
|
|
|
|
|
=head2 $self->_handle_test_file_opening_error($args) |
1983
|
|
|
|
|
|
|
|
1984
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
1985
|
|
|
|
|
|
|
|
1986
|
|
|
|
|
|
|
Should handle the case where the test file cannot be opened. |
1987
|
|
|
|
|
|
|
|
1988
|
|
|
|
|
|
|
=cut |
1989
|
|
|
|
|
|
|
|
1990
|
|
|
|
|
|
|
=head2 $self->_report_test_progress($args) |
1991
|
|
|
|
|
|
|
|
1992
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
1993
|
|
|
|
|
|
|
|
1994
|
|
|
|
|
|
|
Report the text progress. In the command line it would be a ok $curr/$total |
1995
|
|
|
|
|
|
|
or NOK. |
1996
|
|
|
|
|
|
|
|
1997
|
|
|
|
|
|
|
=cut |
1998
|
|
|
|
|
|
|
=head2 The common test-context $args param |
1999
|
|
|
|
|
|
|
|
2000
|
|
|
|
|
|
|
Contains: |
2001
|
|
|
|
|
|
|
|
2002
|
|
|
|
|
|
|
=over 4 |
2003
|
|
|
|
|
|
|
|
2004
|
|
|
|
|
|
|
=item 'test_struct' => $test |
2005
|
|
|
|
|
|
|
|
2006
|
|
|
|
|
|
|
A reference to the test summary object. |
2007
|
|
|
|
|
|
|
|
2008
|
|
|
|
|
|
|
=item estatus |
2009
|
|
|
|
|
|
|
|
2010
|
|
|
|
|
|
|
The exit status of the test file. |
2011
|
|
|
|
|
|
|
|
2012
|
|
|
|
|
|
|
=back |
2013
|
|
|
|
|
|
|
|
2014
|
|
|
|
|
|
|
=head2 $test_run->_report_dubious($args) |
2015
|
|
|
|
|
|
|
|
2016
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
2017
|
|
|
|
|
|
|
|
2018
|
|
|
|
|
|
|
Is called to report the "dubious" error, when the test returns a non-true |
2019
|
|
|
|
|
|
|
error code. |
2020
|
|
|
|
|
|
|
|
2021
|
|
|
|
|
|
|
$args are the test-context - see above. |
2022
|
|
|
|
|
|
|
|
2023
|
|
|
|
|
|
|
=cut |
2024
|
|
|
|
|
|
|
|
2025
|
|
|
|
|
|
|
=head2 $test_run->_report_dubious_summary_all_subtests_successful($args) |
2026
|
|
|
|
|
|
|
|
2027
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
2028
|
|
|
|
|
|
|
|
2029
|
|
|
|
|
|
|
$args are the test-context - see above. |
2030
|
|
|
|
|
|
|
|
2031
|
|
|
|
|
|
|
=head2 $test_run->_report_premature_test_dubious_summary($args) |
2032
|
|
|
|
|
|
|
|
2033
|
|
|
|
|
|
|
[This is a method that needs to be over-rided.] |
2034
|
|
|
|
|
|
|
|
2035
|
|
|
|
|
|
|
$args are the test-context - see above. |
2036
|
|
|
|
|
|
|
|
2037
|
|
|
|
|
|
|
=head2 opendir |
2038
|
|
|
|
|
|
|
|
2039
|
|
|
|
|
|
|
This method is placed in the namespace by Fatal.pm. This entry is here just |
2040
|
|
|
|
|
|
|
to settle Pod::Coverage. |
2041
|
|
|
|
|
|
|
|
2042
|
|
|
|
|
|
|
=cut |
2043
|
|
|
|
|
|
|
|
2044
|
|
|
|
|
|
|
1; |
2045
|
|
|
|
|
|
|
|
2046
|
|
|
|
|
|
|
=head1 AUTHOR |
2047
|
|
|
|
|
|
|
|
2048
|
|
|
|
|
|
|
Test::Run::Core is based on L<Test::Harness>, and has later been spinned off |
2049
|
|
|
|
|
|
|
as a separate module. |
2050
|
|
|
|
|
|
|
|
2051
|
|
|
|
|
|
|
=head2 Test:Harness Authors |
2052
|
|
|
|
|
|
|
|
2053
|
|
|
|
|
|
|
Either Tim Bunce or Andreas Koenig, we don't know. What we know for |
2054
|
|
|
|
|
|
|
sure is, that it was inspired by Larry Wall's TEST script that came |
2055
|
|
|
|
|
|
|
with perl distributions for ages. Numerous anonymous contributors |
2056
|
|
|
|
|
|
|
exist. Andreas Koenig held the torch for many years, and then |
2057
|
|
|
|
|
|
|
Michael G Schwern. |
2058
|
|
|
|
|
|
|
|
2059
|
|
|
|
|
|
|
Test::Harness was then maintained by Andy Lester C<< <andy at petdance.com> >>. |
2060
|
|
|
|
|
|
|
|
2061
|
|
|
|
|
|
|
=head2 Test::Run::Obj Authors |
2062
|
|
|
|
|
|
|
|
2063
|
|
|
|
|
|
|
Shlomi Fish, L<http://www.shlomifish.org/> . |
2064
|
|
|
|
|
|
|
|
2065
|
|
|
|
|
|
|
Note: this file is a rewrite of the original Test::Run code in order to |
2066
|
|
|
|
|
|
|
change to a more liberal license. |
2067
|
|
|
|
|
|
|
|
2068
|
|
|
|
|
|
|
=head1 LICENSE |
2069
|
|
|
|
|
|
|
|
2070
|
|
|
|
|
|
|
This file is licensed under the MIT License: |
2071
|
|
|
|
|
|
|
|
2072
|
|
|
|
|
|
|
http://www.opensource.org/licenses/mit-license.php |
2073
|
|
|
|
|
|
|
|
2074
|
|
|
|
|
|
|
=cut |