line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Default Test::Mini Output Logger. |
2
|
|
|
|
|
|
|
package Test::Mini::Logger::TAP; |
3
|
3
|
|
|
3
|
|
16733
|
use base 'Test::Mini::Logger'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
1258
|
|
4
|
3
|
|
|
3
|
|
20
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
131
|
|
5
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
1875
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
16
|
|
|
16
|
1
|
523
|
my ($class, %args) = @_; |
9
|
16
|
|
|
|
|
75
|
return $class->SUPER::new(test_counter => 0, %args); |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub test_counter { |
13
|
68
|
|
|
68
|
1
|
89
|
my ($self) = @_; |
14
|
68
|
|
|
|
|
517
|
return $self->{test_counter}; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub inc_counter { |
18
|
67
|
|
|
67
|
1
|
85
|
my ($self) = @_; |
19
|
67
|
|
|
|
|
176
|
$self->{test_counter}++; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub diag { |
23
|
15
|
|
|
15
|
1
|
27
|
my ($self, @msgs) = @_; |
24
|
15
|
|
|
|
|
37
|
my $msg = join "\n", @msgs; |
25
|
15
|
|
|
|
|
3820
|
$msg =~ s/^/# /mg; |
26
|
15
|
|
|
|
|
58
|
$self->say($msg); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub begin_test_case { |
30
|
4
|
|
|
4
|
1
|
24
|
my ($self, $tc, @tests) = @_; |
31
|
4
|
|
|
|
|
19
|
$self->diag("Test Case: $tc"); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub begin_test { |
35
|
67
|
|
|
67
|
1
|
269
|
my ($self) = @_; |
36
|
67
|
|
|
|
|
144
|
$self->inc_counter(); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub pass { |
40
|
50
|
|
|
50
|
1
|
94
|
my ($self, undef, $test) = @_; |
41
|
50
|
|
|
|
|
83
|
$self->say("ok @{[$self->test_counter]} - $test"); |
|
50
|
|
|
|
|
105
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub fail { |
45
|
6
|
|
|
6
|
1
|
17
|
my ($self, undef, $test, $msg) = @_; |
46
|
6
|
|
|
|
|
14
|
$self->say("not ok @{[$self->test_counter]} - $test"); |
|
6
|
|
|
|
|
14
|
|
47
|
6
|
|
|
|
|
59
|
$self->diag($msg); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub error { |
51
|
4
|
|
|
4
|
1
|
17
|
my ($self, undef, $test, $msg) = @_; |
52
|
4
|
|
|
|
|
7
|
$self->say("not ok @{[$self->test_counter]} - $test"); |
|
4
|
|
|
|
|
8
|
|
53
|
4
|
|
|
|
|
52
|
$self->diag($msg); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub skip { |
57
|
4
|
|
|
4
|
1
|
13
|
my ($self, undef, $test, $msg) = @_; |
58
|
4
|
|
|
|
|
6
|
$self->print("ok @{[$self->test_counter]} - $test # SKIP"); |
|
4
|
|
|
|
|
8
|
|
59
|
|
|
|
|
|
|
|
60
|
4
|
100
|
|
|
|
45
|
if ($msg =~ /\n/) { |
61
|
1
|
|
|
|
|
4
|
$self->say(); |
62
|
1
|
|
|
|
|
12
|
$self->diag($msg); |
63
|
|
|
|
|
|
|
} else { |
64
|
3
|
|
|
|
|
10
|
$self->say(": $msg"); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub finish_test_suite { |
69
|
4
|
|
|
4
|
1
|
11
|
my ($self) = @_; |
70
|
4
|
|
|
|
|
10
|
$self->say("1..@{[$self->test_counter]}"); |
|
4
|
|
|
|
|
13
|
|
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |