… | |
… | |
17 | $^W = 0; # 5.8.6 bugs |
17 | $^W = 0; # 5.8.6 bugs |
18 | |
18 | |
19 | use AnyEvent; |
19 | use AnyEvent; |
20 | use AnyEvent::Util; |
20 | use AnyEvent::Util; |
21 | |
21 | |
|
|
22 | BEGIN { $^W = 0 } |
22 | BEGIN { $ENV{PERL_ANYEVENT_LOOP_TESTS} or ((print qq{1..0 # SKIP PERL_ANYEVENT_LOOP_TESTS not true\n}), exit 0) } |
23 | BEGIN { $ENV{PERL_ANYEVENT_LOOP_TESTS} or ((print qq{1..0 # SKIP PERL_ANYEVENT_LOOP_TESTS not true\n}), exit 0) } |
23 | BEGIN { eval q{use AnyEvent::Impl::Event;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::Event not loadable\n}), exit 0) } |
24 | BEGIN { eval q{use AnyEvent::Impl::Event;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::Event not loadable\n}), exit 0) } |
24 | |
25 | |
25 | |
26 | |
26 | |
27 | |
27 | $| = 1; print "1..15\n"; |
28 | $| = 1; print "1..15\n"; |
28 | |
29 | |
29 | print "ok 1\n"; |
30 | print "ok 1\n"; |
|
|
31 | |
|
|
32 | $AnyEvent::MAX_SIGNAL_LATENCY = 0.05; |
30 | |
33 | |
31 | my ($a, $b) = AnyEvent::Util::portable_socketpair; |
34 | my ($a, $b) = AnyEvent::Util::portable_socketpair; |
32 | |
35 | |
33 | # I/O write |
36 | # I/O write |
34 | { |
37 | { |
… | |
… | |
94 | print $s == 0 ? "" : "not ", "ok 6 # $s\n"; |
97 | print $s == 0 ? "" : "not ", "ok 6 # $s\n"; |
95 | |
98 | |
96 | kill INT => $$; |
99 | kill INT => $$; |
97 | |
100 | |
98 | $cv = AE::cv; |
101 | $cv = AE::cv; |
99 | $wt = AE::timer 0.01, 0, $cv; |
102 | $wt = AE::timer 0.2, 0, $cv; # maybe OS X needs more time here? or maybe some buggy arm kernel? |
100 | |
103 | |
101 | $s = 0; |
104 | $s = 0; |
102 | $cv->recv; |
105 | $cv->recv; |
103 | |
106 | |
104 | print $s == 3 ? "" : "not ", "ok 7 # $s\n"; |
107 | print $s == 3 ? "" : "not ", "ok 7 # $s\n"; |
… | |
… | |
109 | $s = 0; |
112 | $s = 0; |
110 | $cv->recv; |
113 | $cv->recv; |
111 | |
114 | |
112 | print $s == 0 ? "" : "not ", "ok 8 # $s\n"; |
115 | print $s == 0 ? "" : "not ", "ok 8 # $s\n"; |
113 | } |
116 | } |
114 | |
|
|
115 | $AnyEvent::MAX_SIGNAL_LATENCY = 0.2; |
|
|
116 | |
117 | |
117 | # child |
118 | # child |
118 | { |
119 | { |
119 | my $cv = AE::cv; |
120 | my $cv = AE::cv; |
120 | my $wt = AE::timer 0.01, 0, $cv; |
121 | my $wt = AE::timer 0.01, 0, $cv; |
… | |
… | |
137 | print $s == 0 ? "" : "not ", "ok 9 # $s\n"; |
138 | print $s == 0 ? "" : "not ", "ok 9 # $s\n"; |
138 | |
139 | |
139 | kill 9, $pid; |
140 | kill 9, $pid; |
140 | |
141 | |
141 | $cv = AE::cv; |
142 | $cv = AE::cv; |
142 | $wt = AE::timer 0.01, 0, $cv; |
143 | $wt = AE::timer 0.2, 0, $cv; # cygwin needs ages for this |
143 | |
144 | |
144 | $s = 0; |
145 | $s = 0; |
145 | $cv->recv; |
146 | $cv->recv; |
146 | |
147 | |
147 | print $s == 3 ? "" : "not ", "ok 10 # $s\n"; |
148 | print $s == 3 ? "" : "not ", "ok 10 # $s\n"; |