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