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

Comparing AnyEvent/t/67_tk_03_child.t (file contents):
Revision 1.3 by root, Fri Jul 17 22:05:12 2009 UTC vs.
Revision 1.4 by root, Sat Jul 18 00:05:29 2009 UTC

1use POSIX ();
2
3use AnyEvent;
4BEGIN { eval q{use AnyEvent::Impl::Tk;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::Tk not found}), exit 0) }
5
1BEGIN { 6BEGIN {
2 # check for broken perls 7 # check for broken perls
3 if ($^O =~ /mswin32/i) { 8 if ($^O =~ /mswin32/i) {
4 my $ok; 9 my $ok;
5 local $SIG{CHLD} = sub { $ok = 1 }; 10 local $SIG{CHLD} = sub { $ok = 1 };
12 exit 0; 17 exit 0;
13 } 18 }
14 } 19 }
15} 20}
16 21
17BEGIN {
18 $|=1;
19 print "1..7\n" 22$| = 1; print "1..7\n";
20}
21
22use POSIX ();
23
24use AnyEvent;
25use AnyEvent::Impl::Tk;
26 23
27$AnyEvent::MAX_SIGNAL_LATENCY = 1; 24$AnyEvent::MAX_SIGNAL_LATENCY = 1;
28 25
29print "ok 1\n"; 26print "ok 1\n";
30 27
60 print $pid2 == $_[0] ? "" : "not ", "ok 5 # $pid2 == $_[0]\n"; 57 print $pid2 == $_[0] ? "" : "not ", "ok 5 # $pid2 == $_[0]\n";
61 print 7 == ($_[1] >> 8) ? "" : "not ", "ok 6 # 7 == $_[1] >> 8 ($_[1])\n"; 58 print 7 == ($_[1] >> 8) ? "" : "not ", "ok 6 # 7 == $_[1] >> 8 ($_[1])\n";
62 $cv2->broadcast; 59 $cv2->broadcast;
63}); 60});
64 61
65my $error = AnyEvent->timer (after => 15, cb => sub { 62my $error = AnyEvent->timer (after => 5, cb => sub {
66 print <<EOF; 63 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"; 64Bail 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";
68EOF 65EOF
69 exit 0; 66 exit 0;
70});
71
72my $inter = AnyEvent->timer (after => 14, cb => sub {
73 print "not ok 5 # inter\n";
74 print "not ok 6 # inter\n";
75 $cv2->send;
76}); 67});
77 68
78$cv2->wait; 69$cv2->wait;
79 70
80print "ok 7\n"; 71print "ok 7\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines