Skip Menu |

This queue is for tickets about the Attribute-Util CPAN distribution.

Report information
The Basics
Id: 15527
Status: resolved
Priority: 0/
Queue: Attribute-Util

People
Owner: Nobody in particular
Requestors: barbie [...] missbarbell.co.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



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'); +}
Thanks. Though your patch didn't work on general cases as well, I've tweaked your patch so it skips 04sighandler.t on Win32. Dan the Maintainer Thereof On Fri Nov 04 11:10:01 2005, BARBIE wrote: Show quoted text
> 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.