line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Alien::CPP; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
384591
|
use strict; |
|
3
|
|
|
|
|
15
|
|
|
3
|
|
|
|
|
71
|
|
4
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
55
|
|
5
|
3
|
|
|
3
|
|
58
|
use 5.008001; |
|
3
|
|
|
|
|
10
|
|
6
|
3
|
|
|
3
|
|
1176
|
use ExtUtils::CppGuess; |
|
3
|
|
|
|
|
74919
|
|
|
3
|
|
|
|
|
95
|
|
7
|
3
|
|
|
3
|
|
1259
|
use Test::Alien 1.88 (); |
|
3
|
|
|
|
|
72489
|
|
|
3
|
|
|
|
|
84
|
|
8
|
3
|
|
|
3
|
|
29
|
use Text::ParseWords qw( shellwords ); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
131
|
|
9
|
3
|
|
|
3
|
|
17
|
use base qw( Exporter ); |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
1143
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ABSTRACT: Testing tools for Alien modules for projects that use C++ |
12
|
|
|
|
|
|
|
our $VERSION = '1.02'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @EXPORT = @Test::Alien::EXPORT; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Test::Alien->import(grep !/^xs_ok$/, @EXPORT); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub xs_ok |
21
|
|
|
|
|
|
|
{ |
22
|
4
|
|
|
4
|
1
|
967877
|
my $cb; |
23
|
4
|
50
|
33
|
|
|
53
|
$cb = pop if defined $_[-1] && ref $_[-1] eq 'CODE'; |
24
|
4
|
|
|
|
|
14
|
my($xs, $message) = @_; |
25
|
|
|
|
|
|
|
|
26
|
4
|
50
|
|
|
|
14
|
if(ref($xs)) |
27
|
|
|
|
|
|
|
{ |
28
|
4
|
|
|
|
|
18
|
my %xs = %$xs; |
29
|
4
|
|
|
|
|
11
|
$xs = \%xs; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
else |
32
|
|
|
|
|
|
|
{ |
33
|
0
|
0
|
|
|
|
0
|
$xs = { xs => $xs } unless ref $xs; |
34
|
|
|
|
|
|
|
} |
35
|
4
|
|
|
|
|
18
|
$xs->{pxs}->{'C++'} = 1; |
36
|
4
|
|
|
|
|
12
|
$xs->{c_ext} = 'cpp'; |
37
|
|
|
|
|
|
|
|
38
|
4
|
|
|
|
|
15
|
my %stage = ( |
39
|
|
|
|
|
|
|
extra_compiler_flags => 'cbuilder_compile', |
40
|
|
|
|
|
|
|
extra_linker_flags => 'cbuilder_link', |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
4
|
|
|
|
|
82
|
my %cppguess = ExtUtils::CppGuess->new->module_build_options; |
44
|
4
|
|
|
|
|
205271
|
foreach my $name (qw( extra_compiler_flags extra_linker_flags )) |
45
|
|
|
|
|
|
|
{ |
46
|
8
|
50
|
|
|
|
63
|
next unless defined $cppguess{$name}; |
47
|
8
|
50
|
|
|
|
191
|
my @new = ref($cppguess{$name}) eq 'ARRAY' ? @{ delete $cppguess{$name} } : shellwords(delete $cppguess{$name}); |
|
0
|
|
|
|
|
0
|
|
48
|
8
|
|
|
|
|
1505
|
my @old = do { |
49
|
8
|
|
|
|
|
81
|
my $value = delete $xs->{$stage{$name}}->{$name}; |
50
|
8
|
100
|
|
|
|
61
|
ref($value) eq 'ARRAY' ? @$value : shellwords($value); |
51
|
|
|
|
|
|
|
}; |
52
|
8
|
|
|
|
|
217
|
$xs->{$stage{$name}}->{$name} = [@old, @new]; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
4
|
50
|
|
|
|
60
|
$xs->{cbuilder_config} = delete $cppguess{config} if defined $cppguess{config}; |
56
|
4
|
|
|
|
|
45
|
$xs->{cbuilder_check} = 'have_cplusplus'; |
57
|
|
|
|
|
|
|
|
58
|
4
|
|
|
|
|
29
|
warn "extra Module::Build option: $_" for keys %cppguess; |
59
|
|
|
|
|
|
|
|
60
|
4
|
50
|
|
|
|
104
|
$cb ? Test::Alien::xs_ok($xs, $message, $cb) : Test::Alien::xs_ok($xs, $message); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |