1 | $|=1; |
|
|
2 | BEGIN { |
1 | BEGIN { |
3 | print "1..5\n"; |
2 | unless (exists $SIG{USR1}) { |
|
|
3 | print <<EOF; |
|
|
4 | 1..0 # SKIP Broken perl detected, skipping tests. |
|
|
5 | EOF |
|
|
6 | exit 0; |
|
|
7 | } |
4 | } |
8 | } |
5 | |
9 | |
6 | use AnyEvent; |
10 | use AnyEvent; |
7 | use AnyEvent::Impl::Perl; |
11 | BEGIN { require AnyEvent::Impl::Perl unless $ENV{PERL_ANYEVENT_MODEL} } |
8 | |
12 | |
9 | print STDERR <<EOF; |
13 | $| = 1; print "1..5\n"; |
10 | |
|
|
11 | If the following test hangs for a long time or terminates with a signal |
|
|
12 | you either found a bug in AnyEvent or, more likely, you have a defective |
|
|
13 | perl (most windows perl distros are broken, cygwin perl works). If you do |
|
|
14 | not rely on signal handlers you can force the installation of this module |
|
|
15 | and the rest will likely work. Otherwise upgrading to a working perl is |
|
|
16 | recommended. |
|
|
17 | EOF |
|
|
18 | |
14 | |
19 | print "ok 1\n"; |
15 | print "ok 1\n"; |
20 | |
16 | |
21 | my $cv = AnyEvent->condvar; |
17 | my $cv = AnyEvent->condvar; |
22 | |
18 | |
… | |
… | |
32 | $cv->broadcast; |
28 | $cv->broadcast; |
33 | }); |
29 | }); |
34 | |
30 | |
35 | print "ok 2\n"; |
31 | print "ok 2\n"; |
36 | kill 'INT', $$; |
32 | kill 'INT', $$; |
37 | $cv->wait; |
33 | $cv->recv; |
38 | undef $error; |
34 | undef $error; |
39 | |
35 | |
40 | print "ok 4\n"; |
36 | print "ok 4\n"; |
41 | |
37 | |
42 | undef $sw; |
38 | undef $sw; |