You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@perl.apache.org by "Christopher H. Laco" <cl...@chrislaco.com> on 2005/10/22 02:13:13 UTC

Apache::TestMM->test dies after upgrade to 1.27

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

After upgrading Apache-Test to 1.27, my Makefile.PL dies with this error:

> Can't use string ("Apache::TestMM") as a HASH ref while "strict refs" in use at /usr/local/lib/perl/5.8.7/Apache/TestMM.pm line 56.

It's not the most standard MAkefile in the world, but here's the MY::test:


> package MY;
> sub test {
>     my $self = shift;
> 
>     eval 'use Apache::Test 1.16';
>     if (!$@) {
>         require Apache::TestMM;
>         Apache::TestMM->import(qw(test clean));
> 
>         my @defines;
>         eval 'use Apache::Template';
>         if (!$@) {
>             push @defines, 'TT2';
>         };
> 
>         ## for whatever reason, use AxKit causes issues
>         ## use-ing A::A::Exception doesn't
>         eval 'use Apache::AxKit::Exception';
>         if (!$@) {
>             push @defines, 'AXKIT';
>         };
> 
>         push(@ARGV, '-defines', join(' ', @defines)) if scalar @defines;
>         Apache::TestMM::filter_args();
>         Apache::TestMM::generate_script('t/TEST');
>         Apache::TestMM::generate_script('t/SMOKE');
>         my $at = Apache::TestMM->test;
BOOM!
>         my $tests = $self->{'test'} ? $self->{'test'}->{'TESTS'} : '';
>         if ($tests && Apache::Test->VERSION <= 1.26) {
>             $at =~ s/TEST_FILES\s+=/TEST_FILES = $tests\n/;
>         };
> 
>         return $at;
>     } else {
>         return $self->SUPER::test;
>     };
> };
> 
> 1;

Anyone have any ideas?
The full Makefile.PL can be sound here:
http://search.cpan.org/src/CLACO/Handel-0.26/Makefile.PL

- -=Chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDWYQY+66dLHM50ssRArS0AKCbQq2cd/+UhaekPX2rGlrciOOvJQCfXfdZ
BHXYnCeJxIFcoAklqY5Sq2Q=
=IyNS
-----END PGP SIGNATURE-----

Re: Apache::TestMM->test dies after upgrade to 1.27

Posted by "Christopher H. Laco" <cl...@chrislaco.com>.
Geoffrey Young wrote:
> 
> Christopher H. Laco wrote:
>> Geoffrey Young wrote:
>>
>>>> Borked by my own patch. Serves me right. :-)
>>>> I shouldn't have assume $self->{'test'} was a hashref..
>>>>
>>>> Now I guess the other quesiton is what it is now..
>>> blarg, I was just bitten by this.  please try this patch and make sure that
>>> whatever you were trying to fix still works.
>>>
>>> --Geoff
>>
>> Waaaay too late. :-) I've since just ditched my MY::test, and made 1.27
>> a requirement. Since 1.27 honored the test => TESTS portion, that's all
>> I was using MY::test for < 1.27.
> 
> ok, but that doesn't solve the issue you originally reported:
> 
> ">Can't use string ("Apache::TestMM") as a HASH ref while "strict refs" in
> use at /usr/local/lib/perl/5.8.7/Apache/TestMM.pm line 56."

Well, it did in a way. I only got that error under MY::test calling
$self->{tests}. Since 1.27 solved the issue of getting test=>TESTS into
make test, I no longer needed my MY::test section. The problem just sort
of went away for me at that point.

> 
> which my patch fixes.  so I'll just apply it.
> 
> --Geoff
> 
> 


Re: Apache::TestMM->test dies after upgrade to 1.27

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Christopher H. Laco wrote:
> Geoffrey Young wrote:
> 
>>>Borked by my own patch. Serves me right. :-)
>>>I shouldn't have assume $self->{'test'} was a hashref..
>>>
>>>Now I guess the other quesiton is what it is now..
>>
>>blarg, I was just bitten by this.  please try this patch and make sure that
>>whatever you were trying to fix still works.
>>
>>--Geoff
> 
> 
> Waaaay too late. :-) I've since just ditched my MY::test, and made 1.27
> a requirement. Since 1.27 honored the test => TESTS portion, that's all
> I was using MY::test for < 1.27.

ok, but that doesn't solve the issue you originally reported:

">Can't use string ("Apache::TestMM") as a HASH ref while "strict refs" in
use at /usr/local/lib/perl/5.8.7/Apache/TestMM.pm line 56."

which my patch fixes.  so I'll just apply it.

--Geoff

Re: Apache::TestMM->test dies after upgrade to 1.27

Posted by "Christopher H. Laco" <cl...@chrislaco.com>.
Geoffrey Young wrote:
>> Borked by my own patch. Serves me right. :-)
>> I shouldn't have assume $self->{'test'} was a hashref..
>>
>> Now I guess the other quesiton is what it is now..
> 
> blarg, I was just bitten by this.  please try this patch and make sure that
> whatever you were trying to fix still works.
> 
> --Geoff

Waaaay too late. :-) I've since just ditched my MY::test, and made 1.27
a requirement. Since 1.27 honored the test => TESTS portion, that's all
I was using MY::test for < 1.27.


-=Chris

Re: Apache::TestMM->test dies after upgrade to 1.27

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> Borked by my own patch. Serves me right. :-)
> I shouldn't have assume $self->{'test'} was a hashref..
> 
> Now I guess the other quesiton is what it is now..

blarg, I was just bitten by this.  please try this patch and make sure that
whatever you were trying to fix still works.

--Geoff

Re: Apache::TestMM->test dies after upgrade to 1.27

Posted by "Christopher H. Laco" <cl...@chrislaco.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Christopher H. Laco wrote:
> Christopher H. Laco wrote:
> 
>>>After upgrading Apache-Test to 1.27, my Makefile.PL dies with this error:
>>>
>>>
>>>
>>>>>Can't use string ("Apache::TestMM") as a HASH ref while "strict refs" in use at /usr/local/lib/perl/5.8.7/Apache/TestMM.pm line 56.
>>>
> 
> Damnit...like 56:
> 
> 
>>>    my $tests = 'TEST_FILES = ' . (exists $self->{'test'} ? $self->{'test'}->{'TESTS'} : '') . "\n";
> 
> 
> Borked by my own patch. Serves me right. :-)
> I shouldn't have assume $self->{'test'} was a hashref..
> 
> Now I guess the other quesiton is what it is now..
> 
> -=Chris

Actually, somethings not quite right...

My makefile.PL  has this:

    test  => { TESTS => join ' ', (glob("t/*.t"))}

So, how is it that $self in TestMM->test isn't a blessed hash like it
was in 1.26?

- -=Chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDWYv3+66dLHM50ssRAo0jAJ9qZZkniFH96kSF6l6vkLh0ksql7wCfSFqj
VROrjA0Aol8g/5KcmPr9Qho=
=Bg3w
-----END PGP SIGNATURE-----

Re: Apache::TestMM->test dies after upgrade to 1.27

Posted by "Christopher H. Laco" <cl...@chrislaco.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Christopher H. Laco wrote:
> After upgrading Apache-Test to 1.27, my Makefile.PL dies with this error:
> 
> 
>>>Can't use string ("Apache::TestMM") as a HASH ref while "strict refs" in use at /usr/local/lib/perl/5.8.7/Apache/TestMM.pm line 56.
> 

Damnit...like 56:

>     my $tests = 'TEST_FILES = ' . (exists $self->{'test'} ? $self->{'test'}->{'TESTS'} : '') . "\n";

Borked by my own patch. Serves me right. :-)
I shouldn't have assume $self->{'test'} was a hashref..

Now I guess the other quesiton is what it is now..

- -=Chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDWYYL+66dLHM50ssRAiOwAKCN2tgKCuouLrg7NvL4/eGu5jbW2ACgn/jU
ItUGJ58S5a+9nBxMAFu0trY=
=aMar
-----END PGP SIGNATURE-----