~ubuntu-branches/ubuntu/precise/libanyevent-perl/precise

« back to all changes in this revision

Viewing changes to t/62_cocoa_02_signals.t

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghedini, Ansgar Burchardt, Salvatore Bonaccorso, Alessandro Ghedini
  • Date: 2011-08-26 14:41:42 UTC
  • mfrom: (1.4.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20110826144142-kyv02a88kc6pyait
Tags: 6.010-1
[ Ansgar Burchardt ]
* debian/control: Convert Vcs-* fields to Git.

[ Salvatore Bonaccorso ]
* debian/copyright: Replace DEP5 Format-Specification URL from
  svn.debian.org to anonscm.debian.org URL.

[ Alessandro Ghedini ]
* New upstream release
* Update upstream copyright years
* Re-order (Build-)Depends
* Add debian/NEWS with incompatible changes and deprecations
* Move libasync-interrupt-perl to Suggests
* Add libtask-weaken-perl to Suggests
* Run loop tests
* Add libevent-perl, libglib-perl, libio-async-perl, libnet-ssleay-perl, 
  libpoe-perl and perl-tk to Build-Depends (needed by tests) and Suggests
* Run tests under xvfb (due to Tk tests), update Build-Depends accordingly

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::Cocoa;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::Cocoa 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