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

Comparing AnyEvent/t/03_child.t (file contents):
Revision 1.7 by root, Sun Nov 25 14:08:12 2007 UTC vs.
Revision 1.8 by root, Tue Apr 22 05:12:19 2008 UTC

1$|=1; 1$|=1;
2BEGIN { print "1..7\n" } 2BEGIN {
3 print "1..7\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 you either found a bug in
12AnyEvent or, more likely, you have a defective perl (most windows perl
13distros are broken, cygwin perl works). If you do not rely on child
14handlers you can force the installation of this module and the rest will
15likely work. Otherwise upgrading to a working perl is recommended.
16EOF
6 17
7print "ok 1\n"; 18print "ok 1\n";
8 19
9my $pid = fork; 20my $pid = fork;
10 21
36 print $pid2 == $_[0] ? "" : "not ", "ok 5 # $pid2 == $_[0]\n"; 47 print $pid2 == $_[0] ? "" : "not ", "ok 5 # $pid2 == $_[0]\n";
37 print 7 == ($_[1] >> 8) ? "" : "not ", "ok 6 # 7 == $_[1] >> 8 ($_[1])\n"; 48 print 7 == ($_[1] >> 8) ? "" : "not ", "ok 6 # 7 == $_[1] >> 8 ($_[1])\n";
38 $cv2->broadcast; 49 $cv2->broadcast;
39}); 50});
40 51
52my $error = AnyEvent->timer (after => 5, cb => sub {
53 print <<EOF;
54Bail 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";
55EOF
56 exit 0;
57});
58
41$cv2->wait; 59$cv2->wait;
42 60
43print "ok 7\n"; 61print "ok 7\n";
44 62
45 63

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines