[Bps-public-commit] Config-GitLike branch, master, updated. 2810ab5bc1c128c02801e9c2c6bf2f272765dd2a
jesse
jesse at bestpractical.com
Thu Jun 11 12:51:23 EDT 2009
The branch, master has been updated
via 2810ab5bc1c128c02801e9c2c6bf2f272765dd2a (commit)
via a5134cf48bd7403bb6dc7fc5804d56fc89bc84ca (commit)
via 0ab6bb569073fa220f858a90923ecf73a7f06efc (commit)
from 7a857801d2edf3e7f37a68b52654b9fba36e98c3 (commit)
Summary of changes:
Makefile.PL | 2 +-
inc/Module/Install.pm | 2 +-
inc/Module/Install/Base.pm | 19 +++++---
inc/Module/Install/Can.pm | 2 +-
inc/Module/Install/ExtraTests.pm | 100 ++++++++++++++++++++++++++++++++++++++
inc/Module/Install/Fetch.pm | 2 +-
inc/Module/Install/Makefile.pm | 2 +-
inc/Module/Install/Metadata.pm | 2 +-
inc/Module/Install/Win32.pm | 2 +-
inc/Module/Install/WriteAll.pm | 2 +-
t/t1300-repo-config.t | 4 +-
xt/00-dependencies.t | 84 ++++++++++++++++++++++++++++++++
xt/99-pod-coverage.t | 14 +++++
xt/99-pod.t | 5 ++
14 files changed, 225 insertions(+), 17 deletions(-)
create mode 100644 inc/Module/Install/ExtraTests.pm
create mode 100644 xt/00-dependencies.t
create mode 100644 xt/99-pod-coverage.t
create mode 100644 xt/99-pod.t
- Log -----------------------------------------------------------------
commit 0ab6bb569073fa220f858a90923ecf73a7f06efc
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Thu Jun 11 12:45:33 2009 -0400
quiet down some diags
diff --git a/t/t1300-repo-config.t b/t/t1300-repo-config.t
index d460617..0175912 100644
--- a/t/t1300-repo-config.t
+++ b/t/t1300-repo-config.t
@@ -36,13 +36,13 @@ my $config_dir = File::Temp->newdir( CLEANUP => !$ENV{CONFIG_GITLIKE_DEBUG} );
my $config_dirname = $config_dir->dirname;
my $config_filename = File::Spec->catfile( $config_dirname, 'config' );
-diag "config file is: $config_filename";
+diag "config file is: $config_filename" if $ENV{TEST_VERBOSE};
my $config
= TestConfig->new( confname => 'config', tmpdir => $config_dirname );
$config->load;
-diag('Test git config in different settings');
+diag('Test git config in different settings') if $ENV{TEST_VERBOSE};
$config->set(
key => 'core.penguin',
commit a5134cf48bd7403bb6dc7fc5804d56fc89bc84ca
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Thu Jun 11 12:48:38 2009 -0400
Added author tests
diff --git a/Makefile.PL b/Makefile.PL
index e662f82..4a17258 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -11,6 +11,6 @@ build_requires 'Test::More';
build_requires 'Test::Exception';
build_requires 'File::Spec';
build_requires 'File::Temp';
-
+extra_tests();
sign();
WriteAll();
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index 56b4cfe..5b9ddbf 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -28,7 +28,7 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '0.84';
+ $VERSION = '0.85';
# Storage for the pseudo-singleton
$MAIN = undef;
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index de3af2f..ac416c9 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -1,7 +1,11 @@
#line 1
package Module::Install::Base;
-$VERSION = '0.84';
+use strict 'vars';
+use vars qw{$VERSION};
+BEGIN {
+ $VERSION = '0.85';
+}
# Suspend handler for "redefined" warnings
BEGIN {
@@ -12,7 +16,7 @@ BEGIN {
### This is the ONLY module that shouldn't have strict on
# use strict;
-#line 41
+#line 45
sub new {
my ($class, %args) = @_;
@@ -27,7 +31,7 @@ sub new {
bless( \%args, $class );
}
-#line 62
+#line 66
sub AUTOLOAD {
my $self = shift;
@@ -38,13 +42,13 @@ sub AUTOLOAD {
goto &$autoload;
}
-#line 79
+#line 83
sub _top {
$_[0]->{_top};
}
-#line 94
+#line 98
sub admin {
$_[0]->_top->{admin}
@@ -52,7 +56,7 @@ sub admin {
Module::Install::Base::FakeAdmin->new;
}
-#line 110
+#line 114
sub is_admin {
$_[0]->admin->VERSION;
@@ -63,6 +67,7 @@ sub DESTROY {}
package Module::Install::Base::FakeAdmin;
my $fake;
+
sub new {
$fake ||= bless(\@_, $_[0]);
}
@@ -78,4 +83,4 @@ BEGIN {
1;
-#line 157
+#line 162
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index 32a2a76..3e2d523 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -9,7 +9,7 @@ use ExtUtils::MakeMaker ();
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.84';
+ $VERSION = '0.85';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index 8404b10..0a62208 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base;
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.84';
+ $VERSION = '0.85';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index de08914..2b80f0f 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -7,7 +7,7 @@ use ExtUtils::MakeMaker ();
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.84';
+ $VERSION = '0.85';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index d1b68d9..ca16db7 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.84';
+ $VERSION = '0.85';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index 535de7b..c00da94 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.84';
+ $VERSION = '0.85';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 1ffc3c3..df3900a 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.84';
+ $VERSION = '0.85';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
diff --git a/xt/00-dependencies.t b/xt/00-dependencies.t
new file mode 100644
index 0000000..f601789
--- /dev/null
+++ b/xt/00-dependencies.t
@@ -0,0 +1,84 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+
+=head1 DESCRIPTION
+
+Makes sure that all of the modules that are 'use'd are listed in the
+Makefile.PL as dependencies.
+
+=cut
+
+use Test::More;
+use File::Find;
+eval 'use Module::CoreList';
+if ($@) {
+ plan skip_all => 'Module::CoreList not installed'
+}
+elsif ( ! -e 'inc/.author' ) {
+ plan skip_all => 'no inc/.author, and it is on purpose ;)'
+}
+
+plan 'no_plan';
+
+my %used;
+find( \&wanted, qw/ lib bin t / );
+
+sub wanted {
+ return unless -f $_;
+ return if $File::Find::dir =~ m!/.svn($|/)!;
+ return if $File::Find::name =~ /~$/;
+ return if $File::Find::name =~ /\.(pod|html)$/;
+
+ # read in the file from disk
+ my $filename = $_;
+ local $/;
+ open( FILE, $filename ) or return;
+ my $data = <FILE>;
+ close(FILE);
+
+ # strip pod, in a really idiotic way. Good enough though
+ $data =~ s/^=head.+?(^=cut|\Z)//gms;
+
+ # look for use and use base statements
+ $used{$1}{$File::Find::name}++ while $data =~ /^\s*use\s+([\w:]+)/gm;
+ while ( $data =~ m|^\s*use base qw.([\w\s:]+)|gm ) {
+ $used{$_}{$File::Find::name}++ for split ' ', $1;
+ }
+}
+
+my %required;
+{
+ local $/;
+ ok( open( MAKEFILE, "Makefile.PL" ), "Opened Makefile" );
+ my $data = <MAKEFILE>;
+ close(FILE);
+ while ( $data =~ /^\s*?(?:requires|recommends)?.*?([\w:]+)'(?:\s*=>\s*['"]?([\d\.]+)['"]?)?.*?(?:#(.*))?$/gm ) {
+ $required{$1} = $2;
+ if ( defined $3 and length $3 ) {
+ $required{$_} = undef for split ' ', $3;
+ }
+ }
+}
+
+for ( sort keys %used ) {
+ my $first_in = Module::CoreList->first_release($_);
+ next if defined $first_in and $first_in <= 5.00803;
+ next if /^(Config::GitLike|inc|t)(::|$)/;
+
+ #warn $_;
+ ok( exists $required{$_}, "$_ in Makefile.PL" )
+ or diag( "used in ", join ", ", sort keys %{ $used{$_} } );
+ delete $used{$_};
+ delete $required{$_};
+}
+
+for ( sort keys %required ) {
+ my $first_in = Module::CoreList->first_release( $_, $required{$_} );
+ fail("Required module $_ (v. $required{$_}) is in core since $first_in")
+ if defined $first_in and $first_in <= 5.008003;
+}
+
+1;
+
diff --git a/xt/99-pod-coverage.t b/xt/99-pod-coverage.t
new file mode 100644
index 0000000..d2da1a2
--- /dev/null
+++ b/xt/99-pod-coverage.t
@@ -0,0 +1,14 @@
+use Test::More;
+eval "use Test::Pod::Coverage 1.00";
+plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
+plan skip_all => "Coverage tests only run for authors" unless ( -d 'inc/.author' );
+
+all_pod_coverage_ok();
+
+# Workaround for dumb bug (fixed in 5.8.7) where Test::Builder thinks that
+# certain "die"s that happen inside evals are not actually inside evals,
+# because caller() is broken if you turn on $^P like Module::Refresh does
+#
+# (I mean, if we've gotten to this line, then clearly the test didn't die, no?)
+Test::Builder->new->{Test_Died} = 0;
+
diff --git a/xt/99-pod.t b/xt/99-pod.t
new file mode 100644
index 0000000..92ba3f6
--- /dev/null
+++ b/xt/99-pod.t
@@ -0,0 +1,5 @@
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+all_pod_files_ok();
+
commit 2810ab5bc1c128c02801e9c2c6bf2f272765dd2a
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Thu Jun 11 12:48:53 2009 -0400
added authortests inc file
diff --git a/inc/Module/Install/ExtraTests.pm b/inc/Module/Install/ExtraTests.pm
new file mode 100644
index 0000000..7a60d64
--- /dev/null
+++ b/inc/Module/Install/ExtraTests.pm
@@ -0,0 +1,100 @@
+#line 1
+use strict;
+use warnings;
+use 5.006;
+package Module::Install::ExtraTests;
+use Module::Install::Base;
+
+BEGIN {
+ our $VERSION = '0.006';
+ our $ISCORE = 1;
+ our @ISA = qw{Module::Install::Base};
+}
+
+sub extra_tests {
+ my ($self) = @_;
+
+ return unless -d 'xt';
+ return unless my @content = grep { $_ =~ /^[.]/ } <xt/*>;
+
+ die "unknown files found in ./xt" if grep { -f } @content;
+
+ my %known = map {; $_ => 1 } qw(author smoke release);
+ my @unknown = grep { not $known{$_} } @content;
+ die "unknown directories found in ./xt: @unknown" if @unknown;
+
+ {
+ no warnings qw(closure once);
+ package # The newline tells PAUSE, "DO NOT INDEXING!"
+ MY;
+ sub test_via_harness {
+ my ($self, $perl, $tests) = @_;
+ my $a_str = -d 'xt/author' ? 'xt/author' : '';
+ my $r_str = -d 'xt/release' ? 'xt/release' : '';
+ my $s_str = -d 'xt/smoke' ? 'xt/smoke' : '';
+ my $is_author = $Module::Install::AUTHOR ? 1 : 0;
+
+ return qq{\t$perl "-Iinc" "-MModule::Install::ExtraTests" }
+ . qq{"-e" "Module::Install::ExtraTests::__harness('Test::Harness', $is_author, '$a_str', '$r_str', '$s_str', \$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $tests\n};
+ }
+
+ sub dist_test {
+ my ($self, @args) = @_;
+ my $text = $self->SUPER::dist_test(@args);
+ my @lines = split /\n/, $text;
+ $_ =~ s/ (\S*MAKE\S* test )/ RELEASE_TESTING=1 $1 / for grep { m/ test / } @lines;
+ return join "\n", @lines;
+ }
+
+ }
+}
+
+sub __harness {
+ my $harness_class = shift;
+ my $is_author = shift;
+ my $author_tests = shift;
+ my $release_tests = shift;
+ my $smoke_tests = shift;
+
+ eval "require $harness_class; 1" or die;
+ require File::Spec;
+
+ my $verbose = shift;
+ eval "\$$harness_class\::verbose = $verbose; 1" or die;
+
+ # Because Windows doesn't do this for us and listing all the *.t files
+ # out on the command line can blow over its exec limit.
+ require ExtUtils::Command;
+ push @ARGV, __PACKAGE__->_deep_t($author_tests)
+ if $author_tests and (exists $ENV{AUTHOR_TESTING} ? $ENV{AUTHOR_TESTING} : $is_author);
+
+ push @ARGV, __PACKAGE__->_deep_t($release_tests)
+ if $release_tests and $ENV{RELEASE_TESTING};
+
+ push @ARGV, __PACKAGE__->_deep_t($smoke_tests)
+ if $smoke_tests and $ENV{AUTOMATED_TESTING};
+
+ my @argv = ExtUtils::Command::expand_wildcards(@ARGV);
+
+ local @INC = @INC;
+ unshift @INC, map { File::Spec->rel2abs($_) } @_;
+ $harness_class->can('runtests')->(sort { lc $a cmp lc $b } @argv);
+}
+
+sub _wanted {
+ my $href = shift;
+ no warnings 'once';
+ sub { /\.t$/ and -f $_ and $href->{$File::Find::dir} = 1 }
+}
+
+sub _deep_t {
+ my ($self, $dir) = @_;
+ require File::Find;
+
+ my %test_dir;
+ File::Find::find(_wanted(\%test_dir), $dir);
+ return map { "$_/*.t" } sort keys %test_dir;
+}
+
+1;
+__END__
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list