ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/67_tk_02_signals.t
Revision: 1.6
Committed: Tue Aug 2 20:02:47 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

# 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.5 BEGIN { eval q{use AnyEvent::Impl::Tk;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::Tk not loadable
12     }), exit 0) }
13 root 1.1
14 root 1.2 $| = 1; print "1..5\n";
15 root 1.1
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 root 1.6 $cv->recv;
35 root 1.1 undef $error;
36    
37     print "ok 4\n";
38    
39     undef $sw;
40    
41     print "ok 5\n";
42