Re: P::C or PPI bug?
Chris Dolan wrote: > On Nov 7, 2006, at 6:15 PM, Christopher H. Laco wrote: > >> I just wanted to get some thoughts on this before I filed a bug report >> with either PPI or Perl::Critic: >> >> I'm going through and testing all of my *.t files for RequireTestLabels. >> I was humming right along when I ran into an oddity. The newest >> Perl::Critic 0.21 + PPI 1.118 complains that the tests don't have >> labels, yet they clearly do. >> >> After some tinkering, I stumbled across the culprits: >> >> This causes a RequireTestLabel failure: >> >>> is_deeply([$storage->primary_columns], [qw/id otherpk/], 'return DBIC >>> primary keys from schema'); >> >> other is_deeply tests pass, like the one before it: >> >>> is($storage->_primary_columns, undef, 'no primary columns defined'); >> >> I looked through RT, and I don't see anything that really points to >> anything on this one in either dist. >> >> Ideas? > > This is fixed in the latest PPI developer release v1.199_xx. The array > constructor stuff should be perfect. The hash constructor parsing still > needs some work to further disambiguate it from anonymous blocks. (like > map, grep, eval, sort, etc) > > It never hit RT because I just fixed it myself instead of reporting. > > Chris I gave the latest PPI + Perl::Critic SVN a shot late last night. That problem is indeed fixed for me, but another on cropped up with UseStrict, even through I am, and it only happens in 2 of 30 files. As soon as I get ouf of my meetings this morning, I'll update on the local box and have another go and post the actual error. -=TheOtherChris signature.asc Description: OpenPGP digital signature
Re: P::C or PPI bug?
On Nov 8, 2006, at 7:35 AM, Christopher H. Laco wrote: I gave the latest PPI + Perl::Critic SVN a shot late last night. That problem is indeed fixed for me, but another on cropped up with UseStrict, even through I am, and it only happens in 2 of 30 files. As soon as I get ouf of my meetings this morning, I'll update on the local box and have another go and post the actual error. I recommend moving this discussion to either the Perl-Critic or PPI mail list (probably the former). http://perlcritic.tigris.org/servlets/ProjectMailingListList https://lists.sourceforge.net/lists/listinfo/parseperl-discuss Chris -- Chris Dolan, Software Developer, Clotho Advanced Media Inc. 608-294-7900, fax 294-7025, 1435 E Main St, Madison WI 53703 vCard: http://www.chrisdolan.net/ChrisDolan.vcf Clotho Advanced Media, Inc. - Creators of MediaLandscape Software (http://www.media-landscape.com/) and partners in the revolutionary Croquet project (http://www.opencroquet.org/)
Re: P::C or PPI bug?
On Nov 7, 2006, at 11:37 PM, Adam Kennedy wrote: I'm not sure you can reliably test that though, not to 100% anyway, given the problem of implicit params. is( foo $bar, $baz, $expected ); which means is( foo($bar, $baz), $expected ); Yes, his specific case is ok, but I think you need to be a bit cunning about how you check... Well, the former is just bad coding style. So if Perl::Critic or PPI misinterprets it that's the coder's fault, not the tool's fault! :-) One of the best lessons in Perl Best Practices: if your code is ambiguous without looking at the core Perl docs (or source code!), then it should be rewritten to be less ambiguous. Chris -- Chris Dolan, Software Developer, Clotho Advanced Media Inc. 608-294-7900, fax 294-7025, 1435 E Main St, Madison WI 53703 vCard: http://www.chrisdolan.net/ChrisDolan.vcf Clotho Advanced Media, Inc. - Creators of MediaLandscape Software (http://www.media-landscape.com/) and partners in the revolutionary Croquet project (http://www.opencroquet.org/)
CPAN::Shell->install() downloads dependencies, but doesn't add them to @INC for tests
Hi perl-qa, I'm trying to download missing Perl test modules automatically during build time of my project, by using: use CPAN; CPAN::Shell->install("Test::Exception"); Test::Exception has dependencies, which the CPAN shell detects correctly: Unsatisfied dependencies detected during [A/AD/ADIE/Test-Exception-0.24.tar.gz] - Test::Builder Sub::Uplevel Test::Builder::Tester The dependencies are downloaded and built, however, when then running the tests for Test::Exception it doesn't include the path to the just downloaded modules: Running make test Prepending /home/florian/projects/egeeII/npm/etics/repository/cpan/build/Test-Simple-0.64/blib/arch /home/florian/projects/egeeII/npm/etics/repository/cpan/build/Test-Simple-0.64/blib/lib to PERL5LIB. PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/callerCan't locate Sub/Uplevel.pm in @INC (@INC contains: /home/florian/projects/egeeII/npm/etics/repository/cpan/build/Test-Exception-0.24/blib/lib /home/florian/projects/egeeII/npm/etics/repository/cpan/build/Test-Exception-0.24/blib/arch /home/florian/projects/egeeII/npm/etics/repository/cpan/build/Test-Simple-0.64/blib/arch /home/florian/projects/egeeII/npm/etics/repository/cpan/build/Test-Simple-0.64/blib/lib /usr/lib/perl5/5.8.8/i686-linux /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i686-linux /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl) How can I tell the CPAN::Shell that it should add the path of the dependent modules to @INC? Cheers, Florian. P.S.: Please note that the script runs as local user, meaning that not the default MyConfig.pm is used, but a custom one. Not sure if that makes any difference... -- / - - - - - - - - - - - - \ Florian Scharinger EPCC University of Edinburgh EGEE-II SA1 NPM Developer
Re: CPAN::Shell->install() downloads dependencies, but doesn't add them to @INC for tests
On Wed, Nov 08, 2006 at 06:13:26PM +, Florian Scharinger wrote: > Hi perl-qa, > > I'm trying to download missing Perl test modules automatically during > build time of my project, by using: > > use CPAN; > CPAN::Shell->install("Test::Exception"); > > Test::Exception has dependencies, which the CPAN shell detects correctly: > > Unsatisfied dependencies detected during > [A/AD/ADIE/Test-Exception-0.24.tar.gz] - > Test::Builder > Sub::Uplevel > Test::Builder::Tester > > The dependencies are downloaded and built, however, when then running > the tests for Test::Exception it doesn't include the path to the just > downloaded modules: > > Running make test > Prepending > /home/florian/projects/egeeII/npm/etics/repository/cpan/build/Test-Simple-0.64/blib/arch > > /home/florian/projects/egeeII/npm/etics/repository/cpan/build/Test-Simple-0.64/blib/lib > > to PERL5LIB. > PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" > "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t > t/callerCan't locate Sub/Uplevel.pm in @INC (@INC contains: > /home/florian/projects/egeeII/npm/etics/repository/cpan/build/Test-Exception-0.24/blib/lib > > /home/florian/projects/egeeII/npm/etics/repository/cpan/build/Test-Exception-0.24/blib/arch > > /home/florian/projects/egeeII/npm/etics/repository/cpan/build/Test-Simple-0.64/blib/arch > > /home/florian/projects/egeeII/npm/etics/repository/cpan/build/Test-Simple-0.64/blib/lib > > /usr/lib/perl5/5.8.8/i686-linux /usr/lib/perl5/5.8.8 > /usr/lib/perl5/site_perl/5.8.8/i686-linux /usr/lib/perl5/site_perl/5.8.8 > /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl) > > How can I tell the CPAN::Shell that it should add the path of the > dependent modules to @INC? > > Cheers, > Florian. > > P.S.: Please note that the script runs as local user, meaning that not > the default MyConfig.pm is used, but a custom one. Not sure if that > makes any difference... > Modules are loaded at compile time, so you probably need to move the CPAN::Shell->install() call to inside a BEGIN block. Steve Peters [EMAIL PROTECTED]
Re: CPAN::Shell->install() downloads dependencies, but doesn't add them to @INC for tests
> On Wed, 08 Nov 2006 18:13:26 +, Florian Scharinger <[EMAIL > PROTECTED]> said: > Hi perl-qa, > I'm trying to download missing Perl test modules automatically during > build time of my project, by using: > use CPAN; > CPAN::Shell->install("Test::Exception"); > Test::Exception has dependencies, which the CPAN shell detects correctly: > Unsatisfied dependencies detected during > [A/AD/ADIE/Test-Exception-0.24.tar.gz] - > Test::Builder > Sub::Uplevel > Test::Builder::Tester > The dependencies are downloaded and built, however, when then running > the tests for Test::Exception it doesn't include the path to the just > downloaded modules: Should not matter at all. I just tried the example with my current sources and it worked for me, so either the problem has been fixed in the meantime or you have some other problem that I cannot recognize from the bugreport. What is particularly interesting is where is Sub::Uplevel when this test fails? It should be installed and thus in @INC because it was recognized as prereq. Note that 1.88_59 is in my CPAN directory in case you're interested. -- andreas