httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Wheeler <da...@wheeler.net>
Subject Re: libapreq-1.2 release candidate
Date Sat, 03 May 2003 03:36:29 GMT
On Friday, May 2, 2003, at 05:56  PM, Stas Bekman wrote:

> Try this patch. It now forwards the import call.
>
> plus you have to do:
>
> find t/ | xargs perl -pi -e 's|use Apache::Test;|use 
> Apache::TestLoad;|'

When I do that in the Apache::Test sources, it seems that the import 
still doesn't work:

/usr/local/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -clean
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -clean
APACHE_USER= APACHE_GROUP= APACHE_PORT= APACHE= APXS= \
/usr/local/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -verbose=0
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -verbose=0
/usr/local/apache/bin/httpd -X -d 
/Users/david/dev/perl/modperl-2.0/Apache-Test/t -f 
/Users/david/dev/perl/modperl-2.0/Apache-Test/t/conf/httpd.conf 
-DAPACHE1
using Apache/1.3.27

waiting for server to start: ..
waiting for server to start: ok (waited 1 secs)
server localhost:8529 started
ping.......syntax error at ping.t line 6, near "plan tests"
Execution of ping.t aborted due to compilation errors.
ping.......dubious
         Test returned status 255 (wstat 65280, 0xff00)
request....Bareword found where operator expected at request.t line 11, 
near "ok GET_OK"
         (Do you need to predeclare ok?)
Bareword found where operator expected at request.t line 12, near "ok 
GET_RC"
         (Do you need to predeclare ok?)
Bareword found where operator expected at request.t line 13, near "ok 
GET_STR"
         (Do you need to predeclare ok?)
Bareword found where operator expected at request.t line 14, near "ok 
GET_BODY"
         (Do you need to predeclare ok?)
Bareword found where operator expected at request.t line 16, near "ok 
HEAD_OK"
         (Do you need to predeclare ok?)
Bareword found where operator expected at request.t line 17, near "ok 
HEAD_RC"
         (Do you need to predeclare ok?)
Bareword found where operator expected at request.t line 18, near "ok 
HEAD_STR"
         (Do you need to predeclare ok?)
Bareword found where operator expected at request.t line 20, near "ok 
GET_OK"
         (Do you need to predeclare ok?)
Bareword found where operator expected at request.t line 22, near "ok 
GET_OK"
         (Do you need to predeclare ok?)
syntax error at request.t line 7, near "plan tests"
syntax error at request.t line 11, near "ok GET_OK   "
Execution of request.t aborted due to compilation errors.
request....dubious
         Test returned status 255 (wstat 65280, 0xff00)
*** server localhost:8529 shutdown
!!! error running tests (please examine t/logs/error_log)
make: *** [run_tests] Error 1
mercury%

I imagine that this is because Apache::Test::import thinks that 
Apache::TestLoad is the calling package and exports into 
Apache::TestLoad instead of the package loading Apache::TestLoad. 
Hrm....

/me experiments for a while...

Okay, the only thing I found that works is this (in TestLoad.pm):

sub import {
     my $caller = caller;
     eval "package $caller; use Apache::Test;";
}

This ensures that Apache::Test->import is called from the calling 
package. I tried using a code ref, but it didn't work:

*import = \&Apache::Test::import;

sub import {
     my $c = Apache::Test->can('import');
     goto $c;
}

Neither of these worked. :-( But the string eval works fine.

After that, I switched over to the libapreq sources fixed the test 
scripts:

> find t/ | xargs perl -pi -e 's|use Apache::Test;|use 
> Apache::TestLoad;|'

And all tests passed.

HTH,

David

-- 
David Wheeler                                     AIM: dwTheory
david@kineticode.com                              ICQ: 15726394
                                                Yahoo!: dew7e
                                                Jabber: Theory@jabber.org
Kineticode. Setting knowledge in motion.[sm]


Mime
View raw message