example/signal.pl

filter: Statementstmt 89.4% 17 / 19 Branchbran 66.6% 4 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 85.1% 23 / 27 CC 1 SCAR 0.0
CC
1
Cov
84%
BEGIN
1.0
hup_handler
1.0
CRAP 1.0
« example/test-require.pl ↑ Summary bin/trepan.pl »
1 2 ▶use English qw( -no_match_vars );
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 my $leave_loop = 0;
3 sub hup_handler($)
4 2 ▶{
Subroutine hup_handler: called CC=1 SCAR=0.0
5 2 my $sig = shift;
6 2 print "Got signal $sig in debugged program handler\n";
7 2 $leave_loop = 1;
8 }
9 2 $SIG{'HUP'} = \&hup_handler;
10 2 my $tempfile;
11 2 ▶if (1 == scalar @ARGV) {
Branch: 1 branch
BranchTrueFalseTotal
if (1 == scalar @ARGV) { } 2 0 2
12 2 $tempfile = $ARGV[0]
13 } else {
14 0 $tempfile = "/tmp/signal.$$";
15 0 print "My process is $$\n";
16 }
17 2 ▶open(my $fh, '>', $tempfile) or die $OS_ERROR;
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, ">", $tempfile or die $OS_ERROR 2 0 2
18 2 print $fh "$$\n";
19 2 close $fh;
20 2 ▶until ($leave_loop) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($leave_loop) 2 2 4
21 2 sleep 1;
22 }
23 2 unlink $tempfile;
« example/test-require.pl ↑ Summary bin/trepan.pl »