Since it seems that my previous two commit emails disappeared, so for your
pleasure I have recreated them.
Gary
[ Gary Benson, Red Hat Europe ][ [EMAIL PROTECTED] ][ GnuPG 60E8793A ]
Index: perl-framework/t/php/func5.t
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/t/php/func5.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- perl-framework/t/php/func5.t 2001/08/19 20:21:51 1.5
+++ perl-framework/t/php/func5.t 2001/08/31 00:51:11 1.6
@@ -9,31 +9,18 @@
my $env = Apache::TestConfig->thaw;
+my $file = "htdocs/php/func5.php.ran";
+unlink $file if -e $file;
+
my $expected = <<EXPECT;
foo() will be called on shutdown...
EXPECT
-my $error_log = "$env->{vars}->{t_logs}/error_log";
-open(ERROR_LOG, $error_log);
-seek(ERROR_LOG, 0, 1); #goto end
-
my $result = GET_BODY "/php/func5.php";
ok $result eq $expected;
-
-## open error_log and verify the last line is:
-## foo() has been called.
-
-$expected = "foo() has been called.\n";
+ok -e $file;
-while (<ERROR_LOG>) {
- if ($_ eq $expected) {
- $result = $_;
- last;
- }
-}
-
-close(ERROR_LOG);
-
-ok $result eq $expected;
+# Clean up
+unlink $file if -e $file;
Index: perl-framework/t/htdocs/php/func5.php
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/t/htdocs/php/func5.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- perl-framework/t/htdocs/php/func5.php 2001/08/10 17:12:57 1.2
+++ perl-framework/t/htdocs/php/func5.php 2001/08/31 00:51:11 1.3
@@ -1,8 +1,21 @@
<?php
+$file = "$SCRIPT_FILENAME.ran";
+
function foo()
{
- error_log("foo() has been called.", 0);
+ global $file;
+
+ $fp = fopen($file, "w");
+ if( $fp )
+ {
+ fclose($fp);
+ }
+ else
+ {
+ // Attempt to alert the user
+ error_log("can't write $file.", 0);
+ }
}
register_shutdown_function("foo");
Index: perl-framework/Apache-Test/lib/Apache/TestRun.pm
===================================================================
RCS file:
/home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
retrieving revision 1.42
diff -u -r1.42 TestRun.pm
--- perl-framework/Apache-Test/lib/Apache/TestRun.pm 2001/08/30 06:20:14
1.42
+++ perl-framework/Apache-Test/lib/Apache/TestRun.pm 2001/08/30 13:21:00
@@ -406,6 +406,11 @@
$self->default_run_opts;
+ #export some environment variables for t/modules/env.t
+ #(the values are unimportant)
+ $ENV{TESTHOSTNAME} = 'test.host.name';
+ $ENV{TESTHOSTTYPE} = 'z80';
+
$self->start;
$self->run_tests;
Index: perl-framework/t/conf/extra.conf.in
===================================================================
RCS file: /home/cvspublic/httpd-test/perl-framework/t/conf/extra.conf.in,v
retrieving revision 1.20
diff -u -r1.20 extra.conf.in
--- perl-framework/t/conf/extra.conf.in 2001/08/28 16:55:55 1.20
+++ perl-framework/t/conf/extra.conf.in 2001/08/30 13:21:00
@@ -210,12 +210,12 @@
## mod_env test config
##
<IfModule mod_env.c>
-PassEnv HOSTNAME
+PassEnv TESTHOSTNAME
SetEnv ENV_TEST "mod_env test environment variable"
UnsetEnv UNSET
-PassEnv HOSTTYPE
-UnsetEnv HOSTTYPE
+PassEnv TESTHOSTTYPE
+UnsetEnv TESTHOSTTYPE
SetEnv NOT_HERE "this will not be here"
UnsetEnv NOT_HERE
Index: perl-framework/t/htdocs/modules/env/host.shtml
===================================================================
RCS file:
/home/cvspublic/httpd-test/perl-framework/t/htdocs/modules/env/host.shtml,v
retrieving revision 1.1
diff -u -r1.1 host.shtml
--- perl-framework/t/htdocs/modules/env/host.shtml 2001/08/22 00:25:36
1.1
+++ perl-framework/t/htdocs/modules/env/host.shtml 2001/08/30 13:21:00
@@ -1 +1 @@
-<!--#echo var="HOSTNAME" -->
+<!--#echo var="TESTHOSTNAME" -->
Index: perl-framework/t/htdocs/modules/env/type.shtml
===================================================================
RCS file:
/home/cvspublic/httpd-test/perl-framework/t/htdocs/modules/env/type.shtml,v
retrieving revision 1.1
diff -u -r1.1 type.shtml
--- perl-framework/t/htdocs/modules/env/type.shtml 2001/08/22 00:25:36
1.1
+++ perl-framework/t/htdocs/modules/env/type.shtml 2001/08/30 13:21:00
@@ -1 +1 @@
-<!--#echo var="HOSTTYPE" -->
+<!--#echo var="TESTHOSTTYPE" -->
Index: perl-framework/t/modules/env.t
===================================================================
RCS file: /home/cvspublic/httpd-test/perl-framework/t/modules/env.t,v
retrieving revision 1.4
diff -u -r1.4 env.t
--- perl-framework/t/modules/env.t 2001/08/28 16:18:17 1.4
+++ perl-framework/t/modules/env.t 2001/08/30 13:21:01
@@ -9,7 +9,7 @@
##
my %test = (
- 'host' => $ENV{HOSTNAME},
+ 'host' => $ENV{TESTHOSTNAME},
'set' => "mod_env test environment variable",
'unset' => '(none)',
'type' => '(none)',