-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xt/: add perl-critic and perl-tidy tests
Add author tests for code quality to ensure easier and constant maintainability. Signed-off-by: Jens Rehsack <[email protected]>
- Loading branch information
Showing
8 changed files
with
245 additions
and
148 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-b | ||
-bl | ||
-noll | ||
-pt=2 | ||
-bt=2 | ||
-sbt=2 | ||
-vt=0 | ||
-vtc=0 | ||
-dws | ||
-aws | ||
-nsfs | ||
-asc | ||
-bbt=0 | ||
-cab=0 | ||
-l=130 | ||
-ole=unix | ||
--noblanks-before-comments |
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 |
---|---|---|
|
@@ -5,13 +5,7 @@ use 5.008001; | |
|
||
use ExtUtils::MakeMaker; | ||
|
||
my %RUN_DEPS = ( | ||
'Carp' => 0, | ||
'File::Basename' => 0, | ||
'File::Path' => '2.00', | ||
'File::Spec' => 0, | ||
'FindBin' => 0, | ||
); | ||
my %RUN_DEPS = (); | ||
my %CONFIGURE_DEPS = ( | ||
'ExtUtils::MakeMaker' => 0, | ||
); | ||
|
@@ -24,7 +18,7 @@ my %TEST_DEPS = ( | |
WriteMakefile1( | ||
MIN_PERL_VERSION => '5.008001', | ||
META_ADD => { | ||
'meta-spec' => { version => 2 }, | ||
'meta-spec' => {version => 2}, | ||
resources => { | ||
homepage => 'https://metacpan.org/release/Hash-MoreUtils', | ||
repository => { | ||
|
@@ -36,7 +30,7 @@ WriteMakefile1( | |
web => 'http://rt.cpan.org/Public/Dist/Display.html?Name=Hash-MoreUtils', | ||
mailto => '[email protected]', | ||
}, | ||
license => 'http://dev.perl.org/licenses/', | ||
license => 'http://dev.perl.org/licenses/', | ||
}, | ||
prereqs => { | ||
develop => { | ||
|
@@ -49,18 +43,16 @@ WriteMakefile1( | |
'Test::Pod::Coverage' => 0, | ||
'Test::Pod::Spelling::CommonMistakes' => 0, | ||
'Test::Spelling' => 0, | ||
'Test::Perl::Critic' => 0, | ||
'Test::PerlTidy' => 0, | ||
}, | ||
}, | ||
configure => { | ||
requires => {%CONFIGURE_DEPS}, | ||
}, | ||
build => { requires => {%BUILD_DEPS} }, | ||
test => { requires => {%TEST_DEPS} }, | ||
build => {requires => {%BUILD_DEPS}}, | ||
test => {requires => {%TEST_DEPS}}, | ||
runtime => { | ||
recommends => { | ||
'File::HomeDir' => '0.50', | ||
'List::MoreUtils' => '0.22', | ||
}, | ||
requires => { | ||
%RUN_DEPS, | ||
perl => '5.8.1', | ||
|
@@ -72,50 +64,50 @@ WriteMakefile1( | |
VERSION_FROM => 'lib/Hash/MoreUtils.pm', | ||
ABSTRACT_FROM => 'lib/Hash/MoreUtils.pm', | ||
LICENSE => 'perl', | ||
AUTHOR => [ 'Hans Dieter Pearcey <[email protected]>', 'Jens Rehsack <[email protected]>' ], | ||
AUTHOR => ['Hans Dieter Pearcey <[email protected]>', 'Jens Rehsack <[email protected]>'], | ||
CONFIGURE_REQUIRES => \%CONFIGURE_DEPS, | ||
PREREQ_PM => \%RUN_DEPS, | ||
BUILD_REQUIRES => \%BUILD_DEPS, | ||
TEST_REQUIRES => \%TEST_DEPS, | ||
test => { TESTS => 't/*.t xt/*.t' }, | ||
test => {TESTS => 't/*.t xt/*.t'}, | ||
); | ||
|
||
sub WriteMakefile1 | ||
{ # originally written by Alexandr Ciornii, version 0.21. Added by eumm-upgrade. | ||
my %params = @_; | ||
my $eumm_version = $ExtUtils::MakeMaker::VERSION; | ||
$eumm_version = eval $eumm_version; | ||
die "EXTRA_META is deprecated" if ( exists( $params{EXTRA_META} ) ); | ||
die "License not specified" if ( !exists( $params{LICENSE} ) ); | ||
die "EXTRA_META is deprecated" if (exists($params{EXTRA_META})); | ||
die "License not specified" if (!exists($params{LICENSE})); | ||
$params{TEST_REQUIRES} | ||
and $eumm_version < 6.6303 | ||
and $params{BUILD_REQUIRES} = { %{ $params{BUILD_REQUIRES} || {} }, %{ delete $params{TEST_REQUIRES} } }; | ||
and $params{BUILD_REQUIRES} = {%{$params{BUILD_REQUIRES} || {}}, %{delete $params{TEST_REQUIRES}}}; | ||
#EUMM 6.5502 has problems with BUILD_REQUIRES | ||
$params{BUILD_REQUIRES} | ||
and $eumm_version < 6.5503 | ||
and $params{PREREQ_PM} = { %{ $params{PREREQ_PM} || {} }, %{ delete $params{BUILD_REQUIRES} } }; | ||
and $params{PREREQ_PM} = {%{$params{PREREQ_PM} || {}}, %{delete $params{BUILD_REQUIRES}}}; | ||
ref $params{AUTHOR} | ||
and "ARRAY" eq ref $params{AUTHOR} | ||
and $eumm_version < 6.5702 | ||
and $params{AUTHOR} = join( ", ", @{ $params{AUTHOR} } ); | ||
delete $params{CONFIGURE_REQUIRES} if ( $eumm_version < 6.52 ); | ||
delete $params{MIN_PERL_VERSION} if ( $eumm_version < 6.48 ); | ||
delete $params{META_MERGE} if ( $eumm_version < 6.46 ); | ||
delete $params{META_ADD}{prereqs} if ( $eumm_version < 6.58 ); | ||
delete $params{META_ADD}{'meta-spec'} if ( $eumm_version < 6.58 ); | ||
delete $params{META_ADD} if ( $eumm_version < 6.46 ); | ||
delete $params{LICENSE} if ( $eumm_version < 6.31 ); | ||
delete $params{AUTHOR} if ( $] < 5.005 ); | ||
delete $params{ABSTRACT_FROM} if ( $] < 5.005 ); | ||
delete $params{BINARY_LOCATION} if ( $] < 5.005 ); | ||
and $params{AUTHOR} = join(", ", @{$params{AUTHOR}}); | ||
delete $params{CONFIGURE_REQUIRES} if ($eumm_version < 6.52); | ||
delete $params{MIN_PERL_VERSION} if ($eumm_version < 6.48); | ||
delete $params{META_MERGE} if ($eumm_version < 6.46); | ||
delete $params{META_ADD}{prereqs} if ($eumm_version < 6.58); | ||
delete $params{META_ADD}{'meta-spec'} if ($eumm_version < 6.58); | ||
delete $params{META_ADD} if ($eumm_version < 6.46); | ||
delete $params{LICENSE} if ($eumm_version < 6.31); | ||
delete $params{AUTHOR} if ($] < 5.005); | ||
delete $params{ABSTRACT_FROM} if ($] < 5.005); | ||
delete $params{BINARY_LOCATION} if ($] < 5.005); | ||
|
||
# more or less taken from Moose' Makefile.PL | ||
if ( $params{CONFLICTS} ) | ||
if ($params{CONFLICTS}) | ||
{ | ||
my $ok = CheckConflicts(%params); | ||
exit(0) if ( $params{PREREQ_FATAL} and not $ok ); | ||
exit(0) if ($params{PREREQ_FATAL} and not $ok); | ||
my $cpan_smoker = grep { $_ =~ m/(?:CR_SMOKER|CPAN_REPORTER|AUTOMATED_TESTING)/ } keys %ENV; | ||
unless ( $cpan_smoker || $ENV{PERL_MM_USE_DEFAULT} ) | ||
unless ($cpan_smoker || $ENV{PERL_MM_USE_DEFAULT}) | ||
{ | ||
sleep 4 unless ($ok); | ||
} | ||
|
@@ -124,4 +116,3 @@ sub WriteMakefile1 | |
|
||
WriteMakefile(%params); | ||
} | ||
|
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
Oops, something went wrong.