blib/lib/Test/PPPort.pm

filter: Statementstmt 100% 32 / 32 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 97.7% 43 / 44 CC 4 SCAR 9.2
CC
4
Cov
100%
ppport_ok
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.5
« t/sandbox/fail/ppport.h ↑ Summary
1 package Test::PPPort;
2 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 our $VERSION = '0.03';
5  
6 5 require Test::More;
7  
8 5 my $Test = Test::More->builder;
9  
10 5 ▶sub import {
Subroutine import: called CC=1 SCAR=0.0
11 5 my $self = shift;
12 5 my $caller = caller;
13  
14 {
15 5 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
16 5 *{"$caller\::ppport_ok"} = \&ppport_ok;
17 }
18  
19 5 $Test->exported_to($caller);
20 5 $Test->plan(@_);
21 }
22  
23 4 ▶sub ppport_ok {
Subroutine ppport_ok: called CC=4 SCAR=13.9
Pod undocumented
24 4 ▶ unless (-f 'ppport.h') {
Branch: 1 branch
BranchTrueFalseTotal
unless (-f "ppport.h") 1 3 4
25 1 $Test->skip_all('No such ppport.h file');
26 1 return;
27 }
28  
29 3 my $cmd = "$^X ppport.h";
30 3 my @result = `$cmd 2>&1`;
31 3 ▶ if ($result[0] =~ /^No input files given/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($result[0] =~ /^No input files given/) { } 1 2 3
32 1 $Test->skip_all( "No such XS files");
33 } else {
34 2 $Test->plan( tests => 1 );
35 2 ▶ if ($result[-1] =~ /^Looks good/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($result[-1] =~ /^Looks good/) { } 1 1 2
36 1 $Test->ok( 1, $cmd);
37 } else {
38 1 $Test->ok( 0, $cmd);
39 1 $Test->diag("\nppport.h result:\n@result\n");
40 }
41 }
42 }
43  
44 5 1;
45 __END__
« t/sandbox/fail/ppport.h ↑ Summary