1 |
root |
1.5 |
BEGIN { |
2 |
|
|
unless (exists $SIG{USR1}) { |
3 |
|
|
print <<EOF; |
4 |
|
|
1..0 # SKIP Broken perl detected, skipping tests. |
5 |
|
|
EOF |
6 |
|
|
exit 0; |
7 |
|
|
} |
8 |
|
|
} |
9 |
|
|
|
10 |
root |
1.3 |
use AnyEvent; |
11 |
root |
1.6 |
BEGIN { eval q{use AnyEvent::Impl::EV;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::EV not loadable |
12 |
|
|
}), exit 0) } |
13 |
root |
1.1 |
|
14 |
root |
1.3 |
$| = 1; print "1..5\n"; |
15 |
root |
1.1 |
|
16 |
|
|
print "ok 1\n"; |
17 |
|
|
|
18 |
|
|
my $cv = AnyEvent->condvar; |
19 |
|
|
|
20 |
|
|
my $error = AnyEvent->timer (after => 5, cb => sub { |
21 |
|
|
print <<EOF; |
22 |
|
|
Bail out! No signal caught. |
23 |
|
|
EOF |
24 |
|
|
exit 0; |
25 |
|
|
}); |
26 |
|
|
|
27 |
|
|
my $sw = AnyEvent->signal (signal => 'INT', cb => sub { |
28 |
|
|
print "ok 3\n"; |
29 |
|
|
$cv->broadcast; |
30 |
|
|
}); |
31 |
|
|
|
32 |
|
|
print "ok 2\n"; |
33 |
|
|
kill 'INT', $$; |
34 |
|
|
$cv->wait; |
35 |
|
|
undef $error; |
36 |
|
|
|
37 |
|
|
print "ok 4\n"; |
38 |
|
|
|
39 |
|
|
undef $sw; |
40 |
|
|
|
41 |
|
|
print "ok 5\n"; |
42 |
|
|
|