summaryrefslogtreecommitdiff
path: root/xt/release
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-07-21 13:23:57 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-07-21 13:23:57 +0000
commita276db189a656a4cc5881a2ebc4cad3113685030 (patch)
tree27aeb24e5ddbd94b313aa661a8de133ff9c751f2 /xt/release
downloadFile-Which-tarball-master.tar.gz
Diffstat (limited to 'xt/release')
-rw-r--r--xt/release/eol.t14
-rw-r--r--xt/release/fixme.t19
-rw-r--r--xt/release/no_tabs.t15
-rw-r--r--xt/release/pod.t15
-rw-r--r--xt/release/pod_coverage.t72
-rw-r--r--xt/release/pod_spelling_common.t27
-rw-r--r--xt/release/pod_spelling_system.t101
-rw-r--r--xt/release/release.yml22
-rw-r--r--xt/release/strict.t15
-rw-r--r--xt/release/version.t44
10 files changed, 344 insertions, 0 deletions
diff --git a/xt/release/eol.t b/xt/release/eol.t
new file mode 100644
index 0000000..3f2e816
--- /dev/null
+++ b/xt/release/eol.t
@@ -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 ));
diff --git a/xt/release/fixme.t b/xt/release/fixme.t
new file mode 100644
index 0000000..9dac4c6
--- /dev/null
+++ b/xt/release/fixme.t
@@ -0,0 +1,19 @@
+use strict;
+use warnings;
+use Test::More;
+BEGIN {
+ plan skip_all => 'test requires Test::Fixme'
+ unless eval q{ use Test::Fixme 0.14; 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 )],
+ warn => 1,
+);
+
diff --git a/xt/release/no_tabs.t b/xt/release/no_tabs.t
new file mode 100644
index 0000000..0a6d2b6
--- /dev/null
+++ b/xt/release/no_tabs.t
@@ -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 ));
+
diff --git a/xt/release/pod.t b/xt/release/pod.t
new file mode 100644
index 0000000..2603675
--- /dev/null
+++ b/xt/release/pod.t
@@ -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 ));
+
diff --git a/xt/release/pod_coverage.t b/xt/release/pod_coverage.t
new file mode 100644
index 0000000..49eff90
--- /dev/null
+++ b/xt/release/pod_coverage.t
@@ -0,0 +1,72 @@
+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;
+
+plan skip_all => 'disabled' if $config->{pod_coverage}->{skip};
+
+chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir));
+
+my @private_classes;
+my %private_methods;
+
+push @{ $config->{pod_coverage}->{private} },
+ 'Alien::.*::Install::Files#Inline';
+
+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] };
+ };
+}
+
diff --git a/xt/release/pod_spelling_common.t b/xt/release/pod_spelling_common.t
new file mode 100644
index 0000000..ad8dffd
--- /dev/null
+++ b/xt/release/pod_spelling_common.t
@@ -0,0 +1,27 @@
+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 };
+ plan skip_all => 'test requires YAML'
+ unless eval q{ use YAML qw( LoadFile ); 1 };
+};
+use Test::Pod::Spelling::CommonMistakes;
+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;
+
+plan skip_all => 'disabled' if $config->{pod_spelling_common}->{skip};
+
+chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir));
+
+# FIXME test files in bin too.
+all_pod_files_ok;
diff --git a/xt/release/pod_spelling_system.t b/xt/release/pod_spelling_system.t
new file mode 100644
index 0000000..3773353
--- /dev/null
+++ b/xt/release/pod_spelling_system.t
@@ -0,0 +1,101 @@
+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;
+
+plan skip_all => 'disabled' if $config->{pod_spelling_system}->{skip};
+
+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
+stderr
+stdin
+subref
+loopback
+username
+os
+Ollis
+Mojolicious
+plicease
+CPAN
+reinstall
+TODO
+filename
+filenames
+login
+callback
+callbacks
+standalone
+VMS
+hostname
+hostnames
+TCP
+UDP
+IP
+API
+MSWin32
+OpenBSD
+FreeBSD
+NetBSD
+unencrypted
+WebSocket
+WebSockets
+timestamp
+timestamps
+poney
+BackPAN
+portably
+RedHat
+AIX
+BSD
+XS
+FFI
+perlish
+optimizations
+subdirectory
+RESTful
+SQLite
+JavaScript
+dir
+plugins
+munge
+jQuery
+namespace
+PDF
+PDFs
+usernames
+DBI
+pluggable
+APIs
+SSL
+JSON
+YAML
+uncommented
+Solaris
+OpenVMS
+URI
+URL
+CGI
diff --git a/xt/release/release.yml b/xt/release/release.yml
new file mode 100644
index 0000000..9b3ffaf
--- /dev/null
+++ b/xt/release/release.yml
@@ -0,0 +1,22 @@
+---
+pod_spelling_system:
+ skip: 0
+ # list of words that are spelled correctly
+ # (regardless of what spell check thinks)
+ stopwords:
+ - 9x
+ - Bekman
+ - DocSet
+ - Einar
+ - Ellefsen
+ - OS2
+ - Stas
+ - Win32
+ - XP
+
+pod_coverage:
+ skip: 0
+ # format is "Class#method" or "Class", regex allowed
+ # for either Class or method.
+ private: []
+
diff --git a/xt/release/strict.t b/xt/release/strict.t
new file mode 100644
index 0000000..2dbad08
--- /dev/null
+++ b/xt/release/strict.t
@@ -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 ));
+
diff --git a/xt/release/version.t b/xt/release/version.t
new file mode 100644
index 0000000..c3d96c4
--- /dev/null
+++ b/xt/release/version.t
@@ -0,0 +1,44 @@
+use strict;
+use warnings;
+use Test::More;
+use FindBin ();
+BEGIN {
+
+ plan skip_all => "test requires Test::Version 2.00"
+ unless eval q{
+ use Test::Version 2.00 qw( version_all_ok ), {
+ has_version => 1,
+ filename_match => sub { $_[0] !~ m{/(ConfigData|Install/Files)\.pm$} },
+ };
+ 1
+ };
+
+ plan skip_all => "test requires Path::Class"
+ unless eval q{ use Path::Class qw( file dir ); 1 };
+ plan skip_all => 'test requires YAML'
+ unless eval q{ use YAML; 1; };
+}
+
+use YAML qw( LoadFile );
+use FindBin;
+use File::Spec;
+
+plan skip_all => "test not built yet (run dzil test)"
+ unless -e dir( $FindBin::Bin)->parent->parent->file('Makefile.PL')
+ || -e dir( $FindBin::Bin)->parent->parent->file('Build.PL');
+
+my $config_filename = File::Spec->catfile(
+ $FindBin::Bin, 'release.yml'
+);
+
+my $config;
+$config = LoadFile($config_filename)
+ if -r $config_filename;
+
+if($config->{version}->{dir})
+{
+ note "using dir " . $config->{version}->{dir}
+}
+
+version_all_ok($config->{version}->{dir} ? ($config->{version}->{dir}) : ());
+done_testing;