ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/65_event_02_signals.t
Revision: 1.6
Committed: Tue Aug 2 20:02:46 2011 UTC (12 years, 10 months ago) by root
Content type: application/x-troff
Branch: MAIN
Changes since 1.5: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 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 use AnyEvent;
11 BEGIN { eval q{use AnyEvent::Impl::Event;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::Event not loadable
12 }), exit 0) }
13
14 $| = 1; print "1..5\n";
15
16 print "ok 1\n";
17
18 my $cv = AnyEvent->condvar;
19
20 my $error = AnyEvent->timer (after => 5, cb => sub {
21 print <<EOF;
22 Bail out! No signal caught.
23 EOF
24 exit 0;
25 });
26
27 my $sw = AnyEvent->signal (signal => 'INT', cb => sub {
28 print "ok 3\n";
29 $cv->broadcast;
30 });
31
32 print "ok 2\n";
33 kill 'INT', $$;
34 $cv->recv;
35 undef $error;
36
37 print "ok 4\n";
38
39 undef $sw;
40
41 print "ok 5\n";
42