Condition Coverage

blib/lib/Sys/Export/Unix.pm
Criterion Covered Total %
condition 125 324 38.5


and 3 conditions

line !l l&&!r l&&r condition
26 9 0 0 @_ == 1 && &isa_hash($_[0])
68 17 0 1 defined $attrs{$_} and not &isa_userdb($attrs{$_})
108 0 0 9 builtin::blessed($_[1]) and $_[1]->can("infof")
123 32 0 40 length $_ and -d $self->src_abs . $_
126 32 25 15 length $_ && !$seen{$_}++
244 2 0 0 exists $rw->{$orig} and $rw->{$orig} ne $new
264 73 1 199 length $_ && $_ ne '.'
279 16 0 44 length $_ && $_ ne '.'
296 6 4 59 length $_ && $_ ne '.'
360 1 0 0 defined $self->_dst->can("dst_abs") and -f $self->_dst->dst_abs . 'etc/passwd'
397 21 0 22 defined $file{'name'} and defined $file{'mode'}
401 20 0 1 exists $self->{'src_path_set'}{$src_path} and not defined $file{'name'}
438 34 6 0 not defined $file{'data'} || defined $file{'data_path'} and defined $file{'real_src_path'}
40 0 0 not defined $file{'data'} || defined $file{'data_path'} and defined $file{'real_src_path'} and -e $self->{'src_abs'} . $file{'real_src_path'}
441 39 0 1 defined $file{'user'} and not defined $file{'uid'}
449 39 0 1 defined $file{'group'} and not defined $file{'gid'}
484 11 20 9 length $dst_parent and not exists $self->{'dst_path_set'}{$dst_parent}
487 1 8 0 $self->_dst->can("dst_abs") and -d $self->_dst->dst_abs . $dst_parent
507 3 0 1 @dir{"dev", "ino", "mode", "nlink", "uid", "gid", "rdev", "size", "atime", "mtime", "ctime"} = lstat $self->{'src_abs'} . $dst_parent and S_ISDIR($dir{'mode'})
562 3 24 28 length $_[0] and !defined($filter) || &$filter(\%file)
563 42 0 13 $is_dir and not delete $file{'prune'}
581 13 13 50 $ent ne "." and $ent ne ".."
638 0 0 0 $dst_userdb and not defined $dst_uid
652 0 0 0 $dst_userdb and not defined $dst_gid
674 13 0 1 $file->{'nlink'} > 1 and $file->{'dev'}
0 0 1 $file->{'nlink'} > 1 and $file->{'dev'} and $file->{'ino'}
752 0 0 0 $self->_has_rewrites and length $file->{'src_path'}
0 0 0 $self->_has_rewrites and length $file->{'src_path'} and defined $interpreter
813 0 0 0 $self->_has_rewrites and ${$file->{'data'};} =~ $self->path_rewrite_regex
848 0 0 0 $self->_can_trace_deps and length $file->{'src_path'}
872 0 0 0 $self->_has_rewrites and ${$file->{'data'};} =~ $self->path_rewrite_regex
893 3 2 0 not $target =~ m[^/]u and substr($file->{'data_path'}, 0, length $self->{'src_abs'}) ne $self->{'src_abs'}
903 0 1 4 defined $abs_target and lstat $self->{'src_abs'} . $abs_target
912 4 0 1 $self->_has_rewrites and length $file->{'src_path'}
943 0 1 0 @target_parts and $target_parts[0] eq ".."
947 1 0 1 @target_parts and $target_parts[0] ne ".."
955 1 0 3 @dst_parts and @dst_target
1 0 3 @dst_parts and @dst_target and $dst_parts[0] eq $dst_target[0]
970 1 0 0 defined $file->{'rdev_major'} && defined $file->{'rdev_minor'}
0 0 1 defined $file->{'rdev'} and not defined $file->{'rdev_major'} && defined $file->{'rdev_minor'}

or 2 conditions

line l !l condition
100 0 0 $self->{'src_path_set'} //= {}
101 3 0 $self->{'dst_path_set'} //= {}
102 1 0 $self->{'dst_uid_used'} //= {}
103 1 0 $self->{'dst_gid_used'} //= {}
128 20 0 $self->{'src_exe_PATH_list'} // []
155 0 0 chdir $src_abs // die("chdir($src_abs): $!")
156 0 0 chroot $src_abs // die("chroot($src_abs): $!")
158 0 0 exec($cmd, @args) // die("exec: $!")
180 1 2 $self->{'path_rewrite_map'} // {}
188 1 1 $self->{'link_map'} //= {}
192 0 0 $self->{'elf_interpreters'} //= {}
225 0 0 $self->{'_log_name_widths'} //= []
238 1 1 $self->{'path_rewrite_map'} //= {}
297 9 0 $path[0] // ""
363 0 1 $self->{'_user_rewrite_map'} //= {}
364 0 1 $self->{'_group_rewrite_map'} //= {}
428 0 0 $file{'uid'} // 0
0 0 $file{'gid'} // 0
439 28 12 $file{'nlink'} //= 1
462 0 0 $self->on_collision // "ignore_if_same"
466 0 0 $file{'src_path'} // ""
576 5 0 $path //= ""
608 1 21 $self->{'src_path_set'}{$path =~ s[^/][]ru} //= undef
699 6 8 $file->{'src_path'} // "(data)"
717 0 0 $rpath // ""
854 0 0 $file->{'src_path'} // ""
879 5 5 $dir->{'src_path'} // "(default)"

or 3 conditions

line l !l&&r !l&&!r condition
61 0 6 0 $attrs{'tmp'} //= $attrs{'_dst'}->tmp
63 6 3 0 $attrs{'tmp'} //= "File::Temp"->newdir
64 0 9 0 $attrs{'log'} //= "Sys::Export::LogAny"->get_logger
74 0 9 0 $attrs{'src_exe_PATH'} //= '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' . ($abs_src eq "/" ? ":$ENV{'PATH'}" : "")
141 1 0 0 $self->src_abs eq '/' || eval { do { $self->_run_in_src('sh', '-c', 'exit 0'); 1 } }
0 1 0 $self->{'can_run_in_src'} //= $self->src_abs eq '/' || eval { do { $self->_run_in_src('sh', '-c', 'exit 0'); 1 } }
145 0 0 0 $cmd =~ m[/]u or -x $src_abs . $cmd
146 0 0 0 $self->src_which($cmd) // croak("Can't locate '${cmd}' under $src_abs in PATH=" . $self->src_exe_PATH)
150 0 0 0 pipe(my $err_r, my $err_w) // croak("pipe: $!")
151 0 0 0 fork // croak("fork: $!")
179 21 3 0 $self->{'path_rewrite_regex'} //= do { my $rw = $self->{'path_rewrite_map'} // {}; !keys(%$rw) ? qr/(*FAIL)/u : qr/(@{[join("|", map(quotemeta($_), reverse sort(keys %$rw)))];})/u }
196 0 0 1 $self->{'_can_trace_deps'} //= do { $self->log->debug("Error building _trace_deps function: $@") unless eval { do { $self->{'_trace_deps'} //= $self->_build__trace_deps } }; not !$self->{'_trace_deps'} }
197 0 0 1 $self->{'_trace_deps'} //= $self->_build__trace_deps
204 0 0 0 $self->{'_trace_deps'} //= $self->_build__trace_deps
241 0 0 2 $orig =~ m[^[.]+/]u or $new =~ m[^[.]+/]u
308 0 0 0 $self->{'dst_userdb'} //= $self->_build_dst_userdb
315 0 0 0 $self->{'src_userdb'} //= $self->_build_src_userdb
329 0 0 0 $self->{'dst_userdb'} //= $self->_build_dst_userdb
336 0 0 0 $self->{'src_userdb'} //= $self->_build_src_userdb
358 1 0 0 $self->{'src_userdb'} //= $self->_build_src_userdb
395 6 21 0 $file{'real_src_path'} //= $self->_src_parent_abs_path($file{'src_path'})
425 18 0 0 defined $file{'uid'} or defined $file{'gid'}
428 0 0 18 $self->{'_user_rewrite_map'} or $self->{'_group_rewrite_map'}
431 0 18 0 $file{'data_path'} //= $self->{'src_abs'} . $real_src_path
432 0 18 0 $file{'name'} //= $self->get_dst_for_src($real_src_path)
438 10 24 6 defined $file{'data'} || defined $file{'data_path'}
442 0 1 0 $self->{'dst_userdb'} //= $self->_build_dst_userdb
0 1 0 $dst_userdb //= ($self->{'dst_userdb'} //= $self->_build_dst_userdb)
444 1 0 0 $dst_userdb->user($file{'user'}) // croak("Unknown user '$file{'user'}' for file '$file{'name'}'")
450 0 0 0 $self->{'dst_userdb'} //= $self->_build_dst_userdb
1 0 0 $dst_userdb //= ($self->{'dst_userdb'} //= $self->_build_dst_userdb)
452 1 0 0 $dst_userdb->group($file{'group'}) // croak("Unknown group '$file{'group'}' for file '$file{'name'}'")
497 3 1 2 not length $src_parent or $self->get_dst_for_src($src_parent) ne $dst_parent
498 3 0 0 $src_parent //= $dst_parent
525 31 0 0 $file{'mode'} // croak("attribute 'mode' is required, for $file{'name'}")
526 0 1 1 S_ISBLK($mode) or S_ISCHR($mode)
534 0 0 0 $file{'src_path'} // $file{'data_path'}
0 0 0 ($file{'src_path'} // $file{'data_path'}) // $file{'name'}
562 5 28 19 !defined($filter) || &$filter(\%file)
606 22 0 0 $path->{'src_path'} // $path->{'name'}
0 0 0 ($path->{'src_path'} // $path->{'name'}) // croak("Hashrefs passed to ->skip must include 'src_path' or 'name'")
635 0 0 0 $dst_userdb or $self->{'_user_rewrite_map'}
0 0 0 $dst_userdb or $self->{'_user_rewrite_map'} or $self->{'_group_rewrite_map'}
639 0 0 0 $self->{'src_userdb'} //= $self->_build_src_userdb
653 0 0 0 $self->{'src_userdb'} //= $self->_build_src_userdb
738 0 0 0 $self->_resolve_src_library($_, $elf->{'rpath'}) // carp("Can't find lib $_ needed for $file->{'src_path'}")
844 0 0 0 $file->{'interpreter'} // $self->src_which("perl")
972 0 1 0 $file->{'rdev_major'} //= $major
973 0 1 0 $file->{'rdev_minor'} //= $minor
999 0 0 0 $!{'EAGAIN'} or $!{'EINTR'}