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