blib/lib/POE/Component/TSTP.pm

filter: Statementstmt 45.8% 11 / 24 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 50.0% 3 / 6 Podpod 0.0% 0 / 3 totaltotal 35.0% 14 / 40 CC 4 SCAR 17.7
CC
4
Cov
37%
sigtstp
12.0
new
6.0
create
2.0
CRAP 5.9
↑ Summary
1 # $Id: TSTP.pm,v 1.3 2002/12/17 18:10:21 matt Exp $
2  
3 package POE::Component::TSTP;
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use POE;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 $VERSION = '0.02';
9  
10 0 ▶sub create {
Subroutine create: not called CC=1 SCAR=6.9
Pod undocumented
11 0 my $class = shift;
12 0 my %args = @_;
13
14 POE::Session->create(
15 inline_states => {
16 _start => \&new,
17 sigtstp => \&sigtstp,
18 },
19 0 args => [ $args{Alias}, $args{PreSuspend}, $args{PostSuspend} ],
20 );
21 }
22  
23 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
24 0 my ($kernel, $heap, $alias, $pre, $post) =
25 @_[KERNEL, HEAP, ARG0, ARG1, ARG2];
26
27 0 $kernel->sig(TSTP => 'sigtstp');
28 0 ▶ $kernel->alias_set($alias || 'tstp_handler');
Condition0%0/2
$alias || 'tstp_handler'
l!l
00
MC/DC0%0/1
$alias || 'tstp_handler'
$alias
Truth table0%0/2
A
A= $alias
Aresult
11
00
29 0 $heap->{PreSuspend} = $pre;
30 0 $heap->{PostSuspend} = $post;
31 }
32  
33 0 ▶sub sigtstp {
Subroutine sigtstp: not called CC=3 SCAR=24.8
Pod undocumented
34 0 ▶ $_[HEAP]->{PreSuspend}->(@_) if $_[HEAP]->{PreSuspend};
Branch: 1 branch
BranchTrueFalseTotal
if $_[3]{"PreSuspend"} 0 0 0
35 0 local $SIG{TSTP} = 'DEFAULT';
36 0 kill(TSTP => $$);
37 0 $_[KERNEL]->sig_handled();
38 0 ▶ $_[HEAP]->{PostSuspend}->(@_) if $_[HEAP]->{PostSuspend};
Branch: 1 branch
BranchTrueFalseTotal
if $_[3]{"PostSuspend"} 0 0 0
39 }
40  
41 1 1;
42 __END__
↑ Summary