perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [mp2] directive/setupenv.t test on Win32
Date Sat, 11 Dec 2004 17:01:38 GMT
Randy Kobes wrote:
> On Sat, 11 Dec 2004, Stas Bekman wrote:
> 
> 
>>Randy Kobes wrote:
>>
>>>On Win32, the last subtest of t/directive/setupenv.t tests
>>>that $env{HOME} doesn't exist. However, as we've discussed
>>>before in some other contexts, for some reason Win32 does
>>>pass, in particular, the HOME environment variable, if it's
>>>set. I have HOME set, and consequently, this last subtest
>>>fails.
>>>
>>>I'm not sure if this different behaviour is due to
>>>mp2 or to Apache. In the meantime, would it be acceptable
>>>to skip this subtest for Win32:
>>
>>+1, but please add a little comment, like:
>>
>># on win32 sometimes $ENV{HOME} is set (probably by Apache) and
>># sometimes it's not
>>
>>But may be we should choose a different ENV var which exists on all OSes?
>>SHELL? USER?
> 
> 
> That's a good idea .... On Win32, neither SHELL nor USER is
> used in a standard configuration - PATH seems to be the only
> one in common (but that is set). Should do a Special Case
> (tm) for Win32, using, eg, OS, only to skip it, or just
> leave it as is (with the comment)? I think the problem with
> the way the test currently is is that it'll pass on Win32 in
> a standard configuration where $HOME isn't set at all,
> whereas the test presumes that $HOME has been set but
> doesn't exist at this level because it's not been passed
> through.

Right, to make it a good test we need to know what env var exist but 
wasn't passed. And since in t/directive/setupenv.t we can actually access 
%ENV which should be a complete copy of shell env, it's easier to make a 
more sensible test.

So for example iterate over SHELL, USER, OS and see what's set in real 
$ENV{} and then check that it's not in %env returned by the server.


-- 
__________________________________________________________________
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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message