Subject: | alarm unsupported on Win32 |
Windows and Perl 5.6.x (and earlier) don't cope with alarm() at all. As such the tests in 04sighandler.t fail, particularly the last one. I tried implementing the skip on just the alarm test, but it still dies. The skip needs to be around the whole thing. The SIGVTALRM reference still emits a warning, but at least all tests pass.
--- Attribute-Util-0.02/t/04sighandler.t Fri Nov 4 16:02:54 2005
+++ Attribute-Util-0.02_01/t/04sighandler.t Fri Nov 4 15:58:55 2005
@@ -2,30 +2,35 @@
use warnings;
use strict;
-use Test;
+use Test::More;
BEGIN { plan tests => 3 }
-use Attribute::Util;
+SKIP: {
+ skip "Windows doesn't support alarm() with Perl 5.6.x or earlier.", 3
+ if($^O eq 'MSWin32' && $] < 5.007);
-sub myalrm : SigHandler(ALRM, VTALRM) {
- our $whereabouts = 'in myalrm';
-}
+ use Attribute::Util;
-sub mywarn : SigHandler(__WARN__) {
- our $whereabouts = 'in mywarn';
-}
+ sub myalrm : SigHandler(ALRM, VTALRM) {
+ our $whereabouts = 'in myalrm';
+ }
-sub mywarn2 : SigHandler(__WARN__) {
- our $whereabouts = 'in mywarn2';
-}
+ sub mywarn : SigHandler(__WARN__) {
+ our $whereabouts = 'in mywarn';
+ }
-our $whereabouts;
-ok($whereabouts, undef);
+ sub mywarn2 : SigHandler(__WARN__) {
+ our $whereabouts = 'in mywarn2';
+ }
-warn "oh no!";
-ok($whereabouts, 'in mywarn2');
+ our $whereabouts;
+ ok($whereabouts, undef);
-alarm(1);
+ warn "oh no!";
-sleep(2);
+ ok($whereabouts, 'in mywarn2');
-ok($whereabouts, 'in myalrm');
+
+ alarm(1);
+ sleep(2);
+ ok($whereabouts, 'in myalrm');
+}