| 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
| |||||||||||
| 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
| |||||||||||
| 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
| |||||||||||
| 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__ | ||||||||||