[Bps-public-commit] r18536 - in Shipwright/trunk: . inc/Module/Install xt

jesse at bestpractical.com jesse at bestpractical.com
Mon Feb 23 11:44:08 EST 2009


Author: jesse
Date: Mon Feb 23 11:44:08 2009
New Revision: 18536

Added:
   Shipwright/trunk/inc/Module/Install/AuthorTests.pm
   Shipwright/trunk/xt/
   Shipwright/trunk/xt/99.kwalitee.t
      - copied unchanged from r15303, /Shipwright/trunk/t/99.kwalitee.t
   Shipwright/trunk/xt/perlcritic.t
      - copied, changed from r15347, /Shipwright/trunk/t/perlcritic.t
   Shipwright/trunk/xt/pod-coverage.t
      - copied unchanged from r15422, /Shipwright/trunk/t/pod-coverage.t
   Shipwright/trunk/xt/pod.t
      - copied unchanged from r10849, /Shipwright/trunk/t/pod.t
Removed:
   Shipwright/trunk/t/99.kwalitee.t
   Shipwright/trunk/t/perlcritic.t
   Shipwright/trunk/t/pod-coverage.t
   Shipwright/trunk/t/pod.t
Modified:
   Shipwright/trunk/META.yml
   Shipwright/trunk/Makefile.PL

Log:
* Switch to using M::I::AuthorTests and the xt directory for author tests

Modified: Shipwright/trunk/META.yml
==============================================================================
--- Shipwright/trunk/META.yml	(original)
+++ Shipwright/trunk/META.yml	Mon Feb 23 11:44:08 2009
@@ -18,6 +18,7 @@
     - inc
     - share
     - t
+    - xt
 requires:
   Algorithm::Dependency::Ordered: 0
   Algorithm::Dependency::Source::HoA: 0

Modified: Shipwright/trunk/Makefile.PL
==============================================================================
--- Shipwright/trunk/Makefile.PL	(original)
+++ Shipwright/trunk/Makefile.PL	Mon Feb 23 11:44:08 2009
@@ -44,6 +44,7 @@
 
 
 no_index( directory => 't' );
+no_index( directory => 'xt' );
 no_index( directory => 'docs' );
 
 install_script('bin/shipwright');
@@ -51,6 +52,5 @@
 auto_install;
 
 tests('t/*.t t/*/*.t');
-
+recursive_author_tests('xt/');
 WriteAll;
-

Added: Shipwright/trunk/inc/Module/Install/AuthorTests.pm
==============================================================================
--- (empty file)
+++ Shipwright/trunk/inc/Module/Install/AuthorTests.pm	Mon Feb 23 11:44:08 2009
@@ -0,0 +1,59 @@
+#line 1
+package Module::Install::AuthorTests;
+
+use 5.005;
+use strict;
+use Module::Install::Base;
+use Carp ();
+
+#line 16
+
+use vars qw{$VERSION $ISCORE @ISA};
+BEGIN {
+  $VERSION = '0.002';
+  $ISCORE  = 1;
+  @ISA     = qw{Module::Install::Base};
+}
+
+#line 42
+
+sub author_tests {
+  my ($self, @dirs) = @_;
+  _add_author_tests($self, \@dirs, 0);
+}
+
+#line 56
+
+sub recursive_author_tests {
+  my ($self, @dirs) = @_;
+  _add_author_tests($self, \@dirs, 1);
+}
+
+sub _wanted {
+  my $href = shift;
+  sub { /\.t$/ and -f $_ and $href->{$File::Find::dir} = 1 }
+}
+
+sub _add_author_tests {
+  my ($self, $dirs, $recurse) = @_;
+  return unless $Module::Install::AUTHOR;
+
+  my @tests = $self->tests ? (split / /, $self->tests) : 't/*.t';
+
+  # XXX: pick a default, later -- rjbs, 2008-02-24
+  my @dirs = @$dirs ? @$dirs : Carp::confess "no dirs given to author_tests";
+     @dirs = grep { -d } @dirs;
+
+  if ($recurse) {
+    require File::Find;
+    my %test_dir;
+    File::Find::find(_wanted(\%test_dir), @dirs);
+    $self->tests( join ' ', @tests, map { "$_/*.t" } sort keys %test_dir );
+  } else {
+    $self->tests( join ' ', @tests, map { "$_/*.t" } sort @dirs );
+  }
+}
+
+#line 107
+
+1;

Copied: Shipwright/trunk/xt/perlcritic.t (from r15347, /Shipwright/trunk/t/perlcritic.t)
==============================================================================
--- /Shipwright/trunk/t/perlcritic.t	(original)
+++ Shipwright/trunk/xt/perlcritic.t	Mon Feb 23 11:44:08 2009
@@ -9,8 +9,5 @@
     plan skip_all =>
 "Perl::Critic 1.090 and Test::Perl::Critic 1.01 required for testing PBP compliance";
 }
-elsif ( !-e 'inc/.author' ) {
-    plan skip_all => 'no inc/.author, will not run this test ;)';
-}
 
 Test::Perl::Critic::all_critic_ok();



More information about the Bps-public-commit mailing list