File Coverage

blib/lib/Child/Link/Parent.pm
Criterion Covered Total %
statement 15 15 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 22 23 95.6


line stmt bran cond sub pod time code
1             package Child::Link::Parent;
2 20     20   66 use strict;
  20         28  
  20         477  
3 20     20   63 use warnings;
  20         15  
  20         387  
4              
5 20     20   54 use Child::Util;
  20         28  
  20         838  
6              
7 20     20   62 use base 'Child::Link';
  20         23  
  20         2489  
8              
9             add_accessors qw/detached/;
10              
11             sub detach {
12 1     1 1 22 my $self = shift;
13 1         28 require POSIX;
14 1 50       42 $self->_detached( POSIX::setsid() )
15             || die "Cannot detach from parent $!";
16             }
17              
18             1;
19              
20             =head1 NAME
21              
22             Child::Link::Proc - Proc object used by L.
23              
24             =head1 SEE ALSO
25              
26             This class inherits from:
27              
28             =over 4
29              
30             =item L
31              
32             =back
33              
34             =head1 METHODS
35              
36             =over 4
37              
38             =item $proc->pid()
39              
40             Returns the parent process PID.
41              
42             =item $proc->detach()
43              
44             Detach the from the parent. uses POSIX::setsid(). Not available in windows.
45              
46             =back
47              
48             =head1 HISTORY
49              
50             Most of this was part of L intended for use in the L
51             project. Fennec is being broken into multiple parts, this is one such part.
52              
53             =head1 FENNEC PROJECT
54              
55             This module is part of the Fennec project. See L for more details.
56             Fennec is a project to develop an extendable and powerful testing framework.
57             Together the tools that make up the Fennec framework provide a potent testing
58             environment.
59              
60             The tools provided by Fennec are also useful on their own. Sometimes a tool
61             created for Fennec is useful outside the greater framework. Such tools are
62             turned into their own projects. This is one such project.
63              
64             =over 2
65              
66             =item L - The core framework
67              
68             The primary Fennec project that ties them all together.
69              
70             =back
71              
72             =head1 AUTHORS
73              
74             Chad Granum L
75              
76             =head1 COPYRIGHT
77              
78             Copyright (C) 2010 Chad Granum
79              
80             Child is free software; Standard perl licence.
81              
82             Child is distributed in the hope that it will be useful, but WITHOUT
83             ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
84             FOR A PARTICULAR PURPOSE. See the license for more details.