--- AnyEvent/t/68_poe_03_child.t 2009/07/18 15:51:52 1.7 +++ AnyEvent/t/68_poe_03_child.t 2011/08/02 22:07:18 1.11 @@ -2,9 +2,6 @@ no warnings; -use AnyEvent; -BEGIN { eval q{use AnyEvent::Impl::POE;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::POE not found}), exit 0) } $^W = 0; - BEGIN { # check for broken perls if ($^O =~ /mswin32/i) { @@ -14,13 +11,17 @@ unless ($ok) { print <timer (after => 2, cb => sub { }); + # work around Tk bug until it has been fixed. + #my $timer = AnyEvent->timer (after => 2, cb => sub { }); my $cv = AnyEvent->condvar; @@ -50,13 +51,16 @@ $cv->broadcast; }); - $cv->wait; + $cv->recv; my $pid2 = fork || POSIX::_exit 7; my $cv2 = AnyEvent->condvar; - my $w2 = AnyEvent->child (pid => 0, cb => sub { + # Glib is the only model that doesn't support pid == 0 + my $pid0 = $AnyEvent::MODEL eq "AnyEvent::Impl::Glib" ? $pid2 : 0; + + my $w2 = AnyEvent->child (pid => $pid0, cb => sub { print $pid2 == $_[0] ? "" : "not ", "ok ${it}5 # $pid2 == $_[0]\n"; print 7 == ($_[1] >> 8) ? "" : "not ", "ok ${it}6 # 7 == $_[1] >> 8 ($_[1])\n"; $cv2->broadcast; @@ -69,7 +73,7 @@ exit 0; }); - $cv2->wait; + $cv2->recv; print "ok ${it}7\n"; print "ok ${it}8\n";