Branch Coverage

blib/lib/C/Scan.pm
Criterion Covered Total %
branch 82 184 44.5


line true false branch
154 0 2 unless my $stream = 'C::Preprocessed'->new(@_)
158 426 110 unless /^\s*\#\s* # Leading hash (line\s*)? # 1: Optional line ([0-9]+)\s* # 2: Line number (.*) # 3: The rest /x
164 110 0 if $include =~ /"(.*)"/
165 0 110 if $^O eq 'os2'
166 110 0 if $include ne ''
174 0 1 unless open C, $file
177 730 0 unless $line =~ s/ ^ \s* \# \s* # Start of directive define \s+ (\w+) # 1: symbol (?: \( (.*?) \s* \) # 2: Minimal match for arguments # in parenths (without trailing # spaces) )? # optional, no grouping \s* # rest is the definition ([\s\S]*) # 3: the rest //x
193 0 0 if (defined $args) { }
199 0 1 unless close C
211 0 1 unless my $stream = 'C::Preprocessed'->new(@_)
216 0 239 unless $line =~ s/ ^ \s* \# \s* # Start of directive define \s+ (\w+) # 1: symbol (?: \( (.*?) \s* \) # 2: Minimal match for arguments # in parenths (without trailing # spaces) )? # optional, no grouping \s* # rest is the definition ([\s\S]*) # 3: the rest //x
232 10 229 if (defined $args) { }
287 0 81 if ($wh =~ /,/ or not $wh =~ /\w/) { }
292 0 0 if (matchingbrace($wh)) { }
299 0 0 if ($c =~ /[\(\{\[]/) { }
0 0 elsif ($c =~ /[\)\]\}]/) { }
304 0 0 if $d < 0
306 0 0 if ($s < 0)
319 0 0 if $pre =~ /(?=\*)/g
341 0 0 unless $p =~ /\S/
351 72 9 unless $post =~ /\S/
375 3 78 defined $name ? :
383 78 3 unless ($structname, $in) = $in =~ / ^ \s* ( (?: struct | union ) (?: \s+ \w+ )? ) \s* { \s* (.*?) \s* } \s* $ /gisx
386 3 0 unless $structname =~ /\s/
387 2 1 if exists $$structs{$structname}
391 0 6 if $1 eq '{'
393 3 3 if $b == $e
396 0 3 if ($chunk =~ /\G\s*(struct|union).*\}/gs) { }
414 6 11 if ($word eq ';' or $word eq '') { }
0 11 elsif ($word eq ',') { }
3 8 elsif ($word eq '[') { }
415 3 3 unless defined $id
416 0 3 unless defined $type
420 0 0 unless defined $id
421 0 0 unless defined $type
426 0 3 unless defined $id
427 0 3 unless defined $type
432 0 8 if (defined $post) { }
435 5 3 if defined $id
447 0 0 if /[()]/
449 0 0 unless $copy =~ s/^\s*extern\s*//
468 0 1 unless $in =~ /;/g
483 0 0 unless defined $b1
485 1 0 if ($e - $b - $b1 > 0)
488 0 1 if ($chunk =~ /,/) { }
499 1 0 if ($chunk =~ /\)\Z/)
500 1 0 if (not $chunk =~ / \( .* \( # Multiple parenths /x and $chunk =~ / \w \s* \( /x)
507 0 1 if ($isvar) { }
590 0 81 unless ($out =~ /\w/)
598 0 81 if length $in != length $out
601 0 81 if $out =~ /\w[^\w,]+\w/
603 0 81 unless $out =~ /\w/
612 83 127 $1 ? :
613 44 166 if $n < 0
622 0 0 if $in =~ m[/\*]
640 0 0 defined $3 ? :
0 0 defined $2 ? :
110 0 defined $4 ? :
0 110 defined $1 ? :
645 0 2 if $in =~ m[ /\* ]x
699 0 1 if ($w =~ /^(struct|class|enum|union)$/)
700 0 0 unless $decl =~ /\G\s+\w+/g
705 1 0 unless $decl =~ /\G[\s*]*\*/g
707 0 1 unless $decl =~ /\G\s*/g
709 0 1 if (defined $argnum) { }
710 0 0 if ($decl =~ /\G(\w+)((\s*\[[^][]*\])*)/g) { }
720 0 1 unless $decl =~ /\G(\w+)/g
725 0 1 unless $decl =~ /\G\s*/g
727 1 0 if (pos $decl != length $decl)
729 0 1 unless $decl =~ /\G\(/g
733 0 1 unless matchingbrace($argstring)
738 1 0 if ($argstring ne '')
767 1 4 if ($w =~ /^(struct|class|enum|union)$/)
768 0 1 unless $decl =~ /\G\s+\w+/g
773 1 4 unless $decl =~ /\G[\s*]*\*/g
775 0 5 unless $decl =~ /\G\s*/g
777 5 0 if (defined $argnum) { }
778 5 0 if ($decl =~ /\G(\w+)((\s*\[[^][]*\])*)/g) { }
788 0 0 unless $decl =~ /\G(\w+)/g
793 0 5 unless $decl =~ /\G\s*/g
795 0 5 if (pos $decl != length $decl)
797 0 0 unless $decl =~ /\G\(/g
801 0 0 unless matchingbrace($argstring)
806 0 0 if ($argstring ne '')
836 0 5 if @_ < 2 or @_ > 5
844 5 0 if defined $Includes and @$Includes
851 5 0 if open $sym, $cmd or die "Cannot open pipe from `${cmd}': $!"
858 0 2 if (defined $filter)
873 0 0 $on ? :
878 0 0 if /^\#/
879 0 0 if $on
885 0 5 unless close $_[0]