Propagating environment to taint tests

Andy Armstrong n at rciss.us
Mon Oct 1 01:34:02 BST 2007


On 30 Sep 2007, at 23:09, Michael G Schwern wrote:
> As long as we're on the subject of propagating environment, I'd  
> like to get
> the rationale for another feature down.  Taint mode normally ignores
> environment variables.  This means things like PERL5LIB and  
> PERL5OPT are not
> seen.  Test::Harness has made sure that the libraries in PERL5LIB  
> are seen by
> taint tests by re-encoding it as -I switches.  I've also just done  
> the same
> for PERL5OPT.
>
> This behavior is pushed down into TAP::Parser, it's not just a  
> Test::Harness
> compatibility thing.  I feel it is of a different nature then of  
> propagating
> the harness' @INC down to the tests because otherwise the taint  
> tests would be
> unlikely to run.  Consider someone who has installed modules via  
> fink.  fink
> puts /sw/lib/perl5 into PERL5LIB.  If a taint test relies on a  
> module that the
> user has installed via fink, MakeMaker or Module::Build will  
> resolve the
> dependency just fine, but unless we propagated PERL5LIB the taint  
> test would
> be unable to see it and would blow up.
>
> So, in effect, it makes distributing taint tests possible.
>
> It's also a whole lot simpler to maintain then @INC propagation.

Absolutely +1.

-- 
Andy Armstrong, Hexten





More information about the tapx-dev mailing list