httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [RELEASE CANDIDATE] Apache-Test 1.13
Date Thu, 26 Aug 2004 00:59:16 GMT
William McKee wrote:
> On Tue, Aug 24, 2004 at 01:35:48PM -0400, William McKee wrote:
> 
>>>was there supposed to be an attachment or something?
>>
>>Dangit! Let's try that again...
> 
> 
> OK, something funny is going on. My attachments seem to be getting
> stripped. I'm going to inline the code in this email.
> 
> 
> William
> 
> ---------------
> 
> ## FILE: statement_not_reached_OK.t
> #!/usr/bin/perl
> use strict;
> no strict 'refs';
> use warnings;
> use Test::More;
> plan tests => 1;
> use Apache::TestUtil;
> use Apache::TestRequest;
> # This is OK
> use CGI::Carp;
> ok 1;
> 
> 
> 
> ## FILE: statement_not_reached.t
> #!/usr/bin/perl
> use strict;
> no strict 'refs';
> use warnings;
> use Test::More;
> plan tests => 1;
> # Calling CGI::Carp before loading Apache::* fails
> use CGI::Carp;
> use Apache::TestUtil;
> use Apache::TestRequest;
> ok 1;

Heh, it's so much easier when you have a reproducable case to work on. 
Here is the reduced version of your test independent of A-T:


use strict;
use warnings;

BEGIN {
   require Carp;
   *CORE::GLOBAL::die = \&CGI::Carp::die;
}

exec "echo OK";
die "shouldnot be reached";

It shouldn't fail, but it fails. Why? Reading:

perldoc -f exec:
                [...]
                Since it's a common mistake to use "exec" instead of "system",
                Perl warns you if there is a following statement which isn't
                "die", "warn", or "exit" (if "-w" is set  -  but you always do
                that).

but if someone overrides CORE::die it fails to recognize that.

I thought an explicit:

no warnings 'exit'; will work, but it doesn't.

I'll take it to p5p and let you know the outcoming.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message