add release tests
(fix minor stuff found by release tets)
This commit is contained in:
9
xt/release/build_environment.t
Normal file
9
xt/release/build_environment.t
Normal file
@@ -0,0 +1,9 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 1;
|
||||
|
||||
SKIP: {
|
||||
eval q{ use Dist::Zilla::PluginBundle::Author::Plicease };
|
||||
skip '[@Plicease] is not installed', 1 if $@;
|
||||
ok $Dist::Zilla::PluginBundle::Author::Plicease::VERSION >= 0.7, '[@Plicease] >= 0.7';
|
||||
}
|
||||
27
xt/release/changes.t
Normal file
27
xt/release/changes.t
Normal file
@@ -0,0 +1,27 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More;
|
||||
BEGIN {
|
||||
plan skip_all => 'test requires Test::CPAN::Changes'
|
||||
unless eval q{ use Test::CPAN::Changes; 1 };
|
||||
};
|
||||
use Test::CPAN::Changes;
|
||||
use FindBin;
|
||||
use File::Spec;
|
||||
|
||||
chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir));
|
||||
|
||||
do {
|
||||
my $old = \&Test::Builder::carp;
|
||||
my $new = sub {
|
||||
my($self, @messages) = @_;
|
||||
return if $messages[0] =~ /^Date ".*" is not in the recommend format/;
|
||||
$old->($self, @messages);
|
||||
};
|
||||
no warnings 'redefine';
|
||||
*Test::Builder::carp = $new;
|
||||
};
|
||||
|
||||
changes_file_ok;
|
||||
|
||||
done_testing;
|
||||
14
xt/release/eol.t
Normal file
14
xt/release/eol.t
Normal file
@@ -0,0 +1,14 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More;
|
||||
BEGIN {
|
||||
plan skip_all => 'test requires Test::EOL'
|
||||
unless eval q{ use Test::EOL; 1 };
|
||||
};
|
||||
use Test::EOL;
|
||||
use FindBin;
|
||||
use File::Spec;
|
||||
|
||||
chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir));
|
||||
|
||||
all_perl_files_ok(grep { -e $_ } qw( bin lib t Makefile.PL ));
|
||||
18
xt/release/fixme.t
Normal file
18
xt/release/fixme.t
Normal file
@@ -0,0 +1,18 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More;
|
||||
BEGIN {
|
||||
plan skip_all => 'test requires Test::Fixme'
|
||||
unless eval q{ use Test::Fixme; 1 };
|
||||
};
|
||||
use Test::Fixme 0.07;
|
||||
use FindBin;
|
||||
use File::Spec;
|
||||
|
||||
chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir));
|
||||
|
||||
run_tests(
|
||||
match => qr/FIXME/,
|
||||
where => [ grep { -e $_ } qw( bin lib t Makefile.PL )],
|
||||
);
|
||||
|
||||
15
xt/release/no_tabs.t
Normal file
15
xt/release/no_tabs.t
Normal file
@@ -0,0 +1,15 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More;
|
||||
BEGIN {
|
||||
plan skip_all => 'test requires Test::NoTabs'
|
||||
unless eval q{ use Test::NoTabs; 1 };
|
||||
};
|
||||
use Test::NoTabs;
|
||||
use FindBin;
|
||||
use File::Spec;
|
||||
|
||||
chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir));
|
||||
|
||||
all_perl_files_ok( grep { -e $_ } qw( bin lib t Makefile.PL ));
|
||||
|
||||
15
xt/release/pod.t
Normal file
15
xt/release/pod.t
Normal file
@@ -0,0 +1,15 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More;
|
||||
BEGIN {
|
||||
plan skip_all => 'test requires Test::Pod'
|
||||
unless eval q{ use Test::Pod; 1 };
|
||||
};
|
||||
use Test::Pod;
|
||||
use FindBin;
|
||||
use File::Spec;
|
||||
|
||||
chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir));
|
||||
|
||||
all_pod_files_ok( grep { -e $_ } qw( bin lib ));
|
||||
|
||||
67
xt/release/pod_coverage.t
Normal file
67
xt/release/pod_coverage.t
Normal file
@@ -0,0 +1,67 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More;
|
||||
BEGIN {
|
||||
plan skip_all => 'test requires Test::Pod::Coverage'
|
||||
unless eval q{ use Test::Pod::Coverage; 1 };
|
||||
plan skip_all => 'test requires YAML'
|
||||
unless eval q{ use YAML; 1; };
|
||||
};
|
||||
use Test::Pod::Coverage;
|
||||
use YAML qw( LoadFile );
|
||||
use FindBin;
|
||||
use File::Spec;
|
||||
|
||||
my $config_filename = File::Spec->catfile(
|
||||
$FindBin::Bin, 'release.yml'
|
||||
);
|
||||
|
||||
my $config;
|
||||
$config = LoadFile($config_filename)
|
||||
if -r $config_filename;
|
||||
|
||||
chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir));
|
||||
|
||||
my @private_classes;
|
||||
my %private_methods;
|
||||
|
||||
foreach my $private (@{ $config->{pod_coverage}->{private} })
|
||||
{
|
||||
my($class,$method) = split /#/, $private;
|
||||
if(defined $class && $class ne '')
|
||||
{
|
||||
my $regex = eval 'qr{^' . $class . '$}';
|
||||
if(defined $method && $method ne '')
|
||||
{
|
||||
push @private_classes, { regex => $regex, method => $method };
|
||||
}
|
||||
else
|
||||
{
|
||||
push @private_classes, { regex => $regex, all => 1 };
|
||||
}
|
||||
}
|
||||
elsif(defined $method && $method ne '')
|
||||
{
|
||||
$private_methods{$_} = 1 for split /,/, $method;
|
||||
}
|
||||
}
|
||||
|
||||
my @classes = all_modules;
|
||||
|
||||
plan tests => scalar @classes;
|
||||
|
||||
foreach my $class (@classes)
|
||||
{
|
||||
SKIP: {
|
||||
my($is_private_class) = map { 1 } grep { $class =~ $_->{regex} && $_->{all} } @private_classes;
|
||||
skip "private class: $class", 1 if $is_private_class;
|
||||
|
||||
my %methods = map {; $_ => 1 } map { split /,/, $_->{method} } grep { $class =~ $_->{regex} } @private_classes;
|
||||
$methods{$_} = 1 for keys %private_methods;
|
||||
|
||||
my $also_private = eval 'qr{^' . join('|', keys %methods ) . '$}';
|
||||
|
||||
pod_coverage_ok $class, { also_private => [$also_private] };
|
||||
};
|
||||
}
|
||||
|
||||
15
xt/release/pod_spelling_common.t
Normal file
15
xt/release/pod_spelling_common.t
Normal file
@@ -0,0 +1,15 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More;
|
||||
BEGIN {
|
||||
plan skip_all => 'test requires Test::Pod::Spelling::CommonMistakes'
|
||||
unless eval q{ use Test::Pod::Spelling::CommonMistakes; 1 };
|
||||
};
|
||||
use Test::Pod::Spelling::CommonMistakes;
|
||||
use FindBin;
|
||||
use File::Spec;
|
||||
|
||||
chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir));
|
||||
|
||||
# FIXME test files in bin too.
|
||||
all_pod_files_ok;
|
||||
39
xt/release/pod_spelling_system.t
Normal file
39
xt/release/pod_spelling_system.t
Normal file
@@ -0,0 +1,39 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More;
|
||||
BEGIN {
|
||||
plan skip_all => 'test requires Test::Spelling'
|
||||
unless eval q{ use Test::Spelling; 1 };
|
||||
plan skip_all => 'test requires YAML'
|
||||
unless eval q{ use YAML; 1; };
|
||||
};
|
||||
use Test::Spelling;
|
||||
use YAML qw( LoadFile );
|
||||
use FindBin;
|
||||
use File::Spec;
|
||||
|
||||
my $config_filename = File::Spec->catfile(
|
||||
$FindBin::Bin, 'release.yml'
|
||||
);
|
||||
|
||||
my $config;
|
||||
$config = LoadFile($config_filename)
|
||||
if -r $config_filename;
|
||||
|
||||
chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir));
|
||||
|
||||
add_stopwords(@{ $config->{pod_spelling_system}->{stopwords} });
|
||||
add_stopwords(<DATA>);
|
||||
all_pod_files_spelling_ok;
|
||||
|
||||
__DATA__
|
||||
Plicease
|
||||
stdout
|
||||
stdin
|
||||
subref
|
||||
loopback
|
||||
username
|
||||
os
|
||||
Ollis
|
||||
Mojolicious
|
||||
plicease
|
||||
34
xt/release/release.yml
Normal file
34
xt/release/release.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
pod_spelling_system:
|
||||
# list of words that are spelled correctly
|
||||
# (regardless of what spell check thinks)
|
||||
stopwords:
|
||||
- Bethke
|
||||
- Cosimo
|
||||
- Crowther
|
||||
- Holm
|
||||
- Htbaa
|
||||
- Kitover
|
||||
- Magnus
|
||||
- Mojo
|
||||
- Ramberg
|
||||
- Streppone
|
||||
- Vuets
|
||||
- dir
|
||||
- giftnuss
|
||||
- mojo
|
||||
- namespace
|
||||
- renderer
|
||||
- spleenjack
|
||||
- vti
|
||||
- app's
|
||||
- renderer's
|
||||
- Toolkit's
|
||||
- Fayland
|
||||
|
||||
pod_coverage:
|
||||
# format is "Class#method" or "Class", regex allowed
|
||||
# for either Class or method.
|
||||
private:
|
||||
- Mojolicious::Plugin::TtRenderer#register
|
||||
- Mojolicious::Plugin::TtRenderer::Engine#tt
|
||||
15
xt/release/strict.t
Normal file
15
xt/release/strict.t
Normal file
@@ -0,0 +1,15 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More;
|
||||
BEGIN {
|
||||
plan skip_all => 'test requires Test::Strict'
|
||||
unless eval q{ use Test::Strict; 1 };
|
||||
};
|
||||
use Test::Strict;
|
||||
use FindBin;
|
||||
use File::Spec;
|
||||
|
||||
chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir));
|
||||
|
||||
all_perl_files_ok( grep { -e $_ } qw( bin lib t Makefile.PL ));
|
||||
|
||||
Reference in New Issue
Block a user