… | |
… | |
12 | exit 0; |
12 | exit 0; |
13 | } |
13 | } |
14 | } |
14 | } |
15 | } |
15 | } |
16 | |
16 | |
|
|
17 | $^W = 0; # 5.8.6 bugs |
|
|
18 | |
17 | use AnyEvent; |
19 | use AnyEvent; |
18 | use AnyEvent::Util; |
20 | use AnyEvent::Util; |
19 | |
21 | |
|
|
22 | BEGIN { $^W = 0 } |
20 | 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) } |
21 | 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) } |
22 | |
25 | |
23 | |
26 | |
24 | |
27 | |
25 | $| = 1; print "1..15\n"; |
28 | $| = 1; print "1..15\n"; |
26 | |
29 | |
27 | print "ok 1\n"; |
30 | print "ok 1\n"; |
|
|
31 | |
|
|
32 | $AnyEvent::MAX_SIGNAL_LATENCY = 0.05; |
28 | |
33 | |
29 | my ($a, $b) = AnyEvent::Util::portable_socketpair; |
34 | my ($a, $b) = AnyEvent::Util::portable_socketpair; |
30 | |
35 | |
31 | # I/O write |
36 | # I/O write |
32 | { |
37 | { |
… | |
… | |
92 | print $s == 0 ? "" : "not ", "ok 6 # $s\n"; |
97 | print $s == 0 ? "" : "not ", "ok 6 # $s\n"; |
93 | |
98 | |
94 | kill INT => $$; |
99 | kill INT => $$; |
95 | |
100 | |
96 | $cv = AE::cv; |
101 | $cv = AE::cv; |
97 | $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? |
98 | |
103 | |
99 | $s = 0; |
104 | $s = 0; |
100 | $cv->recv; |
105 | $cv->recv; |
101 | |
106 | |
102 | print $s == 3 ? "" : "not ", "ok 7 # $s\n"; |
107 | print $s == 3 ? "" : "not ", "ok 7 # $s\n"; |
… | |
… | |
107 | $s = 0; |
112 | $s = 0; |
108 | $cv->recv; |
113 | $cv->recv; |
109 | |
114 | |
110 | print $s == 0 ? "" : "not ", "ok 8 # $s\n"; |
115 | print $s == 0 ? "" : "not ", "ok 8 # $s\n"; |
111 | } |
116 | } |
112 | |
|
|
113 | $AnyEvent::MAX_SIGNAL_LATENCY = 0.2; |
|
|
114 | |
117 | |
115 | # child |
118 | # child |
116 | { |
119 | { |
117 | my $cv = AE::cv; |
120 | my $cv = AE::cv; |
118 | my $wt = AE::timer 0.01, 0, $cv; |
121 | my $wt = AE::timer 0.01, 0, $cv; |
… | |
… | |
135 | print $s == 0 ? "" : "not ", "ok 9 # $s\n"; |
138 | print $s == 0 ? "" : "not ", "ok 9 # $s\n"; |
136 | |
139 | |
137 | kill 9, $pid; |
140 | kill 9, $pid; |
138 | |
141 | |
139 | $cv = AE::cv; |
142 | $cv = AE::cv; |
140 | $wt = AE::timer 0.01, 0, $cv; |
143 | $wt = AE::timer 0.2, 0, $cv; # cygwin needs ages for this |
141 | |
144 | |
142 | $s = 0; |
145 | $s = 0; |
143 | $cv->recv; |
146 | $cv->recv; |
144 | |
147 | |
145 | print $s == 3 ? "" : "not ", "ok 10 # $s\n"; |
148 | print $s == 3 ? "" : "not ", "ok 10 # $s\n"; |