t/cgi/cgitest.pl

filter: Statementstmt 80.9% 17 / 21 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 70.5% 24 / 34 CC 1 SCAR 0.0
CC
1
Cov
71%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/CGI/Github/Webhook.pm ↑ Summary
1 #!/usr/bin/env perl
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # Very ugly hack to get test suite working if the used perl binary is
8 # not the one which is found first in $PATH. See
9 # https://github.com/xtaran/CGI-Github-Webhook/issues/1
10 2 ▶use File::Basename;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶if (defined $ENV{PERL} and $ENV{PERL} ne $^X) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ENV{"PERL"} and $ENV{"PERL"} ne $^X) 0 2 2
Condition33%1/3
defined $ENV{"PERL"} and $ENV{"PERL"} ne $^X
!ll&&!rl&&r
020
MC/DC0%0/2
defined $ENV{"PERL"} and $ENV{"PERL"} ne $^X
defined $ENV{"PERL"} $ENV{"PERL"} ne $^X
Truth table33%1/3
A and B
A= defined $ENV{"PERL"}B= $ENV{"PERL"} ne $^X
ABresult
0X0
100
111
12 0 my $dir = dirname($0);
13 0 $ENV{PERL5LIB} = "$ENV{PERL5LIB}:$dir/../../lib:$dir/../../blib";
14 0 exec $ENV{PERL}, $0;
15 }
16  
17 2 require CGI::Github::Webhook;
18  
19 2 my $ghwh = CGI::Github::Webhook->new(
20 trigger => 'echo foo',
21 trigger_backgrounded => 0,
22 secret => 'bar',
23 log => '/dev/stdout',
24 );
25 2 my $rc = $ghwh->run();
26  
27 2 ▶if ($rc) {
Branch: 1 branch
BranchTrueFalseTotal
if ($rc) { } 0 2 2
28 0 exit 0
29 } else {
30 2 exit 1
31 }
« blib/lib/CGI/Github/Webhook.pm ↑ Summary