line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Fennec::Finder; |
2
|
48
|
|
|
48
|
|
26592
|
use strict; |
|
48
|
|
|
|
|
48
|
|
|
48
|
|
|
|
|
1248
|
|
3
|
48
|
|
|
48
|
|
240
|
use warnings; |
|
48
|
|
|
|
|
96
|
|
|
48
|
|
|
|
|
1056
|
|
4
|
|
|
|
|
|
|
|
5
|
48
|
|
|
48
|
|
192
|
use base 'Fennec::Runner'; |
|
48
|
|
|
|
|
96
|
|
|
48
|
|
|
|
|
25248
|
|
6
|
|
|
|
|
|
|
|
7
|
48
|
|
|
48
|
|
624
|
use File::Find qw/find/; |
|
48
|
|
|
|
|
96
|
|
|
48
|
|
|
|
|
3696
|
|
8
|
48
|
|
|
48
|
|
288
|
use Fennec::Util qw/accessors verbose_message/; |
|
48
|
|
|
|
|
48
|
|
|
48
|
|
|
|
|
384
|
|
9
|
48
|
|
|
48
|
|
19872
|
use List::Util qw/shuffle/; |
|
48
|
|
|
|
|
144
|
|
|
48
|
|
|
|
|
214896
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
accessors qw/test_files parallel/; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub import { |
14
|
48
|
|
|
48
|
|
960
|
my $self = shift->new; |
15
|
48
|
|
|
|
|
288
|
$self->find_files(@_); |
16
|
48
|
|
|
|
|
720
|
$self->inject_run( scalar caller ); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub init { |
20
|
48
|
|
|
48
|
0
|
144
|
my $self = shift; |
21
|
48
|
|
|
|
|
144
|
my (%params) = @_; |
22
|
|
|
|
|
|
|
|
23
|
48
|
|
|
|
|
288
|
$self->test_files( [] ); |
24
|
48
|
50
|
|
|
|
480
|
$self->parallel( defined $params{parallel} ? $params{parallel} : 2 ); |
25
|
|
|
|
|
|
|
|
26
|
48
|
|
|
|
|
144
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub find_files { |
30
|
48
|
|
|
48
|
0
|
144
|
my $self = shift; |
31
|
48
|
50
|
|
|
|
1344
|
my @paths = @_ ? @_ : -d './t' ? ('./t') : ('./'); |
|
|
50
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
find( |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
wanted => sub { |
36
|
1920
|
|
|
1920
|
|
2544
|
my $file = $File::Find::name; |
37
|
1920
|
100
|
|
|
|
8112
|
return unless $self->validate_file($file); |
38
|
624
|
|
|
|
|
720
|
push @{$self->test_files} => $file; |
|
624
|
|
|
|
|
1536
|
|
39
|
|
|
|
|
|
|
}, |
40
|
48
|
|
|
|
|
5232
|
no_chdir => 1, |
41
|
|
|
|
|
|
|
}, |
42
|
|
|
|
|
|
|
@paths |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub validate_file { |
47
|
1920
|
|
|
1920
|
0
|
2160
|
my $self = shift; |
48
|
1920
|
|
|
|
|
2256
|
my ($file) = @_; |
49
|
1920
|
100
|
|
|
|
41040
|
return unless $file =~ m/\.(pm|ft)$/; |
50
|
624
|
|
|
|
|
6240
|
return 1; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub run { |
54
|
48
|
|
|
48
|
0
|
192
|
my $self = shift; |
55
|
48
|
|
|
|
|
48
|
my ($follow) = @_; |
56
|
|
|
|
|
|
|
|
57
|
48
|
|
|
|
|
1200
|
$self->_ran(1); |
58
|
|
|
|
|
|
|
|
59
|
48
|
|
|
|
|
288
|
my $frunner = $self->prunner( $self->parallel ); |
60
|
|
|
|
|
|
|
|
61
|
48
|
|
|
|
|
144
|
for my $file ( @{$self->test_files} ) { |
|
48
|
|
|
|
|
240
|
|
62
|
|
|
|
|
|
|
$frunner->run( |
63
|
|
|
|
|
|
|
sub { |
64
|
47
|
|
|
47
|
|
320511
|
$self->load_file($file); |
65
|
|
|
|
|
|
|
|
66
|
46
|
|
|
|
|
101
|
for my $class ( shuffle @{$self->test_classes} ) { |
|
46
|
|
|
|
|
326
|
|
67
|
45
|
50
|
|
|
|
278
|
next unless $class; |
68
|
45
|
|
|
|
|
1370
|
$self->run_test_class($class); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
}, |
71
|
369
|
|
|
|
|
6111
|
1 |
72
|
|
|
|
|
|
|
); |
73
|
|
|
|
|
|
|
|
74
|
322
|
|
|
|
|
1010862
|
$self->check_pid; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
1
|
|
|
|
|
62
|
$frunner->finish(); |
78
|
|
|
|
|
|
|
|
79
|
1
|
50
|
|
|
|
34
|
if ($follow) { |
80
|
0
|
|
|
|
|
0
|
$self->collector->collect; |
81
|
0
|
|
|
|
|
0
|
verbose_message("Entering final follow-up stage\n"); |
82
|
0
|
0
|
|
|
|
0
|
eval { $follow->(); 1 } || $self->exception( 'done_testing', $@ ); |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
1
|
|
|
|
|
17
|
$self->collector->collect; |
86
|
1
|
|
|
|
|
15
|
$self->collector->finish(); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
__END__ |