ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/64_glib_02_signals.t
Revision: 1.8
Committed: Tue Jul 30 23:14:33 2013 UTC (10 years, 10 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.7: +1 -0 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.7
12 root 1.8 BEGIN { $^W = 0 }
13 root 1.7 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::Glib;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::Glib not loadable\n}), exit 0) }
15    
16    
17 root 1.1
18 root 1.2 $| = 1; print "1..5\n";
19 root 1.1
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 root 1.6 $cv->recv;
39 root 1.1 undef $error;
40    
41     print "ok 4\n";
42    
43     undef $sw;
44    
45     print "ok 5\n";
46