[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    RE: mod_perl2 + ModPerl::RegistryPrefork + Test::Builder = segfault
From:       "Berg, Eric" <eric.berg () lehman ! com>
Date:       2008-09-04 23:15:19
Message-ID: 5CAFF755525FC5418CCF35FAEB2683BE12A31B0C () njpcmg1exms305 ! leh ! lbcorp ! lehman ! com
[Download RAW message or body]

> On Thu, Sep 4, 2008 at 6:58 PM, Berg, Eric 
> > When I say that Test::Builder/Test::More/etc. are tightly 
> > coupled, I'm talking really entwined.  In some cases, we have
created a 
> > class with a bunch of test-related methods that look through the
symbol 
> > table and find methods that =~ m/^test_/ and then we run those
tests, which
> > include calls to Test::Builder methods.  There's no easy way to turn
> > this off.
> 
> This happens even when you're not testing?  Or do you really want to
> run those tests every time anyone loads the module?

No, we only run those tests when we check them into CVS and the hooks
trigger scripts that run the test methods in our modules.  The problem
is that when you load/use Test::Builder, it creates a singleton instance
that does some initialization, including mapping STDERR and STDOUT -- I
believe to class variables.  Have you ever noticed how you never see
anything coming out of CPAN mods when you do a make test?  I think this
is the reason:  stdout and stderr are captured this way.

> 
> > When you say that we could load it conditionally -- again, 
> > not really an option -- are you thinking that we could do a
conditional 
> > require() and import explicitly or use fully-qualified calls?
> 
> The former - a BEGIN block that determines the situation and loads
> test modules if you're not in mod_perl.  You can also do tricks to
> fake Test::Builder's API without loading it, but that's a really
> roundabout way of dealing with the issue.

Right.  That'd be good if we were't a) subclassing from modules that
directly use Test::Builder methods, and b) have T::B calls throughout
our code.

Right now I'm working on figuring out how to disable the mapping (which
appears to happen in Test::Builder->_dup_stdhandles() so that we can
have everything play nicely together.

As much as I love having my modules validated whenver they're checked in
(especially for the other developers!) this is killin' me.

E
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \
-

This message is intended only for the personal and confidential use of the designated \
recipient(s) named above.  If you are not the intended recipient of this message you \
are hereby notified that any review, dissemination, distribution or copying of this \
message is strictly prohibited.  This communication is for information purposes only \
and should not be regarded as an offer to sell or as a solicitation of an offer to \
buy any financial product, an official confirmation of any transaction, or as an \
official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be \
secure or error-free.  Therefore, we do not represent that this information is \
complete or accurate and it should not be relied upon as such.  All information is \
subject to change without notice.

--------
IRS Circular 230 Disclosure:
Please be advised that any discussion of U.S. tax matters contained within this \
communication (including any attachments) is not intended or written to be used and \
cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) \
promoting, marketing or recommending to another party any transaction or matter \
addressed herein.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic