blib/lib/Test/Smoke/App/SmokePerl.pm

filter: Statementstmt 96.2% 76 / 79 Branchbran 83.3% 10 / 12 Conditioncond 62.5% 5 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 100% 11 / 11 Podpod 100% 1 / 1 totaltotal 88.7% 103 / 116 CC 10 SCAR 17.2
CC
10
Cov
92%
run
10.2
BEGIN
1.0
BEGIN
1.0
CRAP 5.6
« blib/lib/Test/Smoke/Util/Win32ErrorMode.pm ↑ Summary blib/lib/Test/Smoke/Poster/Curl.pm »
1 package Test::Smoke::App::SmokePerl;
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 our $VERSION = '0.001';
6  
7 1 ▶use base 'Test::Smoke::App::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use Test::Smoke::App::Archiver;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Test::Smoke::App::Reporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Test::Smoke::App::RunSmoke;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Test::Smoke::App::SendReport;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Test::Smoke::App::SyncTree;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use Test::Smoke::App::Options;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 my $opt = 'Test::Smoke::App::Options';
17  
18 1 ▶use Test::Smoke::Util 'get_patch';
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 =head1 NAME
21  
22 Test::Smoke::App::SmokePerl - The tssmokeperl.pl application.
23  
24 =head1 DESCRIPTION
25  
26 =head2 $app->run();
27  
28 Run all the parts:
29  
30 =over
31  
32 =item * synctree
33  
34 =item * runsmoke
35  
36 =item * report
37  
38 =item * sendrpt
39  
40 =item * archive
41  
42 =back
43  
44 =cut
45  
46 2 ▶sub run {
Subroutine run: called CC=10 SCAR=23.2
Pod documented
47 2 my $self = shift;
48 2 $self->log_debug("Read configuration from: %s", $self->option('configfile'));
49  
50 2 ▶ my $old_commit = get_patch($self->option('ddir'))->[0] || "";
Condition50%1/2
get_patch($self->option('ddir'))->[0] || ''
l!l
20
MC/DC0%0/1
get_patch($self->option('ddir'))->[0] || ''
get_patch($self->option('ddir'))->[0]
Truth table50%1/2
A
A= get_patch($self->option('ddir'))->[0]
Aresult
11
00
51 2 ▶ if ($self->option('smartsmoke') && $self->option('patchlevel')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->option("smartsmoke") and $self->option("patchlevel")) 0 2 2
Condition66%2/3
$self->option("smartsmoke") and $self->option("patchlevel")
!ll&&!rl&&r
110
MC/DC0%0/2
$self->option("smartsmoke") and $self->option("patchlevel")
$self->option("smartsmoke") $self->option("patchlevel")
Truth table66%2/3
A and B
A= $self->option("smartsmoke")B= $self->option("patchlevel")
ABresult
0X0
100
111
52 0 $old_commit = $self->option('patchlevel');
53 }
54 2 $self->log_debug("Commitlevel before sync: %s", $old_commit);
55  
56 2 my $current_commit;
57 2 ▶ if ($self->option('sync')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->option('sync')) { } 1 1 2
58 1 local @ARGV = @{$self->ARGV};
59 1 $self->{_synctree} = Test::Smoke::App::SyncTree->new(
60 $opt->synctree_config()
61 );
62 1 $self->log_info("==> Starting synctree");
63 1 $current_commit = $self->synctree->run();
64 }
65 else {
66 1 $self->log_warn("==> Skipping synctree");
67 1 $current_commit = get_patch($self->option('ddir'))->[0];
68 }
69 2 $self->log_debug("Commitlevel after sync: %s", $current_commit);
70  
71 2 ▶ if ($self->option('smartsmoke') && ($current_commit eq $old_commit)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->option("smartsmoke") and $current_commit eq $old_commit) 0 2 2
Condition66%2/3
$self->option("smartsmoke") and $current_commit eq $old_commit
!ll&&!rl&&r
110
MC/DC0%0/2
$self->option("smartsmoke") and $current_commit eq $old_commit
$self->option("smartsmoke") $current_commit eq $old_commit
Truth table66%2/3
A and B
A= $self->option("smartsmoke")B= $current_commit eq $old_commit
ABresult
0X0
100
111
72 0 $self->log_warn("Skipping this smoke, commit(%s) did not change.", $old_commit);
73 0 return;
74 }
75 {
76 2 local @ARGV = @{$self->ARGV};
77 2 $self->{_runsmoke} = Test::Smoke::App::RunSmoke->new(
78 $opt->runsmoke_config()
79 );
80 2 $self->log_info("==> Starting runsmoke");
81 2 $self->runsmoke->run();
82 }
83  
84 2 ▶ if ($self->option('report')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->option('report')) { } 1 1 2
85 1 local @ARGV = @{$self->ARGV};
86 1 $self->{_reporter} = Test::Smoke::App::Reporter->new(
87 $opt->reporter_config()
88 );
89 1 $self->log_info("==> Starting reporter");
90 1 $self->reporter->run();
91 }
92 else {
93 1 $self->log_warn("==> Skipping reporter");
94 }
95  
96 2 ▶ if ($self->option('sendreport')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->option('sendreport')) { } 1 1 2
97 1 local @ARGV = @{$self->ARGV};
98 1 $self->{_sendreport} = Test::Smoke::App::SendReport->new(
99 $opt->sendreport_config()
100 );
101 1 $self->log_info("==> Starting sendreport");
102 1 $self->sendreport->run();
103 }
104 else {
105 1 $self->log_warn("==> Skipping sendreport");
106 }
107  
108 2 ▶ if ($self->option('archive')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->option('archive')) { } 1 1 2
109 1 local @ARGV = @{$self->ARGV};
110 1 $self->{_archiver} = Test::Smoke::App::Archiver->new(
111 $opt->archiver_config()
112 );
113 1 $self->log_info("==> Starting archiver");
114 1 $self->archiver->run();
115 }
116 else {
117 1 $self->log_warn("==> Skipping archiver");
118 }
119 }
120  
121 1 1;
122  
123 =head1 COPYRIGHT
124  
125 (c) 2002-2013, Abe Timmerman <abeltje@cpan.org> All rights reserved.
126  
127 With contributions from Jarkko Hietaniemi, Merijn Brand, Campo
128 Weijerman, Alan Burlison, Allen Smith, Alain Barbet, Dominic Dunlop,
129 Rich Rauenzahn, David Cantrell.
130  
131 This library is free software; you can redistribute it and/or modify
132 it under the same terms as Perl itself.
133  
134 See:
135  
136 =over 4
137  
138 =item * L<http://www.perl.com/perl/misc/Artistic.html>
139  
140 =item * L<http://www.gnu.org/copyleft/gpl.html>
141  
142 =back
143  
144 This program is distributed in the hope that it will be useful,
145 but WITHOUT ANY WARRANTY; without even the implied warranty of
146 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
147  
148 =cut
« blib/lib/Test/Smoke/Util/Win32ErrorMode.pm ↑ Summary blib/lib/Test/Smoke/Poster/Curl.pm »