| 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.20'; |
|
5
|
1
|
|
|
1
|
|
22382
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
24
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
25
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
575
|
use SmokeRunner::Multi::Config; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
35
|
|
|
9
|
1
|
|
|
1
|
|
605
|
use SmokeRunner::Multi::TestSet; |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
9
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new |
|
13
|
|
|
|
|
|
|
{ |
|
14
|
5
|
|
|
5
|
1
|
8533
|
my $class = shift; |
|
15
|
|
|
|
|
|
|
|
|
16
|
5
|
|
|
|
|
21
|
return bless {}, $class; |
|
17
|
|
|
|
|
|
|
} |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub next_set |
|
20
|
|
|
|
|
|
|
{ |
|
21
|
4
|
|
|
4
|
1
|
44
|
return ( SmokeRunner::Multi::TestSet->All() )[0]; |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub run_and_report_next_set |
|
25
|
|
|
|
|
|
|
{ |
|
26
|
1
|
|
|
1
|
1
|
18
|
my $self = shift; |
|
27
|
|
|
|
|
|
|
|
|
28
|
1
|
50
|
|
|
|
5
|
my $set = $self->next_set() |
|
29
|
|
|
|
|
|
|
or return; |
|
30
|
|
|
|
|
|
|
|
|
31
|
1
|
|
|
|
|
32
|
my $runner = $self->make_runner( set => $set ); |
|
32
|
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
6
|
$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
|
|
|
|
|
5
|
$runner->run_tests(); |
|
39
|
|
|
|
|
|
|
|
|
40
|
1
|
|
|
|
|
1076011
|
my $reporter = $self->make_reporter( runner => $runner ); |
|
41
|
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
13
|
$reporter->report(); |
|
43
|
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
37
|
$set->update_last_run_time($time); |
|
45
|
1
|
|
|
|
|
39
|
$set->unprioritize(); |
|
46
|
|
|
|
|
|
|
|
|
47
|
1
|
|
|
|
|
34
|
return $reporter; |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub make_runner |
|
51
|
|
|
|
|
|
|
{ |
|
52
|
2
|
|
|
2
|
1
|
31
|
my $self = shift; |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
return |
|
55
|
2
|
|
|
|
|
16
|
$self->_class_for |
|
56
|
|
|
|
|
|
|
( 'Runner', |
|
57
|
|
|
|
|
|
|
SmokeRunner::Multi::Config->instance()->runner() ) |
|
58
|
|
|
|
|
|
|
->new(@_); |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub make_reporter |
|
62
|
|
|
|
|
|
|
{ |
|
63
|
2
|
|
|
2
|
1
|
434
|
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
|
|
1810
|
my $self = shift; |
|
75
|
10
|
|
|
|
|
23
|
my $type = shift; |
|
76
|
10
|
|
|
|
|
26
|
my $name = shift; |
|
77
|
|
|
|
|
|
|
|
|
78
|
10
|
100
|
|
|
|
52
|
die "No config for \L$type\n" |
|
79
|
|
|
|
|
|
|
unless defined $name; |
|
80
|
|
|
|
|
|
|
|
|
81
|
8
|
100
|
|
|
|
37
|
my $full_class = $name =~ /::/ ? $name : join '::', __PACKAGE__, $type, $name; |
|
82
|
|
|
|
|
|
|
|
|
83
|
8
|
100
|
|
|
|
141
|
return $full_class if $full_class->can('new'); |
|
84
|
|
|
|
|
|
|
|
|
85
|
1
|
|
|
1
|
|
376
|
eval "use $full_class"; |
|
|
0
|
|
|
1
|
|
0
|
|
|
|
0
|
|
|
1
|
|
0
|
|
|
|
1
|
|
|
1
|
|
730
|
|
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
10
|
|
|
|
1
|
|
|
|
|
656
|
|
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
8
|
|
|
|
1
|
|
|
|
|
395
|
|
|
|
1
|
|
|
|
|
105
|
|
|
|
1
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
241
|
|
|
86
|
4
|
100
|
|
|
|
66
|
die $@ if $@; |
|
87
|
|
|
|
|
|
|
|
|
88
|
3
|
|
|
|
|
27
|
return $full_class; |
|
89
|
|
|
|
|
|
|
} |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
1; |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
__END__ |