Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

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__}
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 516
Download (untitled) / with headers
text/plain 516b
$ 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; $
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00,SPF_PASS
In-Reply-To: <rt-3.6.HEAD-8903-1205449889-1541.34065-4-0 [...] rt.cpan.org>
References: <RT-Ticket-34065 [...] rt.cpan.org> <rt-3.6.HEAD-8903-1205449889-1541.34065-4-0 [...] rt.cpan.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
X-RT-Original-Encoding: utf-8
Received: from x1.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id B63764D8016 for <bug-Test-Simple [...] rt.cpan.org>; Thu, 13 Mar 2008 19:52:18 -0400 (EDT)
Received: (qmail 21157 invoked from network); 13 Mar 2008 23:52:17 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 13 Mar 2008 23:52:17 -0000
Received: from a-sasl-fastnet.sasl.smtp.pobox.com (HELO sasl.smtp.pobox.com) (207.106.133.19) by 16.mx.develooper.com (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Mar 2008 16:52:14 -0700
Received: from localhost.localdomain (localhost [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id EEAB116D1 for <bug-Test-Simple [...] rt.cpan.org>; Thu, 13 Mar 2008 19:51:51 -0400 (EDT)
Received: from windhund.schwern.org (069-064-236-003.pdx.net [69.64.236.3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 55D2016D0 for <bug-Test-Simple [...] rt.cpan.org>; Thu, 13 Mar 2008 19:51:50 -0400 (EDT)
Delivered-To: cpan-bug+Test-Simple [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #34065] use_ok clobbers $SIG{__DIE__}
User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213)
Return-Path: <schwern [...] pobox.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Test-Simple [...] rt.cpan.org
Date: Thu, 13 Mar 2008 16:51:28 -0700
X-Spam-Level: *
Message-Id: <47D9BE00.8030900 [...] pobox.com>
To: bug-Test-Simple [...] rt.cpan.org
X-Enigmail-Version: 0.95.6
Content-Transfer-Encoding: 7bit
From: Michael G Schwern <schwern [...] pobox.com>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.6.HEAD-8945-1205452344-1840.34065-0-0 [...] rt.cpan.org>
Content-Length: 299
Download (untitled) / with headers
text/plain 299b
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.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-2085-1213987536-1031.34065-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 54
I've applied the SIG{__DIE__} fix from base.pm to svn.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.