Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Simple CPAN distribution.

Report information
The Basics
Id: 34065
Status: resolved
Priority: 0/
Queue: Test-Simple

People
Owner: Nobody in particular
Requestors: pjs [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.78
Fixed in: 0.74



Subject: use_ok clobbers $SIG{__DIE__}
$ cat Foo.pm package Foo; use strict; use warnings; $SIG{__DIE__} = sub { print 42 }; 1; $ cat foo.t #!/usr/local/bin/perl use strict; use warnings; use Test::More tests => 1; BEGIN { use_ok('Foo') } print "No handler\n" unless $SIG{__DIE__}; $ ./foo.t 1..1 ok 1 - use Foo; No handler $ cat bar.t #!/usr/local/bin/perl use strict; use warnings; use Test::More tests => 1; use Foo; print "No handler\n" unless $SIG{__DIE__}; is(1,1); $ ./bar.t 1..1 ok 1 $ Roll back to 0.74 and: $ ./foo.t 1..1 ok 1 - use Foo; $
Subject: Re: [rt.cpan.org #34065] use_ok clobbers $SIG{__DIE__}
Date: Thu, 13 Mar 2008 16:51:28 -0700
To: bug-Test-Simple [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
I see the problem. It's the same one that existed in base.pm. The module is loaded inside an eval and Test::More localizes $SIG{__DIE__} to prevent any taking effect. This means any handler put in place in the used module is also localized. I'll have to do the same trick here as in base.pm.
I've applied the SIG{__DIE__} fix from base.pm to svn.