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.4 by root, Tue Apr 22 05:12:19 2008 UTC

1$|=1; 1$|=1;
2BEGIN { print "1..6\n" } 2BEGIN {
3 print "1..5\n";
4}
3 5
4use AnyEvent; 6use AnyEvent;
5use AnyEvent::Impl::Perl; 7use AnyEvent::Impl::Perl;
8
9print STDERR <<EOF;
10
11If the following test hangs for a long time or terminates with a signal
12you either found a bug in AnyEvent or, more likely, you have a defective
13perl (most windows perl distros are broken, cygwin perl works). If you do
14not rely on signal handlers you can force the installation of this module
15and the rest will likely work. Otherwise upgrading to a working perl is
16recommended.
17EOF
6 18
7print "ok 1\n"; 19print "ok 1\n";
8 20
9my $cv = AnyEvent->condvar; 21my $cv = AnyEvent->condvar;
10 22
23my $error = AnyEvent->timer (after => 5, cb => sub {
24 print <<EOF;
25Bail out! No signal caught.
26EOF
27 exit 0;
28});
29
11my $sw = AnyEvent->signal (signal => 'CHLD', cb => sub { 30my $sw = AnyEvent->signal (signal => 'INT', cb => sub {
12 print "ok 3\n"; 31 print "ok 3\n";
13 $cv->broadcast; 32 $cv->broadcast;
14}); 33});
15 34
16print "ok 2\n"; 35print "ok 2\n";
17kill 'CHLD', 0; 36kill 'INT', $$;
18$cv->wait; 37$cv->wait;
38undef $error;
19 39
20print "ok 4\n"; 40print "ok 4\n";
21 41
22undef $sw; 42undef $sw;
23 43
24print "ok 5\n"; 44print "ok 5\n";
25 45
26kill 'CHLD', 0;
27
28print "ok 6\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines