line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SmokeRunner::Multi; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
1
|
|
|
1
|
|
25770
|
$SmokeRunner::Multi::AUTHORITY = 'cpan:YANICK'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
{ |
6
|
|
|
|
|
|
|
$SmokeRunner::Multi::VERSION = '0.19'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
#ABSTRACT: Manage smoke tests across multiple branches/checkouts/projects |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
9
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
11
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
533
|
use SmokeRunner::Multi::Config; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
14
|
1
|
|
|
1
|
|
662
|
use SmokeRunner::Multi::TestSet; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new |
18
|
|
|
|
|
|
|
{ |
19
|
5
|
|
|
5
|
1
|
8831
|
my $class = shift; |
20
|
|
|
|
|
|
|
|
21
|
5
|
|
|
|
|
24
|
return bless {}, $class; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub next_set |
25
|
|
|
|
|
|
|
{ |
26
|
4
|
|
|
4
|
1
|
112
|
return ( SmokeRunner::Multi::TestSet->All() )[0]; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub run_and_report_next_set |
30
|
|
|
|
|
|
|
{ |
31
|
1
|
|
|
1
|
1
|
37
|
my $self = shift; |
32
|
|
|
|
|
|
|
|
33
|
1
|
50
|
|
|
|
11
|
my $set = $self->next_set() |
34
|
|
|
|
|
|
|
or return; |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
52
|
my $runner = $self->make_runner( set => $set ); |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
7
|
$set->update_files(); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# Running the tests could take a while, during which time the set |
41
|
|
|
|
|
|
|
# might change in version control. |
42
|
1
|
|
|
|
|
2
|
my $time = time; |
43
|
1
|
|
|
|
|
9
|
$runner->run_tests(); |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
1277350
|
my $reporter = $self->make_reporter( runner => $runner ); |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
|
|
11
|
$reporter->report(); |
48
|
|
|
|
|
|
|
|
49
|
1
|
|
|
|
|
43
|
$set->update_last_run_time($time); |
50
|
1
|
|
|
|
|
22
|
$set->unprioritize(); |
51
|
|
|
|
|
|
|
|
52
|
1
|
|
|
|
|
28
|
return $reporter; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub make_runner |
56
|
|
|
|
|
|
|
{ |
57
|
2
|
|
|
2
|
1
|
37
|
my $self = shift; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
return |
60
|
2
|
|
|
|
|
23
|
$self->_class_for |
61
|
|
|
|
|
|
|
( 'Runner', |
62
|
|
|
|
|
|
|
SmokeRunner::Multi::Config->instance()->runner() ) |
63
|
|
|
|
|
|
|
->new(@_); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub make_reporter |
67
|
|
|
|
|
|
|
{ |
68
|
2
|
|
|
2
|
1
|
368
|
my $self = shift; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
return |
71
|
2
|
|
|
|
|
36
|
$self->_class_for |
72
|
|
|
|
|
|
|
( 'Reporter', |
73
|
|
|
|
|
|
|
SmokeRunner::Multi::Config->instance()->reporter() ) |
74
|
|
|
|
|
|
|
->new(@_); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub _class_for |
78
|
|
|
|
|
|
|
{ |
79
|
10
|
|
|
10
|
|
1206
|
my $self = shift; |
80
|
10
|
|
|
|
|
24
|
my $type = shift; |
81
|
10
|
|
|
|
|
21
|
my $name = shift; |
82
|
|
|
|
|
|
|
|
83
|
10
|
100
|
|
|
|
41
|
die "No config for \L$type\n" |
84
|
|
|
|
|
|
|
unless defined $name; |
85
|
|
|
|
|
|
|
|
86
|
8
|
100
|
|
|
|
46
|
my $full_class = $name =~ /::/ ? $name : join '::', __PACKAGE__, $type, $name; |
87
|
|
|
|
|
|
|
|
88
|
8
|
100
|
|
|
|
136
|
return $full_class if $full_class->can('new'); |
89
|
|
|
|
|
|
|
|
90
|
1
|
|
|
1
|
|
533
|
eval "use $full_class"; |
|
0
|
|
|
1
|
|
0
|
|
|
0
|
|
|
1
|
|
0
|
|
|
1
|
|
|
1
|
|
823
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
717
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
363
|
|
|
1
|
|
|
|
|
103
|
|
|
1
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
282
|
|
91
|
4
|
100
|
|
|
|
53
|
die $@ if $@; |
92
|
|
|
|
|
|
|
|
93
|
3
|
|
|
|
|
30
|
return $full_class; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
1; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
__END__ |