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
|
1
|
|
|
1
|
|
32091
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
17
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
1622
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
use Test::Run::Base::Struct; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
use Scalar::Util (); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
use vars qw(@ISA @fields); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
use MRO::Compat; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _polymorphic_stringify |
31
|
|
|
|
|
|
|
{ |
32
|
|
|
|
|
|
|
my $self = shift; |
33
|
|
|
|
|
|
|
return $self->stringify(@_); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
use overload |
37
|
|
|
|
|
|
|
'""' => \&_polymorphic_stringify, |
38
|
|
|
|
|
|
|
'fallback' => 1 |
39
|
|
|
|
|
|
|
; |
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
|
|
|
|
|
|
|
my $self = shift; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
my ($pkg,$file,$line) = caller(1); |
59
|
|
|
|
|
|
|
$self->package($pkg); |
60
|
|
|
|
|
|
|
$self->file($file); |
61
|
|
|
|
|
|
|
$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
|
|
|
|
|
|
|
my $self = shift; |
73
|
|
|
|
|
|
|
return $self->text(); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
package Test::Run::Obj::Error::TestsFail; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
use vars qw(@ISA); |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
@ISA = (qw(Test::Run::Obj::Error)); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
package Test::Run::Obj::Error::TestsFail::NoTestsRun; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
use vars qw(@ISA); |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
@ISA = (qw(Test::Run::Obj::Error::TestsFail)); |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
package Test::Run::Obj::Error::TestsFail::Other; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
use vars qw(@ISA); |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
@ISA = (qw(Test::Run::Obj::Error::TestsFail)); |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
package Test::Run::Obj::Error::TestsFail::NoOutput; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
use vars qw(@ISA); |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
@ISA = (qw(Test::Run::Obj::Error::TestsFail)); |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
package Test::Run::Obj::Error::TestsFail::Bailout; |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
use Moose; |
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
|
|
|
|
|
|
|
my $self = shift; |
114
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
use vars qw(@ISA); |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
@ISA = (qw(Test::Run::Obj::Error)); |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
package Test::Run::Obj::Error::Straps::CannotRunPerl; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
use vars qw(@ISA); |
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
|
|
|
|
|
|
|
|