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.2 by root, Thu Jul 9 22:49:18 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 23
22use POSIX (); 24$AnyEvent::MAX_SIGNAL_LATENCY = 1;
23
24use AnyEvent;
25use AnyEvent::Impl::Tk;
26 25
27print "ok 1\n"; 26print "ok 1\n";
28 27
29AnyEvent::detect; # force-load event model 28AnyEvent::detect; # force-load event model
30 29
58 print $pid2 == $_[0] ? "" : "not ", "ok 5 # $pid2 == $_[0]\n"; 57 print $pid2 == $_[0] ? "" : "not ", "ok 5 # $pid2 == $_[0]\n";
59 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";
60 $cv2->broadcast; 59 $cv2->broadcast;
61}); 60});
62 61
63my $error = AnyEvent->timer (after => 15, cb => sub { 62my $error = AnyEvent->timer (after => 5, cb => sub {
64 print <<EOF; 63 print <<EOF;
65Bail 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";
66EOF 65EOF
67 exit 0; 66 exit 0;
68});
69
70my $inter = AnyEvent->timer (after => 14, cb => sub {
71 print "not ok 5 # inter\n";
72 print "not ok 6 # inter\n";
73 $cv2->send;
74}); 67});
75 68
76$cv2->wait; 69$cv2->wait;
77 70
78print "ok 7\n"; 71print "ok 7\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines