Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add some author tests (Pod, Perl::Critic, etc)
- Loading branch information
Showing
9 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| use strict; | ||
| use warnings; | ||
| use File::Spec; | ||
| use Test::More; | ||
| use English qw(-no_match_vars); | ||
|
|
||
| eval { require Test::Perl::Critic; }; | ||
|
|
||
| if ( $EVAL_ERROR ) { | ||
| my $msg = 'Test::Perl::Critic required to criticise code'; | ||
| plan( skip_all => $msg ); | ||
| } | ||
| elsif ($Perl::Critic::VERSION lt 1.098) { | ||
| my $msg = 'Perl::Critic >= 1.098 required to criticise code'; | ||
| plan( skip_all => $msg ); | ||
| } | ||
|
|
||
| my $rcfile = File::Spec->catfile( 'xt', 'perlcriticrc' ); | ||
| Test::Perl::Critic->import( -profile => $rcfile ); | ||
| all_critic_ok(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| use strict; | ||
| use warnings; | ||
| use File::Spec; | ||
| use Test::More; | ||
| use English qw(-no_match_vars); | ||
|
|
||
| eval { require Test::Perl::Critic; }; | ||
|
|
||
| if ( $EVAL_ERROR ) { | ||
| my $msg = 'Test::Perl::Critic required to criticise code'; | ||
| plan( skip_all => $msg ); | ||
| } | ||
| elsif ($Perl::Critic::VERSION lt 1.098) { | ||
| my $msg = 'Perl::Critic >= 1.098 required to criticise code'; | ||
| plan( skip_all => $msg ); | ||
| } | ||
|
|
||
| my $rcfile = File::Spec->catfile( 'xt', 'perlcriticrc_tests' ); | ||
| Test::Perl::Critic->import( -profile => $rcfile ); | ||
| all_critic_ok(glob 't/0*'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # level 3 is a nice compromise | ||
| severity = 3 | ||
| verbose = 3 | ||
|
|
||
| # these policies are either too anal, demand additional dependencies, | ||
| # or inhibit backwards-compatability | ||
| [-RegularExpressions::RequireExtendedFormatting] | ||
|
|
||
| [-ValuesAndExpressions::ProhibitConstantPragma] | ||
|
|
||
| [-Variables::ProhibitPackageVars] | ||
| [-Variables::RequireLocalizedPunctuationVars] | ||
|
|
||
| [-BuiltinFunctions::ProhibitStringyEval] | ||
|
|
||
| [-Subroutines::ProhibitBuiltinHomonyms] | ||
| [-Subroutines::RequireArgUnpacking] | ||
|
|
||
| [-ErrorHandling::RequireCarping] | ||
| [-ErrorHandling::RequireCheckingReturnValueOfEval] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # level 3 is a nice compromise | ||
| severity = 3 | ||
| verbose = 3 | ||
|
|
||
| # these policies are either too anal, demand additional dependencies, | ||
| # or inhibit backwards-compatability | ||
| [-RegularExpressions::RequireExtendedFormatting] | ||
|
|
||
| [-ValuesAndExpressions::ProhibitConstantPragma] | ||
|
|
||
| [-Variables::ProhibitPackageVars] | ||
| [-Variables::RequireLocalizedPunctuationVars] | ||
|
|
||
| [-BuiltinFunctions::ProhibitStringyEval] | ||
|
|
||
| [-Subroutines::ProhibitBuiltinHomonyms] | ||
| [-Subroutines::RequireArgUnpacking] | ||
|
|
||
| [-ErrorHandling::RequireCarping] | ||
| [-ErrorHandling::RequireCheckingReturnValueOfEval] | ||
|
|
||
| # more policies we don't care about in tests | ||
| [-InputOutput::RequireBriefOpen] | ||
| [-Modules::RequireEndWithOne] | ||
| [-Modules::RequireExplicitPackage] | ||
| [-Modules::RequireFilenameMatchesPackage] | ||
| [-Subroutines::RequireFinalReturn] | ||
| [-InputOutput::ProhibitBacktickOperators] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| use Test::More; | ||
| eval "use Test::Pod 1.00"; | ||
| plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; | ||
|
|
||
| # we need to specify lib/ and script/ manually so it won't find the | ||
| # bundled documentation in blib/ | ||
| all_pod_files_ok(all_pod_files(qw(lib script))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| use Test::More; | ||
| eval "use Test::Pod::Coverage 1.00"; | ||
| plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@; | ||
|
|
||
| my $opts = { also_private => [ qr/^[SU]_/, qr/^PCI_/, qr/^(sl_|plugin_)/, qr/^(commasep|noargs|oneandtwoopt|onlyonearg|onlytwoargs|privandnotice|sl|spacesep|oneortwo|oneoptarg)$/,], }; | ||
|
|
||
| my @modules = all_modules(); | ||
|
|
||
| plan tests => scalar @modules; | ||
|
|
||
| pod_coverage_ok( $_, $opts ) for @modules; |