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.2 by root, Mon Dec 11 01:16:09 2006 UTC vs.
Revision 1.7 by root, Sun Jul 26 12:40:42 2009 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;
11use AnyEvent::Impl::Perl;
12
13$| = 1; print "1..5\n";
5 14
6print "ok 1\n"; 15print "ok 1\n";
7 16
8my $cv = AnyEvent->condvar; 17my $cv = AnyEvent->condvar;
9 18
19my $error = AnyEvent->timer (after => 5, cb => sub {
20 print <<EOF;
21Bail out! No signal caught.
22EOF
23 exit 0;
24});
25
10my $sw = AnyEvent->signal (signal => 'CHLD', cb => sub { 26my $sw = AnyEvent->signal (signal => 'INT', cb => sub {
11 print "ok 3\n"; 27 print "ok 3\n";
12 $cv->broadcast; 28 $cv->broadcast;
13}); 29});
14 30
15print "ok 2\n"; 31print "ok 2\n";
16kill 'CHLD', 0; 32kill 'INT', $$;
17$cv->wait; 33$cv->wait;
34undef $error;
18 35
19print "ok 4\n"; 36print "ok 4\n";
20 37
21undef $sw; 38undef $sw;
22 39
23print "ok 5\n"; 40print "ok 5\n";
24 41
25kill 'CHLD', 0;
26
27print "ok 6\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines