Branch Coverage

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

line%coveragebranch
4650TF@_ % 2 ? :
7150TFif ($^O eq 'VMS')
9550TF$args{'except'} ? :
100100TFref $args{'typemap'} ? :
10650TFunless $_
11450TFunless open $FH, $args{'filename'}
118100TFif (not ref $args{'output'})
11950TFunless open my $fh, "> $args{'output'}"
13350TFif ($WantLineNumbers) { }
135100TFif ($args{'outfile'}) { }
14050TFunless $cfile =~ s/\.xs$/$csuffix/i
15050TFunless -r $typemap
156100TFunless -f $typemap
15850TFunless -T $typemap
16050TFunless open TYPEMAP, $typemap
16750TFif /^\s* #/
169100TFif (/^INPUT\s*$/)
172100TFif (/^OUTPUT\s*$/)
175100TFif (/^TYPEMAP\s*$/)
178100TFif ($mode eq 'Typemap') { }
100TFelsif (/^\s/) { }
100TFelsif ($mode eq 'Input') { }
183100TFif /^$/ or /^#/
18450TFunless my($type, $kind, $proto) = /^\s*(.*?\S)\s+(\S+)\s*($proto_re*)\s*$/
19050TFunless $proto
19150TFunless &ValidProtoString($proto)
240100TFif $t
27750TFif $WantLineNumbers
28250TFif (/^=/)
2850TFif (/^=cut\s*$/)
3000TFif $WantLineNumbers
3080TFunless $lastline
311100TFif ($Package, $Prefix) = /^MODULE\s*=\s*[\w:]+(?:\s+PACKAGE\s*=\s*([\w:]+))?(?:\s+PREFIX\s*=\s*(\S+))?\s*$/
31650TFunless (defined $_)
32150TFif $WantLineNumbers
37150TFif $WantLineNumbers
3860TFunless $line =~ /^\#\s*((if)(?:n?def)?|elsif|else|endif)\b/
3880TFif ($statement eq 'if') { }
3930TFif $XSStack[-1]{'type'} ne 'if'
3950TFif ($XSStack[-1]{'varname'})
4010TFif ($statement ne 'endif') { }
417100TFunless @line
41950TFif ($XSS_work_idx and not $XSStack[$XSS_work_idx]{'varname'})
42750TFif $line[0] =~ /^\s/
46150TFunless @line
46550TFif (check_keyword('BOOT'))
4670TFif $WantLineNumbers and not $line[0] =~ /^\s*#\s*line\b/
47650TFif $ret_type =~ s/^NO_OUTPUT\s+//
47950TFif $process_argtypes and $ret_type =~ s/^(.*?\w.*?)\s*\b(\w+\s*\(.*)/$1/s
48450TFunless @line
48750TFif $ret_type =~ s/^extern "C"\s+//
48850TFif $ret_type =~ s/^static\s+//
49150TFunless $func_header =~ /^(?:([\w:]*)::)?(\w+)\s*\(\s*(.*?)\s*\)\s*(const)?\s*(;\s*)?$/s
49650TFif $4
50150TFif ($Is_VMS)
50750TFunless defined $$tmp{'functions'}{$Full_func_name}
519100TFif ($process_argtypes and $orig_args =~ /\S/) { }
52150TFif ($args =~ /^( (??{ $C_arg }) , )* $ /x) { }
530100TFunless defined $pre and length $pre
53350TFif ($process_inout and s/^(IN|IN_OUTLIST|OUTLIST|OUT|IN_OUT)\s+//)
5350TFif $type ne 'IN'
54050TFif ($name =~ /^length\( \s* (\w+) \s* \)\z/x)
5430TFif length $default
54650TFif (length $pre or $islength)
54750TFif ($islength) { }
55750TFif $out_type eq 'OUTLIST' or $islength
55850TFif $out_type =~ /OUTLIST$/
55950TFif $out_type
5700TFif ($process_inout and s/^(IN|IN_OUTLIST|OUTLIST|IN_OUT|OUT)\s+//)
5720TFif $out_type eq 'IN'
5730TFif $out_type eq 'OUTLIST'
5750TFif $out_type =~ /OUTLIST$/
580100TFif (defined $class)
581100TFdefined $static || $func_name eq 'new' ? :
590100TFif ($args[$i] =~ s/\.\.\.//)
59250TFif ($args[$i] eq '' and $i == $#args)
59850TFif ($only_C_inlist{$args[$i]}) { }
605100TFif ($args[$i] =~ /^([^=]*[^\s=])\s*=\s*(.*)/s)
617100TFif defined $class
62050TFif $in_out{$_}
63450TFif $EXPLICIT_RETURN
63650TF$externC ? :
650100TFif $ALIAS
653100TFif $INTERFACE
656100TFif ($ellipsis) { }
100TFelsif ($min_args == $num_args) { }
657100TF$min_args ? :
66650TFif $except
671100TFif ($cond) { }
689100TFif $PPCODE
693100TFif $PPCODE
70650TFif check_keyword('CASE')
72150TFif $ScopeThisXSUB
726100TFif (not $thisdone and defined $class)
727100TFif (defined $static or $func_name eq 'new') { }
74050TFif (/^\s*NOT_IMPLEMENTED_YET/) { }
745100TFif ($ret_type ne 'void')
74650TFif not $retvaldone
750100TFif $WantOptimize and $targetable{$type_kind{$ret_type}}
754100TFif (@fake_INPUT or @fake_INPUT_pre)
764100TFif (check_keyword('PPCODE')) { }
100TFelsif (check_keyword('CODE')) { }
100TFelsif (defined $class and $func_name eq 'DESTROY') { }
76650TFif @line
76750TFif $ScopeThisXSUB
779100TFif ($ret_type ne 'void')
78350TFif (defined $static) { }
100TFelsif (defined $class) { }
7840TFif ($func_name eq 'new') { }
79250TFif ($func_name eq 'new') { }
79950TFif exists $args{'s'}
801100TFif $interface
81050TFif $RETVAL_no_return
81850TFif ($gotRETVAL and $RETVAL_code) { }
100TFelsif ($gotRETVAL or $wantRETVAL) { }
827100TFif ($t and not $$t[1] and $$t[0] eq 'p') { }
100TFelsif ($t) { }
83050TFif $@
83750TFif $@
84050TFunless defined $size
84250TFif $@
852100TFif $ret_type ne 'void'
85550TFif $c and not $prepush_done
85650TFif $c
86350TFif $ScopeThisXSUB
86650TFif $ScopeThisXSUB and not $PPCODE
87450TFif $except
88050TFif (check_keyword('CASE'))
8810TFunless $condnum
88650TFif $_ eq "${END}:"
8870TF/^$BLOCK_re/o ? :
89050TFif $except
895100TFif ($xsreturn) { }
89650TFunless $PPCODE
901100TFunless $PPCODE
915100TFif ($ProtoThisXSUB)
91850TFif ($ProtoThisXSUB eq 2) { }
50TFelsif ($ProtoThisXSUB eq 1) { }
92350TFif ($min_args < $num_args)
92750TFif $ellipsis
938100TFif (%XsubAliases) { }
50TFelsif (@Attributes) { }
100TFelsif ($interface) { }
93950TFunless defined $XsubAliases{$pname}
94650TFif $proto
95950TFunless $name =~ /::/
96450TFif $proto
97650TFif ($Overload)
101950TF$] < 5.009 ? :
102350TFif $Full_func_name
103450TFif $WantVersionChk
1039100TFif defined $XsubAliases or defined $Interfaces
104550TFif $Overload
1059100TFif defined $XsubAliases or defined $Interfaces
106350TFif (@BootCode)
107050TFif ($] >= 5.009)
108350TFunless $ProtoUsed
108850TFif tied *PSEUDO_STDOUT
1108100TFif -e $file
1138100TFif s/^(\s*)($_[0])\s*:\s*(?:#.*)?/$1/s
114550TFif $WantLineNumbers and not /^\s*#\s*line\b/ and not /^#if XSubPPtmp/
115050TFif $WantLineNumbers
11770TFif $condnum and $cond eq ''
11810TF$condnum++ ? :
0TF$cond ? :
118750TFif /^\s*NOT_IMPLEMENTED_YET/
1188100TFunless /\S/
119450TFunless /[=;+].*\S/
119750TFif (s/^([^=]*)\blength\(\s*(\w+)\s*\)\s*$/$1 XSauto_length_of_$2=NO_INIT/x)
120650TFif s/\s*([=;+].*)$//s
121050TFunless my($var_type, $var_addr, $var_name) = /^(.*?[^&\s])\s*(\&?)\s*\b(\w+)$/s
121450TFif $arg_list{$var_name}++ or defined $argtype_seen{$var_name} and not $processing_arg_with_types
122550TFif ($var_type =~ / \( \s* \* \s* \) /x) { }
123650TFif $var_num
123850TFif $var_addr
123950TFif ($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) { }
12430TFif ($name_printed) { }
1265100TFunless /\S/
126650TFif (/^\s*SETMAGIC\s*:\s*(ENABLE|DISABLE)\s*/)
12670TF$1 eq 'ENABLE' ? :
127150TFif $outargs{$outarg}++
127350TFif (not $gotRETVAL and $outarg eq 'RETVAL')
12790TFunless defined $args_match{$outarg}
12810TFunless defined $var_types{$outarg}
12840TFif ($outcode) { }
12860TFif $DoSetMagic
12910TFif exists $in_out{$outarg} and $in_out{$outarg} =~ /OUT$/
13070TFif ($in =~ /\s/) { }
1356100TFif not $alias =~ /::/
135950TFif defined $XsubAliases{$alias}
136250TFif $XsubAliasValues{$value}
137050TFif $line
13760TFunless /\S/
1384100TFunless /\S/
138650TFif $_
13920TFunless /\S/
13950TFunless $Overload
14150TFunless exists $map{uc $_}
14270TFunless $Ver
14310TFunless $Ver =~ /^\d+(\.\d*)?/
14340TFunless $VERSION >= $Ver
14450TFunless /^(ENABLE|DISABLE)/i
14480TFif $1 eq 'ENABLE'
14490TFif $1 eq 'DISABLE'
14560TFif $proto_in_this_xsub++
14600TFunless /\S/
14630TFif ($_ eq 'DISABLE') { }
0TFelsif ($_ eq 'ENABLE') { }
14720TFunless ValidProtoString $_
14790TFunless $specified
14850TFif $scope_in_this_xsub++
14890TFunless /\S/
14910TFif ($_ =~ /^DISABLE/i) { }
0TFelsif ($_ =~ /^ENABLE/i) { }
150750TFunless /^(ENABLE|DISABLE)/i
1510100TFif $1 eq 'ENABLE'
1511100TFif $1 eq 'DISABLE'
15210TFunless $_
15240TFif /^\s*\|/
15280TFif $IncludedFiles{$_}
15310TFunless /\|\s*$/
15480TFunless open $FH, "$_"
15630TFunless /^\s*$/
157150TFunless $XSStack[-1]{'type'} eq 'file'
15770TFunless $isPipe
15930TFif ($isPipe and $?)
161150TFif ($string =~ /^$proto_re+$/)
162850TFunless $proto_letter{$type}
163350TFif (@cpp)
16360TFif ($cpp =~ /^\#\s*if/) { }
0TFelsif (not $cpplevel) { }
0TFelsif ($cpp =~ /^\#\s*endif/) { }
16410TFif $XSStack[-1]{'type'} eq 'if'
16490TFif $cpplevel
166550TFif not defined $lastline and $XSStack[-1]{'type'} eq 'if'
1669100TFif not defined $lastline
1671100TFif ($lastline =~ /^MODULE\s*=\s*([\w:]+)(?:\s+PACKAGE\s*=\s*([\w:]+))?(?:\s+PREFIX\s*=\s*(\S+))?\s*$/)
167450TFdefined $2 ? :
1675100TFdefined $3 ? :
168050TFif $Packprefix ne ''
16880TFif $lastline =~ /^=cut\s*$/
16900TFunless $lastline
169550TFif (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*["<].*[>"])/)
1703100TFif $lastline =~ /^\S/ and @line and $line[-1] eq ''
1709100TFunless defined($lastline = <$FH>)
17280TFif ($init =~ /^=/) { }
17290TFif ($name_printed) { }
17350TFif $@
17380TFif ($init =~ s/^\+// and $num) { }
0TFelsif ($name_printed) { }
17470TFif $@
17510TFif $@
178050TFunless defined $type_kind{$type}
1786100TFif $func_name =~ /DESTROY$/
178750TFif ($tk eq 'T_PV' and exists $lengthof{$var})
17880TFunless $name_printed
17900TFif defined $defaults{$var}
179450TFunless $hiertype
179550TFunless defined $input_expr{$tk}
179850TFif ($expr =~ /DO_ARRAY_ELEM/)
17990TFunless defined $type_kind{$subtype}
18010TFunless defined $input_expr{$type_kind{$subtype}}
181250TFif ($expr =~ m[/\*.*scope.*\*/]i)
1815100TFif (defined $defaults{$var}) { }
100TFelsif ($ScopeThisXSUB or not $expr =~ /^\s*\$var =/) { }
181850TFif ($name_printed) { }
182350TFif $@
182550TFif ($defaults{$var} eq 'NO_INIT') { }
183150TFif $@
183450TFif ($name_printed) { }
183950TFif $@
184250TFif $@
184550TFif $name_printed
184850TFif $@
185950TFif ($type =~ /^array\(([^,]*),(.*)\)/) { }
18620TFif $do_setmagic
186550TFunless defined $type_kind{$type}
186750TFunless defined $output_expr{$type_kind{$type}}
187350TFif ($expr =~ /DO_ARRAY_ELEM/) { }
50TFelsif ($var eq 'RETVAL') { }
0TFelsif ($do_push) { }
0TFelsif ($arg =~ /^ST\(\d+\)$/) { }
18740TFunless defined $type_kind{$subtype}
18760TFunless defined $output_expr{$type_kind{$subtype}}
18850TFif $@
18860TFif $do_setmagic
188950TFif ($expr =~ /^\t\$arg = new/) { }
50TFelsif ($expr =~ /^\s*\$arg\s*=/) { }
18930TFif $@
18950TFif $do_setmagic
19010TFif $@
19030TFif $do_setmagic
191250TFif $@
19200TFif $@
19210TFif $do_setmagic
19250TFif $@
19260TFif $do_setmagic
193550TFunless $hiertype
1937100TFif ($varname)
193850TFif ($varname and $type =~ / \( \s* \* (?= \s* \) ) /gx) { }