line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Fennec::Finder; |
2
|
48
|
|
|
48
|
|
15744
|
use strict; |
|
48
|
|
|
|
|
240
|
|
|
48
|
|
|
|
|
864
|
|
3
|
48
|
|
|
48
|
|
144
|
use warnings; |
|
48
|
|
|
|
|
96
|
|
|
48
|
|
|
|
|
816
|
|
4
|
|
|
|
|
|
|
|
5
|
48
|
|
|
48
|
|
192
|
use base 'Fennec::Runner'; |
|
48
|
|
|
|
|
48
|
|
|
48
|
|
|
|
|
13536
|
|
6
|
|
|
|
|
|
|
|
7
|
48
|
|
|
48
|
|
240
|
use File::Find qw/find/; |
|
48
|
|
|
|
|
48
|
|
|
48
|
|
|
|
|
2592
|
|
8
|
48
|
|
|
48
|
|
240
|
use Fennec::Util qw/accessors verbose_message/; |
|
48
|
|
|
|
|
48
|
|
|
48
|
|
|
|
|
192
|
|
9
|
48
|
|
|
48
|
|
12864
|
use List::Util qw/shuffle/; |
|
48
|
|
|
|
|
48
|
|
|
48
|
|
|
|
|
20496
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
accessors qw/test_files parallel/; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub import { |
14
|
48
|
|
|
48
|
|
480
|
my $self = shift->new; |
15
|
48
|
|
|
|
|
240
|
$self->find_files(@_); |
16
|
48
|
|
|
|
|
816
|
$self->inject_run( scalar caller ); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub init { |
20
|
48
|
|
|
48
|
0
|
96
|
my $self = shift; |
21
|
48
|
|
|
|
|
48
|
my (%params) = @_; |
22
|
|
|
|
|
|
|
|
23
|
48
|
|
|
|
|
192
|
$self->test_files( [] ); |
24
|
48
|
50
|
|
|
|
192
|
$self->parallel( defined $params{parallel} ? $params{parallel} : 2 ); |
25
|
|
|
|
|
|
|
|
26
|
48
|
|
|
|
|
48
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub find_files { |
30
|
48
|
|
|
48
|
0
|
48
|
my $self = shift; |
31
|
48
|
50
|
|
|
|
720
|
my @paths = @_ ? @_ : -d './t' ? ('./t') : ('./'); |
|
|
50
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
find( |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
wanted => sub { |
36
|
1920
|
|
|
1920
|
|
2496
|
my $file = $File::Find::name; |
37
|
1920
|
100
|
|
|
|
2256
|
return unless $self->validate_file($file); |
38
|
624
|
|
|
|
|
576
|
push @{$self->test_files} => $file; |
|
624
|
|
|
|
|
816
|
|
39
|
|
|
|
|
|
|
}, |
40
|
48
|
|
|
|
|
5856
|
no_chdir => 1, |
41
|
|
|
|
|
|
|
}, |
42
|
|
|
|
|
|
|
@paths |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub validate_file { |
47
|
1920
|
|
|
1920
|
0
|
1584
|
my $self = shift; |
48
|
1920
|
|
|
|
|
1968
|
my ($file) = @_; |
49
|
1920
|
100
|
|
|
|
24432
|
return unless $file =~ m/\.(pm|ft)$/; |
50
|
624
|
|
|
|
|
816
|
return 1; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub run { |
54
|
48
|
|
|
48
|
0
|
96
|
my $self = shift; |
55
|
48
|
|
|
|
|
96
|
my ($follow) = @_; |
56
|
|
|
|
|
|
|
|
57
|
48
|
|
|
|
|
240
|
$self->_ran(1); |
58
|
|
|
|
|
|
|
|
59
|
48
|
|
|
|
|
144
|
my $frunner = $self->prunner( $self->parallel ); |
60
|
|
|
|
|
|
|
|
61
|
48
|
|
|
|
|
96
|
for my $file ( @{$self->test_files} ) { |
|
48
|
|
|
|
|
96
|
|
62
|
|
|
|
|
|
|
$frunner->run( |
63
|
|
|
|
|
|
|
sub { |
64
|
47
|
|
|
47
|
|
91066
|
$self->load_file($file); |
65
|
|
|
|
|
|
|
|
66
|
46
|
|
|
|
|
125
|
for my $class ( shuffle @{$self->test_classes} ) { |
|
46
|
|
|
|
|
253
|
|
67
|
45
|
50
|
|
|
|
178
|
next unless $class; |
68
|
45
|
|
|
|
|
692
|
$self->run_test_class($class); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
}, |
71
|
368
|
|
|
|
|
4641
|
1 |
72
|
|
|
|
|
|
|
); |
73
|
|
|
|
|
|
|
|
74
|
321
|
|
|
|
|
545818
|
$self->check_pid; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
1
|
|
|
|
|
46
|
$frunner->finish(); |
78
|
|
|
|
|
|
|
|
79
|
1
|
50
|
|
|
|
43
|
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
|
|
|
|
|
17
|
$self->collector->finish(); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
__END__ |