ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/63_eventlib_02_signals.t
Revision: 1.7
Committed: Tue Jul 30 23:14:32 2013 UTC (11 years, 4 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-7_05, rel-7_07, rel-7_08, rel-7_09, rel-7_16, rel-7_15, rel-7_14, rel-7_13, rel-7_12, rel-7_11, HEAD
Changes since 1.6: +1 -0 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
12 BEGIN { $^W = 0 }
13 BEGIN { $ENV{PERL_ANYEVENT_LOOP_TESTS} or ((print qq{1..0 # SKIP PERL_ANYEVENT_LOOP_TESTS not true\n}), exit 0) }
14 BEGIN { eval q{use AnyEvent::Impl::EventLib;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::EventLib not loadable\n}), exit 0) }
15
16
17
18 $| = 1; print "1..5\n";
19
20 print "ok 1\n";
21
22 my $cv = AnyEvent->condvar;
23
24 my $error = AnyEvent->timer (after => 5, cb => sub {
25 print <<EOF;
26 Bail out! No signal caught.
27 EOF
28 exit 0;
29 });
30
31 my $sw = AnyEvent->signal (signal => 'INT', cb => sub {
32 print "ok 3\n";
33 $cv->broadcast;
34 });
35
36 print "ok 2\n";
37 kill 'INT', $$;
38 $cv->recv;
39 undef $error;
40
41 print "ok 4\n";
42
43 undef $sw;
44
45 print "ok 5\n";
46