line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::UniqueTestNames::Tracker; |
2
|
|
|
|
|
|
|
|
3
|
12
|
|
|
12
|
|
927
|
use strict; |
|
12
|
|
|
|
|
22
|
|
|
12
|
|
|
|
|
398
|
|
4
|
12
|
|
|
12
|
|
60
|
use warnings; |
|
12
|
|
|
|
|
22
|
|
|
12
|
|
|
|
|
328
|
|
5
|
|
|
|
|
|
|
|
6
|
12
|
|
|
12
|
|
4803
|
use Test::UniqueTestNames::Test; |
|
12
|
|
|
|
|
30
|
|
|
12
|
|
|
|
|
4120
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my %tests; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub add_test { |
11
|
94
|
|
|
94
|
0
|
190
|
my ( $class, $name, $line_number ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
94
|
100
|
|
|
|
281
|
die "add_test must have a line number" unless defined $line_number; |
14
|
93
|
|
100
|
|
|
241
|
$name ||= ''; |
15
|
|
|
|
|
|
|
|
16
|
93
|
100
|
|
|
|
233
|
unless ( exists $tests{ $name } ) { |
17
|
72
|
|
|
|
|
814
|
$tests{ $name } = Test::UniqueTestNames::Test->new( $name, $line_number ); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
else { |
20
|
21
|
|
|
|
|
83
|
$tests{ $name }->add_line_number( $line_number ); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub all_tests { |
25
|
3
|
|
|
3
|
0
|
1285
|
return [ values %tests ]; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub failing_tests { |
29
|
33
|
|
|
33
|
0
|
100
|
my ( $class ) = @_; |
30
|
|
|
|
|
|
|
|
31
|
33
|
|
|
|
|
45
|
my @failing_tests; |
32
|
|
|
|
|
|
|
|
33
|
33
|
|
|
|
|
140
|
for( sort { $a->lowest_line_number <=> $b->lowest_line_number } values %tests ) { |
|
109
|
|
|
|
|
307
|
|
34
|
102
|
100
|
|
|
|
270
|
push @failing_tests, $_ if $_->fails; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
33
|
|
|
|
|
155
|
return \@failing_tests; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub unnamed_ok { |
41
|
2
|
|
|
2
|
0
|
5
|
my ( $class, $value ) = @_; |
42
|
2
|
|
|
|
|
14
|
Test::UniqueTestNames::Test->unnamed_ok( $value ); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |