perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r111718 - /perl/modperl/trunk/t/directive/setupenv.t
Date Mon, 13 Dec 2004 15:25:31 GMT
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;
+    }
+}

Mime
View raw message