ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/02_signals.t
(Generate patch)

Comparing AnyEvent/t/02_signals.t (file contents):
Revision 1.3 by root, Fri Nov 16 05:08:18 2007 UTC vs.
Revision 1.9 by root, Tue Aug 2 20:02:45 2011 UTC

1$|=1; 1BEGIN {
2BEGIN { print "1..6\n" } 2 unless (exists $SIG{USR1}) {
3 print <<EOF;
41..0 # SKIP Broken perl detected, skipping tests.
5EOF
6 exit 0;
7 }
8}
3 9
4use AnyEvent; 10use AnyEvent;
5use AnyEvent::Impl::Perl; 11BEGIN { require AnyEvent::Impl::Perl unless $ENV{PERL_ANYEVENT_MODEL} }
12
13$| = 1; print "1..5\n";
6 14
7print "ok 1\n"; 15print "ok 1\n";
8 16
9my $cv = AnyEvent->condvar; 17my $cv = AnyEvent->condvar;
10 18
19my $error = AnyEvent->timer (after => 5, cb => sub {
20 print <<EOF;
21Bail out! No signal caught.
22EOF
23 exit 0;
24});
25
11my $sw = AnyEvent->signal (signal => 'CHLD', cb => sub { 26my $sw = AnyEvent->signal (signal => 'INT', cb => sub {
12 print "ok 3\n"; 27 print "ok 3\n";
13 $cv->broadcast; 28 $cv->broadcast;
14}); 29});
15 30
16print "ok 2\n"; 31print "ok 2\n";
17kill 'CHLD', 0; 32kill 'INT', $$;
18$cv->wait; 33$cv->recv;
34undef $error;
19 35
20print "ok 4\n"; 36print "ok 4\n";
21 37
22undef $sw; 38undef $sw;
23 39
24print "ok 5\n"; 40print "ok 5\n";
25 41
26kill 'CHLD', 0;
27
28print "ok 6\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines