ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/63_eventlib_02_signals.t
Revision: 1.6
Committed: Wed Apr 4 02:18:30 2012 UTC (12 years, 2 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-7_0, rel-7_04, rel-7_01, rel-7_02, rel-7_03
Changes since 1.5: +6 -2 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.4 BEGIN {
2     unless (exists $SIG{USR1}) {
3     print <<EOF;
4     1..0 # SKIP Broken perl detected, skipping tests.
5     EOF
6     exit 0;
7     }
8     }
9    
10 root 1.2 use AnyEvent;
11 root 1.6
12     BEGIN { $ENV{PERL_ANYEVENT_LOOP_TESTS} or ((print qq{1..0 # SKIP PERL_ANYEVENT_LOOP_TESTS not true\n}), exit 0) }
13     BEGIN { eval q{use AnyEvent::Impl::EventLib;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::EventLib not loadable\n}), exit 0) }
14    
15    
16 root 1.1
17 root 1.2 $| = 1; print "1..5\n";
18 root 1.1
19     print "ok 1\n";
20    
21     my $cv = AnyEvent->condvar;
22    
23     my $error = AnyEvent->timer (after => 5, cb => sub {
24     print <<EOF;
25     Bail out! No signal caught.
26     EOF
27     exit 0;
28     });
29    
30     my $sw = AnyEvent->signal (signal => 'INT', cb => sub {
31     print "ok 3\n";
32     $cv->broadcast;
33     });
34    
35     print "ok 2\n";
36     kill 'INT', $$;
37 root 1.6 $cv->recv;
38 root 1.1 undef $error;
39    
40     print "ok 4\n";
41    
42     undef $sw;
43    
44     print "ok 5\n";
45