~ubuntu-branches/ubuntu/utopic/libanyevent-perl/utopic-proposed

« back to all changes in this revision

Viewing changes to t/63_eventlib_02_signals.t

  • Committer: Package Import Robot
  • Author(s): Xavier Guimard
  • Date: 2012-12-02 09:03:32 UTC
  • mfrom: (1.4.19)
  • Revision ID: package-import@ubuntu.com-20121202090332-35w2kkal4pue33kx
Tags: 7.040-1
* Imported Upstream version 7.040
* Bump Standards-Version to 3.9.4
* Use debhelper 8 instead of 9 (non binary)
* Update copyright years

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
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
 
use AnyEvent;
11
 
 
12
 
         BEGIN { $ENV{PERL_ANYEVENT_LOOP_TESTS} or ((print qq{1..0 # SKIP PERL_ANYEVENT_LOOP_TESTS not true\n}), exit 0) }
13
 
         BEGIN { eval q{use AnyEvent::Impl::EventLib;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::EventLib not loadable\n}), exit 0) }
14
 
         
15
 
      
16
 
 
17
 
$| = 1; print "1..5\n";
18
 
 
19
 
print "ok 1\n";
20
 
 
21
 
my $cv = AnyEvent->condvar;
22
 
 
23
 
my $error = AnyEvent->timer (after => 5, cb => sub {
24
 
   print <<EOF;
25
 
Bail out! No signal caught.
26
 
EOF
27
 
   exit 0;
28
 
});
29
 
 
30
 
my $sw = AnyEvent->signal (signal => 'INT', cb => sub {
31
 
  print "ok 3\n";
32
 
  $cv->broadcast;
33
 
});
34
 
 
35
 
print "ok 2\n";
36
 
kill 'INT', $$;
37
 
$cv->recv;
38
 
undef $error;
39
 
 
40
 
print "ok 4\n";
41
 
 
42
 
undef $sw;
43
 
 
44
 
print "ok 5\n";
45