line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
Test::Run::Obj::Error - an error class hierarchy for Test::Run. |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 DESCRIPTION |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
This module provides an error class hieararchy for Test::Run. This is used |
8
|
|
|
|
|
|
|
for throwing exceptions that should be handled programatically. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 METHODS |
11
|
|
|
|
|
|
|
=cut |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
package Test::Run::Obj::Error; |
15
|
|
|
|
|
|
|
|
16
|
15
|
|
|
15
|
|
56357
|
use strict; |
|
15
|
|
|
|
|
33
|
|
|
15
|
|
|
|
|
397
|
|
17
|
15
|
|
|
15
|
|
65
|
use warnings; |
|
15
|
|
|
|
|
53
|
|
|
15
|
|
|
|
|
326
|
|
18
|
|
|
|
|
|
|
|
19
|
15
|
|
|
15
|
|
535
|
use Moose; |
|
15
|
|
|
|
|
388693
|
|
|
15
|
|
|
|
|
113
|
|
20
|
|
|
|
|
|
|
|
21
|
15
|
|
|
15
|
|
107679
|
use Test::Run::Base::Struct; |
|
15
|
|
|
|
|
50
|
|
|
15
|
|
|
|
|
502
|
|
22
|
|
|
|
|
|
|
|
23
|
15
|
|
|
15
|
|
91
|
use Scalar::Util (); |
|
15
|
|
|
|
|
33
|
|
|
15
|
|
|
|
|
283
|
|
24
|
|
|
|
|
|
|
|
25
|
15
|
|
|
15
|
|
63
|
use vars qw(@ISA @fields); |
|
15
|
|
|
|
|
32
|
|
|
15
|
|
|
|
|
824
|
|
26
|
|
|
|
|
|
|
|
27
|
15
|
|
|
15
|
|
82
|
use MRO::Compat; |
|
15
|
|
|
|
|
27
|
|
|
15
|
|
|
|
|
906
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _polymorphic_stringify |
31
|
|
|
|
|
|
|
{ |
32
|
24
|
|
|
24
|
|
582
|
my $self = shift; |
33
|
24
|
|
|
|
|
101
|
return $self->stringify(@_); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
use overload |
37
|
15
|
|
|
|
|
133
|
'""' => \&_polymorphic_stringify, |
38
|
|
|
|
|
|
|
'fallback' => 1 |
39
|
15
|
|
|
15
|
|
83
|
; |
|
15
|
|
|
|
|
25
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
extends(qw(Test::Run::Base::Struct)); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
has 'package' => (is => "rw", isa => "Str"); |
44
|
|
|
|
|
|
|
has 'file' => (is => "rw", isa => "Str"); |
45
|
|
|
|
|
|
|
has 'line' => (is => "rw", isa => "Num"); |
46
|
|
|
|
|
|
|
has 'text' => (is => "rw", isa => "Str"); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 BUILD |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
For Moose. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub BUILD |
55
|
|
|
|
|
|
|
{ |
56
|
11
|
|
|
11
|
1
|
101
|
my $self = shift; |
57
|
|
|
|
|
|
|
|
58
|
11
|
|
|
|
|
169
|
my ($pkg,$file,$line) = caller(1); |
59
|
11
|
|
|
|
|
500
|
$self->package($pkg); |
60
|
11
|
|
|
|
|
390
|
$self->file($file); |
61
|
11
|
|
|
|
|
379
|
$self->line($line); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 $self->stringify() |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Stringifies the error. Returns the text() field by default. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub stringify |
71
|
|
|
|
|
|
|
{ |
72
|
25
|
|
|
25
|
1
|
49
|
my $self = shift; |
73
|
25
|
|
|
|
|
682
|
return $self->text(); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
package Test::Run::Obj::Error::TestsFail; |
79
|
|
|
|
|
|
|
|
80
|
15
|
|
|
15
|
|
3298
|
use vars qw(@ISA); |
|
15
|
|
|
|
|
57
|
|
|
15
|
|
|
|
|
1044
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
@ISA = (qw(Test::Run::Obj::Error)); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
package Test::Run::Obj::Error::TestsFail::NoTestsRun; |
85
|
|
|
|
|
|
|
|
86
|
15
|
|
|
15
|
|
95
|
use vars qw(@ISA); |
|
15
|
|
|
|
|
41
|
|
|
15
|
|
|
|
|
906
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
@ISA = (qw(Test::Run::Obj::Error::TestsFail)); |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
package Test::Run::Obj::Error::TestsFail::Other; |
91
|
|
|
|
|
|
|
|
92
|
15
|
|
|
15
|
|
97
|
use vars qw(@ISA); |
|
15
|
|
|
|
|
154
|
|
|
15
|
|
|
|
|
797
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
@ISA = (qw(Test::Run::Obj::Error::TestsFail)); |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
package Test::Run::Obj::Error::TestsFail::NoOutput; |
97
|
|
|
|
|
|
|
|
98
|
15
|
|
|
15
|
|
93
|
use vars qw(@ISA); |
|
15
|
|
|
|
|
38
|
|
|
15
|
|
|
|
|
993
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
@ISA = (qw(Test::Run::Obj::Error::TestsFail)); |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
package Test::Run::Obj::Error::TestsFail::Bailout; |
103
|
|
|
|
|
|
|
|
104
|
15
|
|
|
15
|
|
94
|
use Moose; |
|
15
|
|
|
|
|
40
|
|
|
15
|
|
|
|
|
93
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
extends(qw(Test::Run::Obj::Error::TestsFail)); |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
has 'bailout_reason' => (is => "rw", isa => "Str"); |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub stringify |
112
|
|
|
|
|
|
|
{ |
113
|
8
|
|
|
8
|
1
|
13
|
my $self = shift; |
114
|
8
|
50
|
|
|
|
271
|
return "FAILED--Further testing stopped" . |
115
|
|
|
|
|
|
|
($self->bailout_reason() ? |
116
|
|
|
|
|
|
|
(": " . $self->bailout_reason() . "\n") : |
117
|
|
|
|
|
|
|
".\n" |
118
|
|
|
|
|
|
|
); |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
package Test::Run::Obj::Error::Straps; |
122
|
|
|
|
|
|
|
|
123
|
15
|
|
|
15
|
|
88587
|
use vars qw(@ISA); |
|
15
|
|
|
|
|
30
|
|
|
15
|
|
|
|
|
905
|
|
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
@ISA = (qw(Test::Run::Obj::Error)); |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
package Test::Run::Obj::Error::Straps::CannotRunPerl; |
128
|
|
|
|
|
|
|
|
129
|
15
|
|
|
15
|
|
87
|
use vars qw(@ISA); |
|
15
|
|
|
|
|
26
|
|
|
15
|
|
|
|
|
1029
|
|
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
@ISA = (qw(Test::Run::Obj::Error::Straps)); |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
1; |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=head1 LICENSE |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
This file is licensed under the MIT X11 License: |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
http://www.opensource.org/licenses/mit-license.php |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=cut |
142
|
|
|
|
|
|
|
|