Branch Coverage

File:blib/lib/ExtUtils/ParseXS.pm
Coverage:46.4%

line%coveragebranch
4050TF@_ % 2 ? :
6550TFif ($^O eq 'VMS')
8950TF$args{'except'} ? :
94100TFref $args{'typemap'} ? :
9750TFunless $_
10550TFunless open $FH, $args{'filename'}
109100TFif (not ref $args{'output'})
11050TFunless open my $fh, "> $args{'output'}"
12450TFif ($WantLineNumbers) { }
126100TFif ($args{'outfile'}) { }
13050TFunless $cfile =~ s/\.xs$/$csuffix/i
13950TFunless -r $typemap
145100TFunless -f $typemap
14750TFunless -T $typemap
14950TFunless open TYPEMAP, $typemap
15550TFif /^\s*\t\t#/
157100TFif (/^INPUT\s*$/)
160100TFif (/^OUTPUT\s*$/)
163100TFif (/^TYPEMAP\s*$/)
166100TFif ($mode eq 'Typemap') { }
100TFelsif (/^\s/) { }
100TFelsif ($mode eq 'Input') { }
171100TFif /^$/ or /^#/
17250TFunless my($type, $kind, $proto) = /^\s*(.*?\S)\s+(\S+)\s*($proto_re*)\s*$/
17750TFunless $proto
17850TFunless &ValidProtoString($proto)
223100TFif $t
26350TFif $WantLineNumbers
26850TFif (/^=/)
2710TFif (/^=cut\s*$/)
2860TFif $WantLineNumbers
2950TFunless $lastline
298100TFif ($Package, $Prefix) = /^MODULE\s*=\s*[\w:]+(?:\s+PACKAGE\s*=\s*([\w:]+))?(?:\s+PREFIX\s*=\s*(\S+))?\s*$/
30350TFunless (defined $_)
30850TFif $WantLineNumbers
35850TFif $WantLineNumbers
3690TFunless $line =~ /^\#\s*((if)(?:n?def)?|elsif|else|endif)\b/
3710TFif ($statement eq 'if') { }
3750TFif $XSStack[-1]{'type'} ne 'if'
3770TFif ($XSStack[-1]{'varname'})
3830TFif ($statement ne 'endif') { }
398100TFunless @line
40050TFif ($XSS_work_idx and not $XSStack[$XSS_work_idx]{'varname'})
40850TFif $line[0] =~ /^\s/
44150TFunless @line
44550TFif (check_keyword('BOOT'))
4470TFif $WantLineNumbers and not $line[0] =~ /^\s*#\s*line\b/
45650TFif $ret_type =~ s/^NO_OUTPUT\s+//
45950TFif $process_argtypes and $ret_type =~ s/^(.*?\w.*?)\s*\b(\w+\s*\(.*)/$1/s
46450TFunless @line
46750TFif $ret_type =~ s/^extern "C"\s+//
46850TFif $ret_type =~ s/^static\s+//
47150TFunless $func_header =~ /^(?:([\w:]*)::)?(\w+)\s*\(\s*(.*?)\s*\)\s*(const)?\s*(;\s*)?$/s
47550TFif $4
47950TFif ($Is_VMS)
48550TFunless defined $$tmp{'functions'}{$Full_func_name}
497100TFif ($process_argtypes and $orig_args =~ /\S/) { }
49950TFif ($args =~ /^( (??{ $C_arg }) , )* $ /x) { }
508100TFunless defined $pre and length $pre
51150TFif ($process_inout and s/^(IN|IN_OUTLIST|OUTLIST|OUT|IN_OUT)\s+//)
5130TFif $type ne 'IN'
51850TFif ($name =~ /^length\( \s* (\w+) \s* \)\z/x)
5210TFif length $default
52450TFif (length $pre or $islength)
52550TFif ($islength) { }
53450TFif $out_type eq 'OUTLIST' or $islength
53550TFif $out_type =~ /OUTLIST$/
53650TFif $out_type
5450TFif ($process_inout and s/^(IN|IN_OUTLIST|OUTLIST|IN_OUT|OUT)\s+//)
5470TFif $out_type eq 'IN'
5480TFif $out_type eq 'OUTLIST'
5490TFif $out_type =~ /OUTLIST$/
554100TFif (defined $class)
555100TFdefined $static || $func_name eq 'new' ? :
565100TFif ($args[$i] =~ s/\.\.\.//)
56750TFif ($args[$i] eq '' and $i == $#args)
57350TFif ($only_C_inlist{$args[$i]}) { }
579100TFif ($args[$i] =~ /^([^=]*[^\s=])\s*=\s*(.*)/s)
591100TFif defined $class
59450TFif $in_out{$_}
60850TFif $EXPLICIT_RETURN
61050TF$externC ? :
624100TFif $ALIAS
627100TFif $INTERFACE
630100TFif ($ellipsis) { }
100TFelsif ($min_args == $num_args) { }
631100TF$min_args ? :
63850TFif $except
643100TFif ($cond) { }
660100TFif $PPCODE
664100TFif $PPCODE
67750TFif check_keyword('CASE')
69250TFif $ScopeThisXSUB
697100TFif (not $thisdone and defined $class)
698100TFif (defined $static or $func_name eq 'new') { }
71150TFif (/^\s*NOT_IMPLEMENTED_YET/) { }
715100TFif ($ret_type ne 'void')
71650TFif not $retvaldone
720100TFif $WantOptimize and $targetable{$type_kind{$ret_type}}
724100TFif (@fake_INPUT or @fake_INPUT_pre)
734100TFif (check_keyword('PPCODE')) { }
100TFelsif (check_keyword('CODE')) { }
100TFelsif (defined $class and $func_name eq 'DESTROY') { }
73650TFif @line
73750TFif $ScopeThisXSUB
746100TFif ($ret_type ne 'void')
75050TFif (defined $static) { }
100TFelsif (defined $class) { }
7510TFif ($func_name eq 'new') { }
75750TFif ($func_name eq 'new') { }
76350TFif exists $args{'s'}
765100TFif $interface
77450TFif $RETVAL_no_return
78250TFif ($gotRETVAL and $RETVAL_code) { }
100TFelsif ($gotRETVAL or $wantRETVAL) { }
790100TFif ($t and not $$t[1] and $$t[0] eq 'p') { }
100TFelsif ($t) { }
79350TFif $@
80050TFif $@
80350TFunless defined $size
80550TFif $@
815100TFif $ret_type ne 'void'
81850TFif $c and not $prepush_done
81950TFif $c
82650TFif $ScopeThisXSUB
82950TFif $ScopeThisXSUB and not $PPCODE
83750TFif $except
84350TFif (check_keyword('CASE'))
8440TFunless $condnum
84950TFif $_ eq "${END}:"
8500TF/^$BLOCK_re/o ? :
85350TFif $except
858100TFif ($xsreturn) { }
85950TFunless $PPCODE
863100TFunless $PPCODE
877100TFif ($ProtoThisXSUB)
88050TFif ($ProtoThisXSUB eq 2) { }
50TFelsif ($ProtoThisXSUB eq 1) { }
88550TFif ($min_args < $num_args)
88950TFif $ellipsis
901100TFif (%XsubAliases) { }
50TFelsif (@Attributes) { }
100TFelsif ($interface) { }
90250TFunless defined $XsubAliases{$pname}
90950TFif $proto
92250TFunless $name =~ /::/
92750TFif $proto
93850TFif ($Overload)
98250TF$] < 5.009 ? :
98650TFif $Full_func_name
99750TFif $WantVersionChk
1002100TFif defined $XsubAliases or defined $Interfaces
100850TFif $Overload
1022100TFif defined $XsubAliases or defined $Interfaces
102650TFif (@BootCode)
103450TFif ($] >= 5.009)
104750TFunless $ProtoUsed
105250TFif tied *PSEUDO_STDOUT
1073100TFif -e $file
1105100TFif s/^(\s*)($_[0])\s*:\s*(?:#.*)?/$1/s
111250TFif $WantLineNumbers and not /^\s*#\s*line\b/ and not /^#if XSubPPtmp/
111750TFif $WantLineNumbers
11440TFif $condnum and $cond eq ''
11480TF$condnum++ ? :
0TF$cond ? :
115450TFif /^\s*NOT_IMPLEMENTED_YET/
1155100TFunless /\S/
116150TFunless /[=;+].*\S/
116450TFif (s/^([^=]*)\blength\(\s*(\w+)\s*\)\s*$/$1 XSauto_length_of_$2=NO_INIT/x)
117350TFif s/\s*([=;+].*)$//s
117750TFunless my($var_type, $var_addr, $var_name) = /^(.*?[^&\s])\s*(\&?)\s*\b(\w+)$/s
118150TFif $arg_list{$var_name}++ or defined $argtype_seen{$var_name} and not $processing_arg_with_types
119150TFif ($var_type =~ / \( \s* \* \s* \) /x) { }
120150TFif $var_num
120350TFif $var_addr
120450TFif ($var_init =~ /^[=;]\s*NO_INIT\s*;?\s*$/ or $in_out{$var_name} and $in_out{$var_name} =~ /^OUT/ and not $var_init =~ /\S/) { }
50TFelsif ($var_init =~ /\S/) { }
50TFelsif ($var_num) { }
12070TFif ($name_printed) { }
1225100TFunless /\S/
122650TFif (/^\s*SETMAGIC\s*:\s*(ENABLE|DISABLE)\s*/)
12270TF$1 eq 'ENABLE' ? :
123150TFif $outargs{$outarg}++
123350TFif (not $gotRETVAL and $outarg eq 'RETVAL')
12390TFunless defined $args_match{$outarg}
12410TFunless defined $var_types{$outarg}
12440TFif ($outcode) { }
12460TFif $DoSetMagic
12500TFif exists $in_out{$outarg} and $in_out{$outarg} =~ /OUT$/
12660TFif ($in =~ /\s/) { }
1315100TFif not $alias =~ /::/
131850TFif defined $XsubAliases{$alias}
132150TFif $XsubAliasValues{$value}
132950TFif $line
13360TFunless /\S/
1345100TFunless /\S/
134750TFif $_
13540TFunless /\S/
13570TFunless $Overload
13780TFunless exists $map{uc $_}
13910TFunless $Ver
13950TFunless $Ver =~ /^\d+(\.\d*)?/
13980TFunless $VERSION >= $Ver
14100TFunless /^(ENABLE|DISABLE)/i
14130TFif $1 eq 'ENABLE'
14140TFif $1 eq 'DISABLE'
14220TFif $proto_in_this_xsub++
14260TFunless /\S/
14290TFif ($_ eq 'DISABLE') { }
0TFelsif ($_ eq 'ENABLE') { }
14360TFunless ValidProtoString $_
14430TFunless $specified
14510TFif $scope_in_this_xsub++
14550TFunless /\S/
14570TFif ($_ =~ /^DISABLE/i) { }
0TFelsif ($_ =~ /^ENABLE/i) { }
147450TFunless /^(ENABLE|DISABLE)/i
1477100TFif $1 eq 'ENABLE'
1478100TFif $1 eq 'DISABLE'
14890TFunless $_
14920TFif /^\s*\|/
14960TFif $IncludedFiles{$_}
14990TFunless /\|\s*$/
15160TFunless open $FH, "$_"
15310TFunless /^\s*$/
154150TFunless $XSStack[-1]{'type'} eq 'file'
15470TFunless $isPipe
15630TFif ($isPipe and $?)
158250TFif ($string =~ /^$proto_re+$/)
160150TFunless $proto_letter{$type}
160650TFif (@cpp)
16090TFif ($cpp =~ /^\#\s*if/) { }
0TFelsif (not $cpplevel) { }
0TFelsif ($cpp =~ /^\#\s*endif/) { }
16130TFif $XSStack[-1]{'type'} eq 'if'
16200TFif $cpplevel
163650TFif not defined $lastline and $XSStack[-1]{'type'} eq 'if'
1640100TFif not defined $lastline
1642100TFif ($lastline =~ /^MODULE\s*=\s*([\w:]+)(?:\s+PACKAGE\s*=\s*([\w:]+))?(?:\s+PREFIX\s*=\s*(\S+))?\s*$/)
164550TFdefined $2 ? :
1646100TFdefined $3 ? :
165150TFif $Packprefix ne ''
16590TFif $lastline =~ /^=cut\s*$/
16610TFunless $lastline
166650TFif (not $lastline =~ /^\s*#/ or $lastline =~ /^#[ \t]*(?:(?:if|ifn?def|elif|else|endif|define|undef|pragma|error|warning|line\s+\d+|ident)\b|(?:include(?:_next)?|import)\s*["<].*[>"])/)
1674100TFif $lastline =~ /^\S/ and @line and $line[-1] eq ''
1680100TFunless defined($lastline = <$FH>)
16970TFif ($init =~ /^=/) { }
16980TFif ($name_printed) { }
17030TFif $@
17050TFif ($init =~ s/^\+// and $num) { }
0TFelsif ($name_printed) { }
17120TFif $@
17160TFif $@
174850TFunless defined $type_kind{$type}
1754100TFif $func_name =~ /DESTROY$/
175550TFif ($tk eq 'T_PV' and exists $lengthof{$var})
17560TFunless $name_printed
17580TFif defined $defaults{$var}
176250TFunless $hiertype
176350TFunless defined $input_expr{$tk}
176650TFif ($expr =~ /DO_ARRAY_ELEM/)
17670TFunless defined $type_kind{$subtype}
17690TFunless defined $input_expr{$type_kind{$subtype}}
178050TFif ($expr =~ m[/\*.*scope.*\*/]i)
1783100TFif (defined $defaults{$var}) { }
100TFelsif ($ScopeThisXSUB or not $expr =~ /^\s*\$var =/) { }
178650TFif ($name_printed) { }
179050TFif $@
179250TFif ($defaults{$var} eq 'NO_INIT') { }
179750TFif $@
179950TFif ($name_printed) { }
180350TFif $@
180650TFif $@
180850TFif $name_printed
181150TFif $@
182250TFif ($type =~ /^array\(([^,]*),(.*)\)/) { }
18250TFif $do_setmagic
182750TFunless defined $type_kind{$type}
182950TFunless defined $output_expr{$type_kind{$type}}
183550TFif ($expr =~ /DO_ARRAY_ELEM/) { }
50TFelsif ($var eq 'RETVAL') { }
0TFelsif ($do_push) { }
0TFelsif ($arg =~ /^ST\(\d+\)$/) { }
18360TFunless defined $type_kind{$subtype}
18380TFunless defined $output_expr{$type_kind{$subtype}}
18470TFif $@
18480TFif $do_setmagic
185050TFif ($expr =~ /^\t\$arg = new/) { }
50TFelsif ($expr =~ /^\s*\$arg\s*=/) { }
18540TFif $@
18560TFif $do_setmagic
18610TFif $@
18630TFif $do_setmagic
187150TFif $@
18780TFif $@
18790TFif $do_setmagic
18820TFif $@
18830TFif $do_setmagic
189250TFunless $hiertype
1894100TFif ($varname)
189550TFif ($varname and $type =~ / \( \s* \* (?= \s* \) ) /gx) { }