summaryrefslogtreecommitdiff
path: root/xt
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-06-25 04:47:55 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-06-25 04:47:55 +0000
commit7e7ddbe33ca34359d711aee1e0ddebaeb40c2a18 (patch)
tree2a03e101e7b0302f5dcde62ed415a415ecca041d /xt
downloadClass-Load-tarball-master.tar.gz
Diffstat (limited to 'xt')
-rw-r--r--xt/author/00-compile.t55
-rw-r--r--xt/author/eol.t54
-rw-r--r--xt/author/kwalitee.t9
-rw-r--r--xt/author/no-tabs.t54
-rw-r--r--xt/author/pod-spell.t36
-rw-r--r--xt/release/changes_has_content.t41
-rw-r--r--xt/release/cpan-changes.t11
-rw-r--r--xt/release/distmeta.t6
-rw-r--r--xt/release/minimum-version.t8
-rw-r--r--xt/release/mojibake.t12
-rw-r--r--xt/release/pod-syntax.t6
-rw-r--r--xt/release/portability.t12
12 files changed, 304 insertions, 0 deletions
diff --git a/xt/author/00-compile.t b/xt/author/00-compile.t
new file mode 100644
index 0000000..9a31122
--- /dev/null
+++ b/xt/author/00-compile.t
@@ -0,0 +1,55 @@
+use 5.006;
+use strict;
+use warnings;
+
+# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.053
+
+use Test::More 0.94;
+
+plan tests => 3;
+
+my @module_files = (
+ 'Class/Load.pm',
+ 'Class/Load/PP.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");
+
+ shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
+ and not eval { blib->VERSION('1.01') };
+
+ if (@_warnings)
+ {
+ warn @_warnings;
+ push @warnings, @_warnings;
+ }
+}
+
+
+
+is(scalar(@warnings), 0, 'no warnings found')
+ or diag 'got warnings: ', explain(\@warnings);
+
+BAIL_OUT("Compilation problems") if !Test::More->builder->is_passing;
diff --git a/xt/author/eol.t b/xt/author/eol.t
new file mode 100644
index 0000000..fc850b5
--- /dev/null
+++ b/xt/author/eol.t
@@ -0,0 +1,54 @@
+use strict;
+use warnings;
+
+# this test was generated with Dist::Zilla::Plugin::Test::EOL 0.18
+
+use Test::More 0.88;
+use Test::EOL;
+
+my @files = (
+ 'lib/Class/Load.pm',
+ 'lib/Class/Load/PP.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/eol.t',
+ 'xt/author/kwalitee.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/minimum-version.t',
+ 'xt/release/mojibake.t',
+ 'xt/release/pod-syntax.t',
+ 'xt/release/portability.t'
+);
+
+eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files;
+done_testing;
diff --git a/xt/author/kwalitee.t b/xt/author/kwalitee.t
new file mode 100644
index 0000000..bcbce84
--- /dev/null
+++ b/xt/author/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/author/no-tabs.t b/xt/author/no-tabs.t
new file mode 100644
index 0000000..4ba0259
--- /dev/null
+++ b/xt/author/no-tabs.t
@@ -0,0 +1,54 @@
+use strict;
+use warnings;
+
+# this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15
+
+use Test::More 0.88;
+use Test::NoTabs;
+
+my @files = (
+ 'lib/Class/Load.pm',
+ 'lib/Class/Load/PP.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/eol.t',
+ 'xt/author/kwalitee.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/minimum-version.t',
+ 'xt/release/mojibake.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..d19b270
--- /dev/null
+++ b/xt/author/pod-spell.t
@@ -0,0 +1,36 @@
+use strict;
+use warnings;
+use Test::More;
+
+# generated by Dist::Zilla::Plugin::Test::PodSpelling 2.006009
+use Test::Spelling 0.12;
+use Pod::Wordlist;
+
+
+add_stopwords(<DATA>);
+all_pod_files_spelling_ok( qw( bin lib ) );
+__DATA__
+Shawn
+Moore
+sartak
+at
+bestpractical
+Dave
+Rolsky
+autarch
+Karen
+Etheridge
+ether
+Jesse
+Luehrs
+doy
+Kent
+Fredric
+kentfredric
+Caleb
+Cushing
+xenoterracide
+lib
+Class
+Load
+PP
diff --git a/xt/release/changes_has_content.t b/xt/release/changes_has_content.t
new file mode 100644
index 0000000..dfb4035
--- /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.23';
+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/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-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..bb53c7b
--- /dev/null
+++ b/xt/release/portability.t
@@ -0,0 +1,12 @@
+#!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();