Hi,
this patch ensures that when t/codingstd/perlcritic.t can't find
Test::Perl::Critic, that instead of exiting with a "Can't locate
Test/Perl/Critic.pm in @INC" compile-time error, it reports that it is
skipping the test with the message defined in perlcritic.t.
One can't use C<require> in this case as the C<use> call needs to pass
an argument to the package if Test::Perl::Critic is found.
Comments welcome,
Paul
files affected:
t/codingstd/perlcritic.t
> this patch ensures that when t/codingstd/perlcritic.t can't find
> Test::Perl::Critic, that instead of exiting with a "Can't locate
> Test/Perl/Critic.pm in @INC" compile-time error, it reports that it is
> skipping the test with the message defined in perlcritic.t.
>
> One can't use C<require> in this case as the C<use> call needs to pass
> an argument to the package if Test::Perl::Critic is found.
>
> Comments welcome,
Paul,
A better implementation of that patch would be:
BEGIN {
eval { require Test::Perl::Critic; };
if ($@) {
plan skip_all => 'Test::Perl::Critic not installed';
}
Test::Perl::Critic->import(-verbose => 7);
Chris
Thanks Chris! I didn't know how to maintain the verbose flag any
other way, but now I know. With every patch my perl foo improves...
See attached patch for latest version.
BTW: did you get the perl shebang line patches for Perl::Critic?
Paul