Subject: | Win32 test bug and patch |
Distribution name and version:
Apache-AuthCookie-3.05
Apache version:
1.3
perl version:
v5.8.0 built for MSWin32-x86-multi-thread
Operating system:
Windows XP Service Pack 1
Summary:
Test failed because Apache working directory differs from one in which the test is running.
As a result, relative paths specified in test files could not be resolved.
Suggested solution:
chdir to the test directory where it's nesessary.
(see attached patch)
BEGIN TEST OUTPUT:
C:\Downloads\CPAN\Apache-AuthCookie-3.05>nmake test
Microsoft (R) Program Maintenance Utility Version 7.10.2240.8
Copyright (C) Microsoft Corporation. All rights reserved.
cp AuthCookie/Util.pm blib\lib\Apache\AuthCookie/Util.pm
cp AuthCookie.pm blib\lib\Apache\AuthCookie.pm
C:\Perl\bin\perl.exe -Iblib\arch -Iblib\lib t/TEST -clean
C:\Perl\bin\perl.exe -Iblib\arch -Iblib\lib t/TEST -bugreport -verbose=0
C:/PROGRA~1/APACHE~1/APACHE/APACHE.EXE -d C:/Downloads/CPAN/Apache-AuthCookie-3.05/t -f C:/Downloads/CPAN/Apache-A
uthCookie-3.05/t/conf/httpd.conf -D APACHE1 -D PERL_USEITHREADS
using Apache/1.3.28
waiting 60 seconds for server to start: .WARNING: StartServers has no effect on Win32
Syntax error on line 17 of c:/downloads/cpan/apache-authcookie-3.05/t/conf/extra.conf:
Can't locate Sample/AuthCookieHandler.pm in @INC (@INC contains: ../blib/lib lib C:\Users\DataPro\Perl\lib/MSWin32
-x86-multi-thread C:\Users\DataPro\Perl\lib C:\Users\DataPro\Perl\lib\MSWin32-x86-multi-thread-5.8 c:/Perl/lib c:/
Perl/site/lib . c:/downloads/cpan/apache-authcookie-3.05/t/ c:/downloads/cpan/apache-authcookie-3.05/t/lib/perl) a
t (eval 5) line 3.
Note the errors or messages above, and press the <ESC> key to exit. 25...........................................
................
waiting 60 seconds for server to start: not ok
[ error] giving up after 61 secs. If you think that your system
is slow or overloaded try again with a longer timeout value.
by setting the environment variable APACHE_TEST_STARTUP_TIMEOUT
to a high value (e.g. 360) and repeat the last command.
[ error] server failed to start! (t\logs\error_log wasn't created, start the server in the debug mode)
NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0x1'
Stop.
END TEST OUTPUT
Sincerely,
Alexei Agafonov <lucir@ok.ru>
diff -Naur Apache-AuthCookie-3.05/t/real.t Apache-AuthCookie-3.05.changed/t/real.t
--- Apache-AuthCookie-3.05/t/real.t Wed May 28 01:20:02 2003
+++ Apache-AuthCookie-3.05.changed/t/real.t Sun Jul 18 20:08:22 2004
@@ -3,6 +3,9 @@
use warnings FATAL => 'all';
use lib 'lib';
+use File::Spec;
+use File::Basename;
+
use Apache::AuthCookie;
use Apache::Test;
use Apache::TestUtil;
@@ -13,6 +16,9 @@
ok 1; # we loaded.
ok 1; # blank test just to keep check/* numbering matching.
+
+my $thisDir = File::Spec->rel2abs( __FILE__);
+chdir dirname($thisDir) or die "Failed to chdir to $thisDir: $!";
ok test_3();
ok test_4();
diff -Naur Apache-AuthCookie-3.05/t/startup.pl Apache-AuthCookie-3.05.changed/t/startup.pl
--- Apache-AuthCookie-3.05/t/startup.pl Fri Aug 01 20:34:22 2003
+++ Apache-AuthCookie-3.05.changed/t/startup.pl Sun Jul 18 20:08:29 2004
@@ -1,3 +1,10 @@
+use strict;
+use File::Spec;
+use File::Basename;
+BEGIN {
+ my $thisDir = File::Spec->rel2abs( __FILE__);
+ chdir dirname($thisDir) or die "Failed to chdir to $thisDir: $!";
+};
use lib qw(../blib/lib lib);
1;