Return-Path: Delivered-To: apmail-perl-modperl-cvs-archive@www.apache.org Received: (qmail 99745 invoked from network); 13 Dec 2004 15:26:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 13 Dec 2004 15:26:08 -0000 Received: (qmail 30231 invoked by uid 500); 13 Dec 2004 15:25:49 -0000 Delivered-To: apmail-perl-modperl-cvs-archive@perl.apache.org Received: (qmail 30124 invoked by uid 500); 13 Dec 2004 15:25:46 -0000 Mailing-List: contact modperl-cvs-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@perl.apache.org Delivered-To: mailing list modperl-cvs@perl.apache.org Received: (qmail 30012 invoked by uid 99); 13 Dec 2004 15:25:44 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Date: 13 Dec 2004 15:25:31 -0000 Message-ID: <20041213152531.99474.qmail@minotaur.apache.org> From: stas@apache.org To: modperl-cvs@perl.apache.org Subject: svn commit: r111718 - /perl/modperl/trunk/t/directive/setupenv.t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: stas Date: Mon Dec 13 07:25:30 2004 New Revision: 111718 URL: http://svn.apache.org/viewcvs?view=rev&rev=111718 Log: on Win32, some user environment variables, like HOME, may be passed through (via Apache?) if set, while system environment variables are not. so try to find an existing shell variable (that is not passed by Apache) and use it in the test to make sure mod_perl doesn't see it Modified: perl/modperl/trunk/t/directive/setupenv.t Modified: perl/modperl/trunk/t/directive/setupenv.t Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/directive/setupenv.t?view=diff&rev=111718&p1=perl/modperl/trunk/t/directive/setupenv.t&r1=111717&p2=perl/modperl/trunk/t/directive/setupenv.t&r2=111718 ============================================================================== --- perl/modperl/trunk/t/directive/setupenv.t (original) +++ perl/modperl/trunk/t/directive/setupenv.t Mon Dec 13 07:25:30 2004 @@ -23,4 +23,23 @@ ok t_cmp $env{REQUEST_URI}, $location, "testing REQUEST_URI"; -ok not exists $env{HOME}; +{ + # on Win32, some user environment variables, like HOME, may be + # passed through (via Apache?) if set, while system environment + # variables are not. so try to find an existing shell variable + # (that is not passed by Apache) and use it in the test to make + # sure mod_perl doesn't see it + + my $var; + for (qw(SHELL USER OS)) { + $var = $_, last if exists $ENV{$_}; + } + + if (defined $var) { + ok t_cmp $env{$var}, undef, "env var $var=$ENV{$var} is ". + "set in shell, but shouldn't be seen inside mod_perl"; + } + else { + skip "couldn't find a suitable env var to test against", 0; + } +}