Branch Coverage

checks/binaries.pm
Criterion Covered Total %
branch 203 248 81.8


line true false branch
56 10640 6160 if (not $regex) { }
63 840 5320 if ($opt eq 'source' or $opt eq 'libname') { }
5320 0 elsif ($opt eq 'source-regex') { }
74 0 16800 if (defined $result->{'source'} and $result->{'source-regex'}) { }
78 15960 840 unless defined $result->{'source'}
126 1167 4424 if $arch ne 'all'
130 5522 69 if (defined $src)
146 1314 147 if ($file_info =~ /^[^,]*\bELF\b/o)
148 280 1034 unless defined $ARCH_32_REGEX
150 1309 5 unless $file_info =~ /$ARCH_32_REGEX/o
152 80 1234 if $file =~ m[^usr/lib/debug/]
155 383 1078 if (defined $objdump->{'SONAME'})
164 10135 586 if ($foo eq 'UND')
167 669 9466 if $name =~ s/^__(\S+)_chk$/$1/
168 664 9471 if ($HARDENED_FUNCTIONS->known($name))
169 637 27 if ($hardened) { }
178 0 10721 unless (defined $has_lfs)
179 0 0 if ($foo eq 'UND' and $LFS_SYMBOLS->known($sym))
186 25 10696 if $is_profiled
190 5 10691 if ($sec =~ /^GLIBC_.*/ and $sym =~ /\A _?+ _?+ mcount \Z/msx) { }
10691 0 elsif ($arch ne 'hppa') { }
195 0 586 if ($foo eq '.text' and $sec eq 'Base' and $sym eq '__gmon_start__')
201 5 10691 if $is_profiled
204 9 0 if (%unharded_functions and not @hardened_functions and not $built_with_golang and $arch_hardening->{'hardening-no-fortify-functions'})
212 5 1456 if $objdump->{'ERRORS'}
213 0 1461 if defined $has_lfs and not $has_lfs
215 70 1391 if ($objdump->{'BAD-DYNAMIC-TABLE'})
216 20 50 unless $file =~ m[^usr/lib/debug/]
227 4433 1158 unless (defined $madir)
245 0 360 if $path =~ m[^(?:usr/)?lib(?:32|64)?/libnss_[^.]+\.so(?:\.[0-9]+)$]
247 11 349 if $path =~ m[^lib/[^/]+$]
248 292 57 if $path =~ m[^usr/lib/[^/]+$]
249 11 46 if defined $dir and $path =~ m[lib/$dir/[^/]++$]
250 0 46 if defined $dir and $path =~ m[usr/lib/$dir/[^/]++$]
273 238 76 if (lc $expected_name eq $pkg or lc $expected_name eq $base_pkg)
280 34 5557 if @sonames and not $match_found
287 31592 21470 unless $file->is_file
293 20105 1365 unless $fileinfo =~ /^[^,]*\bELF\b/ or $fileinfo =~ /\bcurrent ar archive\b/
297 5 1360 if ($arch eq 'all')
302 5 1360 if ($fname =~ m[^etc/])
306 10 1355 if ($fname =~ m[^usr/share/])
310 11 1354 if ($multiarch eq 'same')
311 5 6 unless ($fname =~ m[\b$gnu_triplet_re(?:\b|_)|/(?:$ruby_triplet_re|java-\d+-openjdk-\Q$arch\E|\.build-id)/])
317 51 1314 if ($fileinfo =~ /\bcurrent ar archive\b/)
321 0 51 if $file =~ /_g\.a$/
328 0 96 unless defined $libobj
331 10 86 if (&any(sub { exists $libobj->{'SH'}{$_}; } , ('.debug_info', '.zdebug_info'))) { }
342 51 1314 unless $fileinfo =~ /^[^,]*\bELF\b/o
346 5 1309 if ($arch eq 'all' or not $ARCH_REGEX->known($arch)) { }
352 1304 5 if ($fileinfo =~ /$archre/) { }
0 5 elsif ($fname =~ m[(?:^|/)lib(x?\d{2})/] or $fname =~ m[^emul/ia(\d{2})]) { }
0 5 elsif ($fname =~ m[^usr/lib/debug/\.build-id/]) { }
0 5 elsif ($ARCH_64BIT_EQUIVS->known($arch) and $fname =~ m[^lib/modules/]) { }
5 0 elsif ($arch eq 'amd64') { }
359 0 0 if $bitre and $fileinfo =~ /$bitre/
368 0 0 if $fileinfo =~ /$arch64re/
372 0 5 if $fileinfo =~ /$arch32re/
374 5 1304 if $bad
393 151 1163 if ($fileinfo =~ /\bnot stripped\b/o) { }
397 66 20 unless ($fname =~ /\.k?o$/ or $pkg =~ /-dbg$/ or $pkg =~ /debug/ or $fname =~ m[/lib/debug/] or $fname =~ /\.gox$/o)
402 5 61 if ($fileinfo =~ /executable/ and $strings =~ /^Caml1999X0[0-9][0-9]$/m) { }
412 5 1158 if ($fname =~ m[/lib/debug/]o or $fname =~ m[/lib/profile/]o) { }
422 20 1294 if (exists $objdump->{'RPATH'} or exists $objdump->{'RUNPATH'})
423 5 15 unless (%directories)
426 75 75 unless $file->is_dir or $file->is_symlink
437 10 15 if $rpath =~ m[^/usr/lib/(?:$madir/)?(?:games/)?(?:\Q$pkg\E|\Q$srcpkg\E)(?:/|\z)]
439 0 15 if $rpath =~ /^\$\{?ORIGIN\}?/
441 5 10 if $directories{$rpath} and not $rpath =~ m[^(?:/usr)?/lib(?:/$madir)?/?\z]
449 24966 53874 if ($ldata->{'source-regex'}) { }
450 0 24966 if $proc->pkg_src =~ /^$ldata->{'source-regex'}$/
452 0 53874 if $proc->pkg_src eq $ldata->{'source'}
454 663 78177 if ($strings =~ /$ldata->{'match'}/)
461 0 1314 unless $fileinfo =~ /executable/ or $fileinfo =~ /shared object/
463 0 1314 if $type eq 'udeb'
466 29 1285 if ($fname =~ m[^usr/lib/(?:[^/]+/)?perl5/.*\.so$])
471 5 1309 if ($fname =~ m[^usr/lib/php\d/.*\.so(?:\.\d+)*$])
476 12 1302 if ($fname =~ m[usr/lib/(?:pyshared/)?python2\.\d+/.*(?
481 0 12 if (index($strings, 'numpy') > -1 and $strings =~ / module\ compiled\ against\ ABI\ version\ (?:0x)?%x \ but\ this\ version\ of\ numpy\ is\ (?:0x)?%x /x)
488 60 1254 if ($fname =~ m[^usr/lib/debug/(?:lib\d*|s?bin|usr|opt|dev|emul|\.build-id)/])
491 15 45 if (exists $objdump->{'NEEDED'})
498 35 0 unless exists $objdump->{'SH'}{'.debug_line'} or exists $objdump->{'SH'}{'.zdebug_line'} or exists $objdump->{'SH'}{'.debug_str'} or exists $objdump->{'SH'}{'.zdebug_str'}
502 20 1294 if ($fname =~ m[^usr/lib/debug/[^/]+$])
503 5 15 unless (exists $objdump->{'NEEDED'} or $fileinfo =~ /statically linked/)
510 125 1189 if (not exists $objdump->{'NEEDED'}) { }
511 47 78 if ($fileinfo =~ /shared object/o) { }
515 0 47 if $fname =~ m[^boot/modules/]
516 0 47 if $fname =~ m[^lib/modules/]
517 30 17 if $fname =~ m[^usr/lib/debug/]
518 0 17 if $fname =~ /\.(?:[ce]32|e64)$/
521 0 17 if $fname =~ m[ ^lib(?:|32|x32|64)/ (?:[-\w/]+/)? ld-[\d.]+\.so$ ]msx
532 7 71 if $fname =~ m[^boot/]
533 19 52 if $fname =~ /[\.-]static$/
534 0 52 if $pkg =~ /-static$/
537 5 47 if $built_with_golang
541 0 47 if exists $objdump->{'INTERP'} and $objdump->{'INTERP'} =~ m[/lib/klibc-\S+\.so]
543 20 27 if $fname =~ m[^usr/lib/debug/]
545 0 27 if $fname eq 'sbin/ldconfig'
553 1141 48 if index($fileinfo, 'shared object') != -1
554 1189 0 if exists $objdump->{'NEEDED'}
556 1175 76 if ($lib =~ /^libc\.so\.(\d+.*)/)
558 404 771 unless $needs_libc_file
562 5 1246 if ($lib =~ /\A libstdc\+\+\.so\.(\d+) \Z/msx)
564 5 0 unless $needs_libcxx_file
569 14 1175 if ($no_libc and not $fname =~ m[/libc\b])
574 7 7 if ($is_shared) { }
575 7 0 unless $needs_libcxx ne ''
582 9 1175 if ($arch_hardening->{'hardening-no-relro'} and not $built_with_golang and not $objdump->{'PH'}{'RELRO'})
588 159 1025 if ($arch_hardening->{'hardening-no-bindnow'} and not $built_with_golang and not exists $objdump->{'FLAGS_1'}{'NOW'})
594 43 1141 if ($arch_hardening->{'hardening-no-pie'} and not $built_with_golang and $objdump->{'ELF-TYPE'} eq 'EXEC')
606 411 5180 if ($needs_depends_line)
607 18 393 if ($depends->empty) { }
610 386 7 if ($needs_libc and not $pkg =~ /^libc[\d.]+(?:-|\z)/)
613 26 360 unless ($depends->matches($re))
616 15 11 if ($needs_libc_count > 0)
623 5 388 if ($needs_libcxx ne '')
626 5 0 unless ($depends->matches($re))
629 0 5 if ($needs_libcxx_count > 0)
640 29 5562 if ($has_perl_lib)
644 18 11 unless ($depends->matches($re, 3))
650 5 5586 if ($has_php_ext)
653 5 0 unless ($depends->matches(qr/^phpapi-[\d\w+]+$/, 3))
661 0 5591 if ($uses_numpy_c_abi and not $pkg =~ /\A python3?-numpy \Z/msx)
666 0 0 unless $depends->matches(qr/^python3?-numpy-abi\d+$/, $vflags) or $depends->matches(qr/^python-numpy \(>[>=][^\|]+$/, $vflags) and $depends->matches(qr/^python-numpy \(<[<=][^\|]+$/, $vflags)
678 36 2452 if (exists $objdump->{'SH'}{$sect})