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

Comparing AnyEvent/t/63_eventlib_03_child.t (file contents):
Revision 1.5 by root, Sat Jul 18 05:19:09 2009 UTC vs.
Revision 1.8 by root, Sun Dec 5 11:41:46 2010 UTC

1use POSIX (); 1use POSIX ();
2 2
3no warnings; 3no warnings;
4
5use AnyEvent;
6BEGIN { eval q{use AnyEvent::Impl::EventLib;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::EventLib not found}), exit 0) }
7 4
8BEGIN { 5BEGIN {
9 # check for broken perls 6 # check for broken perls
10 if ($^O =~ /mswin32/i) { 7 if ($^O =~ /mswin32/i) {
11 my $ok; 8 my $ok;
12 local $SIG{CHLD} = sub { $ok = 1 }; 9 local $SIG{CHLD} = sub { $ok = 1 };
13 kill 'CHLD', 0; 10 kill 'CHLD', 0;
14 11
15 unless ($ok) { 12 unless ($ok) {
16 print <<EOF; 13 print <<EOF;
171..0 # Your perl interpreter is badly BROKEN. Child watchers will not work, ever. Try upgrading to a newer perl or a working perl (cygwin's perl is known to work). If that is not an option, you should be able to use the remaining functionality of AnyEvent, but child watchers WILL NOT WORK. 141..0 # SKIP Your perl interpreter is badly BROKEN. Child watchers will not work, ever. Try upgrading to a newer perl or a working perl (cygwin's perl is known to work). If that is not an option, you should be able to use the remaining functionality of AnyEvent, but child watchers WILL NOT WORK.
18EOF 15EOF
19 exit 0; 16 exit 0;
20 } 17 }
21 } 18 }
22} 19}
23 20
21use AnyEvent;
22BEGIN { eval q{use AnyEvent::Impl::EventLib;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::EventLib not loadable}), exit 0) }
23
24$| = 1; print "1..50\n"; 24$| = 1; print "1..50\n";
25 25
26$AnyEvent::MAX_SIGNAL_LATENCY = 0.2;
27
26for my $it ("", 1, 2, 3, 4) { 28for my $it ("", 1, 2, 3, 4) {
27 $AnyEvent::MAX_SIGNAL_LATENCY = 1;
28
29 print "ok ${it}1\n"; 29 print "ok ${it}1\n";
30 30
31 AnyEvent::detect; # force-load event model 31 AnyEvent::detect; # force-load event model
32 32
33 my $pid = fork; 33 my $pid = fork;
62 $cv2->broadcast; 62 $cv2->broadcast;
63 }); 63 });
64 64
65 my $error = AnyEvent->timer (after => 5, cb => sub { 65 my $error = AnyEvent->timer (after => 5, cb => sub {
66 print <<EOF; 66 print <<EOF;
67Bail out! No child exit detected. This is either a bug in AnyEvent or a bug in your Perl (mostly some windows distributions suffer from that): child watchers might not work properly on this platform. You can force installation of this module if you do not rely on child watchers, or you could upgrade to a working version of Perl for your platform.\n"; 67No child exit detected. This is either a bug in AnyEvent or a bug in your Perl (mostly some windows distributions suffer from that): child watchers might not work properly on this platform. You can force installation of this module if you do not rely on child watchers, or you could upgrade to a working version of Perl for your platform.\n";
68EOF 68EOF
69 exit 0; 69 exit 1;
70 }); 70 });
71 71
72 $cv2->wait; 72 $cv2->wait;
73 73
74 print "ok ${it}7\n"; 74 print "ok ${it}7\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines