blib/lib/POE/Test/Loops/sbk_signal_init.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 42 CC 2 SCAR 11.0
CC
2
Cov
0%
BEGIN
6.0
BEGIN
2.0
dispatch_normal_signal
2.0
CRAP 3.0
1 #!/usr/bin/perl
2 # vim: ts=2 sw=2 expandtab
3  
4 # Tests whether POE::Kernel affects signal handlers at initialization
5 # time. Based on test code provided by Stuart Kendrick, in
6 # rt.cpan.org ticket 19529.
7  
8 use warnings;
9 use strict;
10  
11 # perl-5.6.x on Win32 does not support alarm()
12 BEGIN {
13 if ( $^O eq 'MSWin32' and $] < 5.008 ) {
14 print "1..0 # Skip perl-5.6.x on $^O does not support alarm()";
15 exit();
16 }
17 }
18  
19 use Test::More tests => 1;
20  
21 BEGIN {
22 $SIG{ALRM} = \&dispatch_normal_signal;
23 }
24  
25 my $signal_dispatched = 0;
26  
27 sub dispatch_normal_signal { $signal_dispatched = 1 }
28  
29 use POE;
30  
31 alarm(1);
32  
33 if ($^O eq "MSWin32") {
34 # Cant' select. Windows will get me!
35 # Windows has trouble with select() and undefined input vectors.
36 sleep(5);
37 }
38 else {
39 # Can't sleep. HP-UX will get me!
40 # HP-UX implements sleep() with alarm(), so they don't mix.
41 select(undef, undef, undef, 5);
42 }
43  
44 ok($signal_dispatched, "normal SIGALRM dispatched");
45  
46 1;