Re: Apache::Test v1.25 error - Can't use string (Test::Builder)

2005-07-18 Thread Matt Hicks
Geoffrey Young wrote:
 well, it's not exactly a bug - it looks like Test::Builder changed
 reset() from a class method to an object method since that code was written.
 
 I guess I'll need to fix that :)

fixed in svn.  if you have a moment to test, that would be great.

Thanks!  Here's the report for Apache-Test:

C:\code\httpd-test\perl-framework\Apache-Testperl makefile.pl
[   info] generating script t/TEST
[   info] generating script ./t/cgi-bin/cookies.pl
[   info] generating script t/TEST
Writing Makefile for Apache::TestItSelf
Too late to run INIT block at C:/Perl/site/lib/Devel/Cover.pm line 153.
Too late to run CHECK block at C:/Perl/site/lib/Devel/Cover.pm line 155.
Writing Makefile for Apache::Test
Checking for File::Spec...ok
Checking for Cwd...ok

C:\code\httpd-test\perl-framework\Apache-Testnmake

Microsoft (R) Program Maintenance Utility Version 7.00.9955
Copyright (C) Microsoft Corporation.  All rights reserved.


C:\code\httpd-test\perl-framework\Apache-Testnmake test

Microsoft (R) Program Maintenance Utility Version 7.00.9955
Copyright (C) Microsoft Corporation.  All rights reserved.

C:\Perl\bin\perl.exe -Iblib\arch -Iblib\lib  t/TEST  -clean
  C:\Perl\bin\perl.exe -Iblib\arch -Iblib\lib  t/TEST  -bugreport -verbo
se=0
c:/apache2/bin/apache.exe  -d C:/code/httpd-test/perl-framework/Apache-Test/t -f
 C:/code/httpd-test/perl-framework/Apache-Test/t/conf/httpd.conf -D APACHE2 -D P
ERL_USEITHREADS
using Apache/2.0.54 (winnt MPM)

waiting 60 seconds for server to start: .
waiting 60 seconds for server to start: ok (waited 0 secs)
server localhost:8529 started
[   info] adding source lib C:\code\httpd-test\perl-framework\Apache-Test\lib to
 @INC
t\bad_coding.ok0.652s
t\cookiesok1.074s
t\more\01testpm..ok1.315s
t\more\02testmorerequest has failed (the response code was: 500)
see t/logs/error_log for more details
t\more\02testmoredubious
Test returned status 9 (wstat 2304, 0x900)
t\more\03testpm..ok0.648s
t\more\04testmorerequest has failed (the response code was: 500)
see t/logs/error_log for more details
t\more\04testmoredubious
Test returned status 9 (wstat 2304, 0x900)
t\ping...ok0.627s
t\redirect...ok 2/6# Failed test 4 in t\redirect.t at line 17
t\redirect...NOK 4# Failed test 6 in t\redirect.t at line 23
t\redirect...FAILED tests 4, 6
Failed 2/6 tests, 66.67% okay
t\request# Failed test 1 in t\request.t at line 11
t\requestok 4/9# Failed test 5 in t\request.t at line 16
t\requestok 7/9# Failed test 8 in t\request.t at line 20
t\requestNOK 8# Failed test 9 in t\request.t at line 22
t\requestFAILED tests 1, 5, 8-9
Failed 4/9 tests, 55.56% okay
Failed Test Stat Wstat Total Fail  Failed  List of Failed
---
t\more\02testmore.t9  2304??   ??   %  ??
t\more\04testmore.t9  2304??   ??   %  ??
t\redirect.t   62  33.33%  4 6
t\request.t94  44.44%  1 5 8-9
Failed 4/9 test scripts, 55.56% okay. 6/23 subtests failed, 73.91% okay.
[warning] server localhost:8529 shutdown
[  error] error running tests (please examine t\logs\error_log)
+-+
| To report problems please refer to the SUPPORT file |
+-+
NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0x1'
Stop.


The only interesting line in t/logs/error_log is: 
[Mon Jul 18 14:32:40 2005] [error] [client 127.0.0.1] failed to
resolve handler `TestMore::testmorepm': Can't dup STDERR:  Bad file
descriptor at C:/Perl/lib/Test/Builder.pm line 1218.\nCompilation
failed in require at C:/Perl/lib/Test/More.pm line 6.\nBEGIN
failed--compilation aborted at C:/Perl/lib/Test/More.pm line
6.\nCompilation failed in require at
C:\\code\\httpd-test\\perl-framework\\Apache-Test\\t\\response/TestMore/testmorepm.pm
line 6.\nBEGIN failed--compilation aborted at
C:\\code\\httpd-test\\perl-framework\\Apache-Test\\t\\response/TestMore/testmorepm.pm
line 6.\nCompilation failed in require at (eval 25) line 3.\n


My environment info:

C:\code\httpd-test\perl-frameworkc:\apache2\bin\apache -V
Server version: Apache/2.0.54
Server built:   Apr 16 2005 14:25:31
Server's Module Magic Number: 20020903:9
Architecture:   32-bit
Server compiled with
 -D APACHE_MPM_DIR=server/mpm/winnt
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT=/apache
 -D SUEXEC_BIN=/apache/bin/suexec
 -D DEFAULT_SCOREBOARD=logs/apache_runtime_status
 -D DEFAULT_ERRORLOG=logs/error.log
 -D AP_TYPES_CONFIG_FILE=conf/mime.types
 -D SERVER_CONFIG_FILE=conf/httpd.conf


...perl -V
Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
 ...
Characteristics of this 

Apache::Test v1.25 error - Can't use string (Test::Builder) as a HASH ref

2005-06-28 Thread Matt Hicks
Sanity check!  Using Apache::Test 1.25, Test::Simple 0.60, mod_perl 2.0,
Apache 2.0.54.  I have the following in t/response/TestHandler/01compile.pm

package TestHandler::01compile;

use strict;
use warnings FATAL = qw(all);
use Apache::Test qw(-withtestmore);
use Apache2::Const -compile = qw(OK);

sub handler {
  my $r = shift;
  plan $r, tests = 1;
  use_ok('My::ModPerlHandler');
  return Apache2::Const::OK;
}

1;

Can't use string (Test::Builder) as a HASH ref while strict refs
in use at C:/Perl/lib/Test/Builder.pm line 179.

Looking at Test::Builder 0.30, one finds line 179 is the reset method.

sub reset {
my ($self) = @_;

# We leave this a global because it has to be localized and localizing
# hash keys is just asking for pain.  Also, it was documented.
$Level = 1;

$self-{Test_Died}= 0;  # line 179
...
 
Digging through Apache::Test, Test::Builder-reset is called only once,
in test_pm_refresh.

sub test_pm_refresh {
if (@testmore) {
Test::Builder-reset;
...

Now, this looks like a bug.  The T::B-reset method expects an object,
Apache::Test calls it as a class method.  I allow for the possibility that
I've completely misunderstood everything--or even just some things.

OTOH, if I avoid Test::More in A::T like so, the test succeeds.

use Apache::Test;
...
ok( sub { require My::ModPerlHandler }, 1 );

Not that that's a smart way to test it, just what came to mind.


-Matt