diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2014-11-13 06:59:49 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2014-11-13 06:59:49 +0000 |
commit | 60626c51d97a7ef06b364481ae4afd9706ef6ece (patch) | |
tree | 29f14af72f207da0e57c7ac944a2ab3faddff296 /xt | |
download | Class-Load-XS-tarball-master.tar.gz |
Class-Load-XS-0.09HEADClass-Load-XS-0.09master
Diffstat (limited to 'xt')
-rw-r--r-- | xt/author/00-compile.t | 51 | ||||
-rw-r--r-- | xt/author/clean-namespaces.t | 11 | ||||
-rw-r--r-- | xt/author/eol.t | 8 | ||||
-rw-r--r-- | xt/author/no-tabs.t | 56 | ||||
-rw-r--r-- | xt/author/pod-spell.t | 27 | ||||
-rw-r--r-- | xt/release/changes_has_content.t | 41 | ||||
-rw-r--r-- | xt/release/cpan-changes.t | 11 | ||||
-rw-r--r-- | xt/release/distmeta.t | 6 | ||||
-rw-r--r-- | xt/release/kwalitee.t | 9 | ||||
-rw-r--r-- | xt/release/minimum-version.t | 8 | ||||
-rw-r--r-- | xt/release/mojibake.t | 12 | ||||
-rw-r--r-- | xt/release/pod-coverage.t | 7 | ||||
-rw-r--r-- | xt/release/pod-no404s.t | 21 | ||||
-rw-r--r-- | xt/release/pod-syntax.t | 6 | ||||
-rw-r--r-- | xt/release/portability.t | 11 |
15 files changed, 285 insertions, 0 deletions
diff --git a/xt/author/00-compile.t b/xt/author/00-compile.t new file mode 100644 index 0000000..ed036b8 --- /dev/null +++ b/xt/author/00-compile.t @@ -0,0 +1,51 @@ +use 5.006; +use strict; +use warnings; + +# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.051 + +use Test::More 0.94; + +plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); + +my @module_files = ( + 'Class/Load/XS.pm' +); + + + +# no fake home requested + +my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib'; + +use File::Spec; +use IPC::Open3; +use IO::Handle; + +open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; + +my @warnings; +for my $lib (@module_files) +{ + # see L<perlfaq8/How can I capture STDERR from an external command?> + my $stderr = IO::Handle->new; + + my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); + binmode $stderr, ':crlf' if $^O eq 'MSWin32'; + my @_warnings = <$stderr>; + waitpid($pid, 0); + is($?, 0, "$lib loaded ok"); + + if (@_warnings) + { + warn @_warnings; + push @warnings, @_warnings; + } +} + + + +is(scalar(@warnings), 0, 'no warnings found') + or diag 'got warnings: ', explain(\@warnings) if $ENV{AUTHOR_TESTING}; + +BAIL_OUT("Compilation problems") if !Test::More->builder->is_passing; diff --git a/xt/author/clean-namespaces.t b/xt/author/clean-namespaces.t new file mode 100644 index 0000000..36387da --- /dev/null +++ b/xt/author/clean-namespaces.t @@ -0,0 +1,11 @@ +use strict; +use warnings; + +# this test was generated with Dist::Zilla::Plugin::Test::CleanNamespaces 0.006 + +use Test::More 0.94; +use Test::CleanNamespaces 0.15; + +subtest all_namespaces_clean => sub { all_namespaces_clean() }; + +done_testing; diff --git a/xt/author/eol.t b/xt/author/eol.t new file mode 100644 index 0000000..e02cf47 --- /dev/null +++ b/xt/author/eol.t @@ -0,0 +1,8 @@ +use strict; +use warnings; +use Test::More; + +# generated by Dist::Zilla::Plugin::Test::EOL 0.15 +use Test::EOL; + +all_perl_files_ok({ trailing_whitespace => 1 }); diff --git a/xt/author/no-tabs.t b/xt/author/no-tabs.t new file mode 100644 index 0000000..dd72bcb --- /dev/null +++ b/xt/author/no-tabs.t @@ -0,0 +1,56 @@ +use strict; +use warnings; + +# this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.09 + +use Test::More 0.88; +use Test::NoTabs; + +my @files = ( + 'lib/Class/Load/XS.pm', + 't/00-report-prereqs.dd', + 't/00-report-prereqs.t', + 't/000-load.t', + 't/001-is-class-loaded.t', + 't/002-try-load-class.t', + 't/003-load-class.t', + 't/004-load-double.t', + 't/005-load-optional.t', + 't/006-returned-error.t', + 't/007-first-existing.t', + 't/008-gvstash-bug.t', + 't/009-invalid-module-name.t', + 't/010-isa-false-positive.t', + 't/011-without-xs.t', + 't/012-without-implementation.t', + 't/013-errors.t', + 't/014-weird-constants.t', + 't/lib/Class/Load/Error/DieAfterBeginIsa.pm', + 't/lib/Class/Load/Error/DieAfterIsa.pm', + 't/lib/Class/Load/Error/SyntaxErrorAfterIsa.pm', + 't/lib/Class/Load/OK.pm', + 't/lib/Class/Load/Stash.pm', + 't/lib/Class/Load/Stash/Sub.pm', + 't/lib/Class/Load/SyntaxError.pm', + 't/lib/Class/Load/VersionCheck.pm', + 't/lib/Class/Load/VersionCheck2.pm', + 't/lib/Test/Class/Load.pm', + 'xt/author/00-compile.t', + 'xt/author/clean-namespaces.t', + 'xt/author/eol.t', + 'xt/author/no-tabs.t', + 'xt/author/pod-spell.t', + 'xt/release/changes_has_content.t', + 'xt/release/cpan-changes.t', + 'xt/release/distmeta.t', + 'xt/release/kwalitee.t', + 'xt/release/minimum-version.t', + 'xt/release/mojibake.t', + 'xt/release/pod-coverage.t', + 'xt/release/pod-no404s.t', + 'xt/release/pod-syntax.t', + 'xt/release/portability.t' +); + +notabs_ok($_) foreach @files; +done_testing; diff --git a/xt/author/pod-spell.t b/xt/author/pod-spell.t new file mode 100644 index 0000000..b1c9e1f --- /dev/null +++ b/xt/author/pod-spell.t @@ -0,0 +1,27 @@ +use strict; +use warnings; +use Test::More; + +# generated by Dist::Zilla::Plugin::Test::PodSpelling 2.006008 +use Test::Spelling 0.12; +use Pod::Wordlist; + + +add_stopwords(<DATA>); +all_pod_files_spelling_ok( qw( bin lib ) ); +__DATA__ +Dave +Rolsky +autarch +Karen +Etheridge +ether +Jesse +Luehrs +doy +github +hurricup +lib +Class +Load +XS diff --git a/xt/release/changes_has_content.t b/xt/release/changes_has_content.t new file mode 100644 index 0000000..c6710b2 --- /dev/null +++ b/xt/release/changes_has_content.t @@ -0,0 +1,41 @@ +#!perl + +use Test::More tests => 2; + +note 'Checking Changes'; +my $changes_file = 'Changes'; +my $newver = '0.09'; +my $trial_token = '-TRIAL'; + +SKIP: { + ok(-e $changes_file, "$changes_file file exists") + or skip 'Changes is missing', 1; + + ok(_get_changes($newver), "$changes_file has content for $newver"); +} + +done_testing; + +# _get_changes copied and adapted from Dist::Zilla::Plugin::Git::Commit +# by Jerome Quelin +sub _get_changes +{ + my $newver = shift; + + # parse changelog to find commit message + open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; + my $changelog = join('', <$fh>); + close $fh; + + my @content = + grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented + split /\n/, $changelog; + shift @content; # drop the version line + + # drop unindented last line and trailing blank lines + pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); + + # return number of non-blank lines + return scalar @content; +} + diff --git a/xt/release/cpan-changes.t b/xt/release/cpan-changes.t new file mode 100644 index 0000000..8e6e413 --- /dev/null +++ b/xt/release/cpan-changes.t @@ -0,0 +1,11 @@ +#!perl + +use strict; +use warnings; + +use Test::More 0.96 tests => 2; +use_ok('Test::CPAN::Changes'); +subtest 'changes_ok' => sub { + changes_file_ok('Changes'); +}; +done_testing(); diff --git a/xt/release/distmeta.t b/xt/release/distmeta.t new file mode 100644 index 0000000..c2280dc --- /dev/null +++ b/xt/release/distmeta.t @@ -0,0 +1,6 @@ +#!perl +# This file was automatically generated by Dist::Zilla::Plugin::MetaTests. + +use Test::CPAN::Meta; + +meta_yaml_ok(); diff --git a/xt/release/kwalitee.t b/xt/release/kwalitee.t new file mode 100644 index 0000000..bcbce84 --- /dev/null +++ b/xt/release/kwalitee.t @@ -0,0 +1,9 @@ +# this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.11 +use strict; +use warnings; +use Test::More 0.88; +use Test::Kwalitee 1.21 'kwalitee_ok'; + +kwalitee_ok(); + +done_testing; diff --git a/xt/release/minimum-version.t b/xt/release/minimum-version.t new file mode 100644 index 0000000..c3f95dd --- /dev/null +++ b/xt/release/minimum-version.t @@ -0,0 +1,8 @@ +#!perl + +use Test::More; + +eval "use Test::MinimumVersion"; +plan skip_all => "Test::MinimumVersion required for testing minimum versions" + if $@; +all_minimum_version_ok( qq{5.006} ); diff --git a/xt/release/mojibake.t b/xt/release/mojibake.t new file mode 100644 index 0000000..390c632 --- /dev/null +++ b/xt/release/mojibake.t @@ -0,0 +1,12 @@ +#!perl + +use strict; +use warnings qw(all); + +use Test::More; + +## no critic (ProhibitStringyEval, RequireCheckingReturnValueOfEval) +eval q(use Test::Mojibake); +plan skip_all => q(Test::Mojibake required for source encoding testing) if $@; + +all_files_encoding_ok(); diff --git a/xt/release/pod-coverage.t b/xt/release/pod-coverage.t new file mode 100644 index 0000000..66b3b64 --- /dev/null +++ b/xt/release/pod-coverage.t @@ -0,0 +1,7 @@ +#!perl +# This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. + +use Test::Pod::Coverage 1.08; +use Pod::Coverage::TrustPod; + +all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); diff --git a/xt/release/pod-no404s.t b/xt/release/pod-no404s.t new file mode 100644 index 0000000..eb9760c --- /dev/null +++ b/xt/release/pod-no404s.t @@ -0,0 +1,21 @@ +#!perl + +use strict; +use warnings; +use Test::More; + +foreach my $env_skip ( qw( + SKIP_POD_NO404S + AUTOMATED_TESTING +) ){ + plan skip_all => "\$ENV{$env_skip} is set, skipping" + if $ENV{$env_skip}; +} + +eval "use Test::Pod::No404s"; +if ( $@ ) { + plan skip_all => 'Test::Pod::No404s required for testing POD'; +} +else { + all_pod_files_ok(); +} diff --git a/xt/release/pod-syntax.t b/xt/release/pod-syntax.t new file mode 100644 index 0000000..f0468f1 --- /dev/null +++ b/xt/release/pod-syntax.t @@ -0,0 +1,6 @@ +#!perl +# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. +use Test::More; +use Test::Pod 1.41; + +all_pod_files_ok(); diff --git a/xt/release/portability.t b/xt/release/portability.t new file mode 100644 index 0000000..e68185d --- /dev/null +++ b/xt/release/portability.t @@ -0,0 +1,11 @@ +#!perl + +use strict; +use warnings; + +use Test::More; + +eval 'use Test::Portability::Files'; +plan skip_all => 'Test::Portability::Files required for testing portability' + if $@; +run_tests(); |