Branch Coverage

blib/lib/IPC/DirQueue.pm
Criterion Covered Total %
branch 122 236 51.6


line true false branch
145 0 20 unless $$self{'dir'}
151 2 18 if ($$self{'queue_fanout'}) { }
10 8 elsif (not defined $$self{'ordered'}) { }
165 0 20 if ($$self{'indexd_uri'})
219 0 0 unless (open IN, "<$file")
261 1010 1010 if $enqd_already++
297 1120 0 unless (defined $pri)
298 0 1120 if ($pri < 0 or $pri > 99)
323 0 1120 unless (sysopen OUT, $pathtmpdata, 193, $$self{'data_file_mode'})
336 0 1120 if ($@)
339 0 1120 unless (defined $siz)
362 15 1105 unless (-d $pathdatadir)
365 35 10 unless -d $dir
373 0 1120 unless ($pathdata)
381 0 1120 unless ($self->create_control_file($job, $pathtmpdata, $pathtmpctrl))
394 0 1120 unless ($pathqueue)
406 0 1120 unless $self->touch($pathqueuedir)
409 0 1120 if ($$self{'indexclient'})
417 0 0 if ($pathtmpctrl_created)
418 0 0 unless unlink $pathtmpctrl
420 0 0 if ($pathtmpdata_created)
421 0 0 unless unlink $pathtmpdata
423 0 0 if ($pathdata_created)
424 0 0 unless unlink $pathdata
463 3 1454 unless (defined $nextfile)
470 395 1059 unless $nextfilebase =~ /^\d/
474 659 400 if exists $args{'path'} and $pathqueue ne $args{'path'}
479 0 400 if (defined $mtime)
483 0 0 if (time - $mtime < $$self{'active_file_lifetime'})
488 0 0 if ($self->worker_still_working($pathactive))
511 0 0 if (time - $mtime < $$self{'active_file_lifetime'} + $fudge)
518 0 0 unless unlink $pathactive
531 0 400 unless (sysopen LOCK, $pathtmpactive, 193, $$self{'queue_file_mode'})
534 0 0 if ($!{'EEXIST'}) { }
547 0 400 unless (-f $pathqueue)
563 0 400 unless (defined $pathnewactive)
569 0 400 if ($pathactive ne $pathnewactive)
573 0 400 unless (open IN, '<' . $pathqueue)
592 0 400 unless $red
597 0 0 unless unlink $pathtmpactive
636 0 310 if ($timeout and $timeout > 0)
642 0 310 if ($pollintvl) { }
663 310 0 if ($job)
690 0 0 if ($job)
699 0 0 if ($finishtime and $now >= $finishtime)
708 0 0 if defined $stat[9] and defined $qdirlaststat && $stat[9] != $qdirlaststat || !defined($qdirlaststat)
753 4 118 unless (defined $nextfile)
760 28 90 unless $nextfilebase =~ /^\d/
764 0 90 unless -f $pathqueue
768 0 90 if (open IN, "<$pathactive")
783 0 90 unless (open IN, '<' . $pathqueue)
791 0 90 unless ($red)
811 0 400 if ($$job{'is_readonly'})
815 400 0 if ($isdone)
816 0 400 unless unlink $$job{'pathqueue'}
818 0 400 unless unlink $$job{'QDFN'}
821 0 400 if ($$self{'indexclient'})
831 0 400 unless unlink $$job{'pathactive'}
840 1 342 unless (opendir DIR, $dir)
859 1110 10 if ($callbackin) { }
863 1110 1310 unless (defined $stringin)
868 0 1310 if $len == 0
870 0 1310 unless (print $fhout $stringin)
881 0 10 unless (print $fhout $buf)
891 0 1120 unless (close $fhout)
910 2240 0 if (link $pathtmp, $path)
917 0 0 if ($nlink == 2)
922 0 0 if ($retry == $maxretries)
937 0 2240 unless (unlink $pathtmp)
953 0 400 unless (defined $nlink1)
960 0 400 if (-f $path)
966 0 400 unless (link $pathtmp, $path)
976 0 400 unless (defined $nlink3)
982 0 400 if ($dev1 != $dev3 or $ino1 != $ino3 or $uid1 != $uid3)
986 0 0 unless ($linkfailed)
995 0 400 unless (unlink $pathtmp)
1008 0 1120 unless (sysopen OUT, $pathtmpctrl, 193, $$self{'queue_file_mode'})
1024 0 1120 if ($k =~ /^Q...$/ or $k =~ /[:\0\n]/s or $v =~ /[\0\n]/s)
1034 0 1120 unless (close OUT)
1049 2450 490 if ($k =~ /^Q[A-Z]{3}$/) { }
1058 0 490 unless ($$job{'QDFN'} and -f $$job{'QDFN'})
1072 0 0 unless ($fname)
1075 0 0 unless (open IN, '<' . $fname)
1081 0 0 if ($hname eq $self->gethostname)
1082 0 0 unless (kill 0, $wpid)
1123 0 1120 if ($addextra)
1154 0 130 if (sysopen IN, '
1168 3024 16 if $hname
1184 5050 105 if exists $$self{'ensured_dir_exists'}{$dir}
1186 53 52 unless -d $dir
1194 0 2 unless (opendir RETRY, $pathqueuedir)
1205 12135 0 unless $DEBUG
1214 0 407 if ($$self{'indexclient'}) { }
343 64 elsif ($$self{'ordered'}) { }
32 32 elsif ($$self{'queue_fanout'}) { }
1218 0 0 if (scalar @files <= 0)
1219 0 0 if $self->queuedir_is_bad($pathqueuedir)
1227 2 341 if (scalar @$files <= 0)
1228 0 2 if $self->queuedir_is_bad($pathqueuedir)
1239 0 32 unless (opendir $dirfh, $pathqueuedir)
1240 0 0 if $self->queuedir_is_bad($pathqueuedir)
1241 0 0 unless (opendir $dirfh, $pathqueuedir)
1256 0 1579 if ($$self{'indexclient'}) { }
546 1033 elsif ($$self{'ordered'}) { }
687 346 elsif ($$self{'queue_fanout'}) { }
1275 0 407 unless $iter
1276 30 377 if (defined $$iter{'fanfh'})
1277 32 375 if (defined $$iter{'fh'})
1285 990 130 unless ($$self{'queue_fanout'})
1300 990 130 unless ($$self{'queue_fanout'})
1305 0 130 unless $self->touch($pathqueuedir . '/' . $fanout)
1312 990 130 if (not $$self{'queue_fanout'}) { }
1323 685 887 if ($$self{'queue_fanout'})
1336 0 32 if (not opendir(DIR, $pathqueuedir)) { }
1364 229 655 unless (defined $$iter{'fanfh'})
1366 2 227 unless (defined $nextfanout)
1373 0 227 unless (opendir $dirfh, $$iter{'pathqueuedir'} . '/' . $nextfanout)
1383 685 197 if (defined $fname)