develooper Front page | perl.perl5.porters | Postings from May 2012

Re: [perl #112750] tests fail if PERL_JSON_BACKEND env var set

Thread Previous
From:
Nicholas Clark
Date:
May 4, 2012 07:47
Subject:
Re: [perl #112750] tests fail if PERL_JSON_BACKEND env var set
Message ID:
20120504144701.GW9069@plum.flirble.org
On Fri, May 04, 2012 at 10:05:34AM -0400, David Golden wrote:

> c.f. https://metacpan.org/diff/release/DAGOLDEN/Parse-CPAN-Meta-1.4402/DAGOLDEN/Parse-CPAN-Meta-1.4404
> 
> A more aggressive option would be to modify Parse::CPAN::Meta itself
> (the .pm) to ignore PERL_(YAML|JSON)_BACKEND if PERL_CORE is set.
> That's a little gross, since it leaves a perl compile-time env
> variable test in the final code, but it would be a single point to
> bypass those issues entirely.

Maybe better to add them to this bit of t/TEST (line 94 onwards) which zaps
environment variables:

# delete env vars that may influence the results
# but allow override via *_TEST env var if wanted
# (e.g. PERL5OPT_TEST=-d:NYTProf)
for my $envname (qw(PERL5LIB PERLLIB PERL5OPT)) {
    my $override = $ENV{"${envname}_TEST"};
    if (defined $override) {
	warn "$0: $envname=$override\n";
	$ENV{$envname} = $override;
    }
    else {
	delete $ENV{$envname};
    }
}


That code is also run by t/harness

Nicholas Clark

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About