r34949 - in /branches/upstream/libtest-useallmodules-perl/current: ./ lib/Test/ t/ t/MANIFESTed/ t/MANIFESTed/lib/ t/MANIFESTed/t/ t/MANIFESTed/t/lib/ t/MANIFESTed/under/ t/NoMANIFEST/lib/

ryan52-guest at users.alioth.debian.org ryan52-guest at users.alioth.debian.org
Fri May 8 07:30:21 UTC 2009


Author: ryan52-guest
Date: Fri May  8 07:30:12 2009
New Revision: 34949

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=34949
Log:
[svn-upgrade] Integrating new upstream version, libtest-useallmodules-perl (0.11)

Added:
    branches/upstream/libtest-useallmodules-perl/current/t/04_under.t
    branches/upstream/libtest-useallmodules-perl/current/t/04_under_files.t
    branches/upstream/libtest-useallmodules-perl/current/t/05_except.t
    branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/
    branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/MANIFEST
    branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/lib/
    branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/lib/TestUseAllModulesTest.pm
    branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/lib/TestUseAllModulesTestFoo.pm
    branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/t/
    branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/t/lib/
    branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/t/lib/TestUseAllModulesTestTest.pm
    branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/under/
    branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/under/TestUseAllModulesUnder.pm
Modified:
    branches/upstream/libtest-useallmodules-perl/current/Changes
    branches/upstream/libtest-useallmodules-perl/current/MANIFEST
    branches/upstream/libtest-useallmodules-perl/current/META.yml
    branches/upstream/libtest-useallmodules-perl/current/lib/Test/UseAllModules.pm
    branches/upstream/libtest-useallmodules-perl/current/t/NoMANIFEST/lib/NeverTested.pm

Modified: branches/upstream/libtest-useallmodules-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-useallmodules-perl/current/Changes?rev=34949&op=diff
==============================================================================
--- branches/upstream/libtest-useallmodules-perl/current/Changes (original)
+++ branches/upstream/libtest-useallmodules-perl/current/Changes Fri May  8 07:30:12 2009
@@ -1,4 +1,7 @@
 Revision history for Perl extension Test::UseAllModules.
+
+0.11 2009/05/08
+  - Modules under arbitrary directories can be tested now.
 
 0.10 2009/02/26
   - no significant code changes

Modified: branches/upstream/libtest-useallmodules-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-useallmodules-perl/current/MANIFEST?rev=34949&op=diff
==============================================================================
--- branches/upstream/libtest-useallmodules-perl/current/MANIFEST (original)
+++ branches/upstream/libtest-useallmodules-perl/current/MANIFEST Fri May  8 07:30:12 2009
@@ -1,13 +1,21 @@
 Changes
+lib/Test/UseAllModules.pm
 Makefile.PL
-MANIFEST
+MANIFEST			This list of files
 README
-lib/Test/UseAllModules.pm
 t/01_load.t
 t/02_no_pm.t
 t/03_no_manifest.t
+t/04_under.t
+t/04_under_files.t
+t/05_except.t
 t/99_pod.t
 t/99_podcoverage.t
+t/MANIFESTed/lib/TestUseAllModulesTest.pm
+t/MANIFESTed/lib/TestUseAllModulesTestFoo.pm
+t/MANIFESTed/MANIFEST
+t/MANIFESTed/t/lib/TestUseAllModulesTestTest.pm
+t/MANIFESTed/under/TestUseAllModulesUnder.pm
+t/NoMANIFEST/lib/NeverTested.pm
 t/NoPM/MANIFEST
-t/NoMANIFEST/lib/NeverTested.pm
 META.yml                                 Module meta-data (added by MakeMaker)

Modified: branches/upstream/libtest-useallmodules-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-useallmodules-perl/current/META.yml?rev=34949&op=diff
==============================================================================
--- branches/upstream/libtest-useallmodules-perl/current/META.yml (original)
+++ branches/upstream/libtest-useallmodules-perl/current/META.yml Fri May  8 07:30:12 2009
@@ -1,12 +1,14 @@
 --- #YAML:1.0
 name:               Test-UseAllModules
-version:            0.10
+version:            0.11
 abstract:           do use_ok() for all the MANIFESTed modules
 author:
     - Kenichi Ishigaki <ishigaki at cpan.org>
 license:            perl
 distribution_type:  module
 configure_requires:
+    ExtUtils::MakeMaker:  0
+build_requires:
     ExtUtils::MakeMaker:  0
 requires:
     Exporter:            0
@@ -16,7 +18,7 @@
     directory:
         - t
         - inc
-generated_by:       ExtUtils::MakeMaker version 6.48
+generated_by:       ExtUtils::MakeMaker version 6.50
 meta-spec:
     url:      http://module-build.sourceforge.net/META-spec-v1.4.html
     version:  1.4

Modified: branches/upstream/libtest-useallmodules-perl/current/lib/Test/UseAllModules.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-useallmodules-perl/current/lib/Test/UseAllModules.pm?rev=34949&op=diff
==============================================================================
--- branches/upstream/libtest-useallmodules-perl/current/lib/Test/UseAllModules.pm (original)
+++ branches/upstream/libtest-useallmodules-perl/current/lib/Test/UseAllModules.pm Fri May  8 07:30:12 2009
@@ -4,7 +4,7 @@
 use warnings;
 use ExtUtils::Manifest qw( maniread );
 
-our $VERSION = '0.10';
+our $VERSION = '0.11';
 
 use Exporter;
 
@@ -13,22 +13,29 @@
 
 use Test::More;
 
-sub all_uses_ok {
+my $RULE;
+
+sub import {
+  shift->export_to_level(1);
+
+  shift if @_ && $_[0] eq 'under';
+  my @dirs = ('lib', @_);
+  my %seen;
+  @dirs  = grep { !$seen{$_}++ } map  { s|/+$||; $_ } @dirs;
+  $RULE = '^(?:'.(join '|', @dirs).')/(.*)\.pm\s*$';
+  unshift @INC, @dirs;
+}
+
+sub _get_module_list {
   shift if @_ && $_[0] eq 'except';
-
   my @exceptions = @_;
   my @modules;
-
-  unless (-f 'MANIFEST') {
-    plan skip_all => 'no MANIFEST';
-    exit;
-  }
 
   my $manifest = maniread();
 
 READ:
   foreach my $file (keys %{ $manifest }) {
-    if (my ($module) = $file =~ m|^lib/(.*)\.pm\s*$|) {
+    if (my ($module) = $file =~ m|$RULE|) {
       $module =~ s|/|::|g;
 
       foreach my $rule (@exceptions) {
@@ -38,6 +45,16 @@
       push @modules, $module;
     }
   }
+  return @modules;
+}
+
+sub all_uses_ok {
+  unless (-f 'MANIFEST') {
+    plan skip_all => 'no MANIFEST';
+    exit;
+  }
+
+  my @modules = _get_module_list(@_);
 
   unless (@modules) {
     plan skip_all => 'no .pm files are found under the lib directory';
@@ -62,16 +79,22 @@
 
 =head1 SYNOPSIS
 
-  # basic use
+  # basic usage
   use strict;
   use Test::UseAllModules;
+  
+  BEGIN { all_uses_ok(); }
 
+  # if you also want to test modules under t/lib
+  use strict;
+  use Test::UseAllModules under => qw(lib t/lib);
+  
   BEGIN { all_uses_ok(); }
 
   # if you have modules that'll fail use_ok() for themselves
   use strict;
   use Test::UseAllModules;
-
+  
   BEGIN {
     all_uses_ok except => qw(
       Some::Dependent::Module
@@ -88,7 +111,9 @@
 
 =head2 all_uses_ok
 
-Does Test::More's use_ok() for every module found in MANIFEST. Tests only modules under the 'lib' directory. If you have modules you don't want to test, give those modules or some regex rules as the argument. The word 'except' will be ignored as shown above.
+Does Test::More's use_ok() for every module found in MANIFEST. If you have modules you don't want to test, give those modules or some regex rules as the argument. The word 'except' is ignored as shown above. 
+
+As of 0.11, you can also test modules under arbitrary directories by providing a directory list at the loading time (the word 'under' is ignored as shown above). Modules under the lib directory are always tested.
 
 =head1 NOTES
 

Added: branches/upstream/libtest-useallmodules-perl/current/t/04_under.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-useallmodules-perl/current/t/04_under.t?rev=34949&op=file
==============================================================================
--- branches/upstream/libtest-useallmodules-perl/current/t/04_under.t (added)
+++ branches/upstream/libtest-useallmodules-perl/current/t/04_under.t Fri May  8 07:30:12 2009
@@ -1,0 +1,10 @@
+use strict;
+use warnings;
+use Test::UseAllModules under => qw(lib t/lib/);
+
+BEGIN {
+  chdir 't/MANIFESTed';
+  all_uses_ok();
+  chdir '../..';
+}
+

Added: branches/upstream/libtest-useallmodules-perl/current/t/04_under_files.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-useallmodules-perl/current/t/04_under_files.t?rev=34949&op=file
==============================================================================
--- branches/upstream/libtest-useallmodules-perl/current/t/04_under_files.t (added)
+++ branches/upstream/libtest-useallmodules-perl/current/t/04_under_files.t Fri May  8 07:30:12 2009
@@ -1,0 +1,13 @@
+use strict;
+use warnings;
+use Test::UseAllModules under => qw(lib t/lib/);
+use Test::More tests => 2;
+
+BEGIN {
+  chdir 't/MANIFESTed';
+  my @modules = Test::UseAllModules::_get_module_list();
+  ok @modules == 3;
+  ok( !grep {$_ =~ /^under/} @modules );
+  chdir '../..';
+}
+

Added: branches/upstream/libtest-useallmodules-perl/current/t/05_except.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-useallmodules-perl/current/t/05_except.t?rev=34949&op=file
==============================================================================
--- branches/upstream/libtest-useallmodules-perl/current/t/05_except.t (added)
+++ branches/upstream/libtest-useallmodules-perl/current/t/05_except.t Fri May  8 07:30:12 2009
@@ -1,0 +1,13 @@
+use strict;
+use warnings;
+use Test::UseAllModules;
+use Test::More tests => 2;
+
+BEGIN {
+  chdir 't/MANIFESTed';
+  my @modules = Test::UseAllModules::_get_module_list( except => qr/Foo/ );
+  ok @modules == 1;
+  ok $modules[0] eq 'TestUseAllModulesTest';
+  chdir '../..';
+}
+

Added: branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/MANIFEST?rev=34949&op=file
==============================================================================
--- branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/MANIFEST (added)
+++ branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/MANIFEST Fri May  8 07:30:12 2009
@@ -1,0 +1,4 @@
+lib/TestUseAllModulesTest.pm
+lib/TestUseAllModulesTestFoo.pm
+t/lib/TestUseAllModulesTestTest.pm
+under/TestUseAllModulesUnder.pm

Added: branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/lib/TestUseAllModulesTest.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/lib/TestUseAllModulesTest.pm?rev=34949&op=file
==============================================================================
--- branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/lib/TestUseAllModulesTest.pm (added)
+++ branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/lib/TestUseAllModulesTest.pm Fri May  8 07:30:12 2009
@@ -1,0 +1,4 @@
+package #
+  TestUseAllModulesTest;
+
+1;

Added: branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/lib/TestUseAllModulesTestFoo.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/lib/TestUseAllModulesTestFoo.pm?rev=34949&op=file
==============================================================================
--- branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/lib/TestUseAllModulesTestFoo.pm (added)
+++ branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/lib/TestUseAllModulesTestFoo.pm Fri May  8 07:30:12 2009
@@ -1,0 +1,4 @@
+package #
+  TestUseAllModulesTestFoo;
+
+1;

Added: branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/t/lib/TestUseAllModulesTestTest.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/t/lib/TestUseAllModulesTestTest.pm?rev=34949&op=file
==============================================================================
--- branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/t/lib/TestUseAllModulesTestTest.pm (added)
+++ branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/t/lib/TestUseAllModulesTestTest.pm Fri May  8 07:30:12 2009
@@ -1,0 +1,4 @@
+package #
+  TestUseAllModulesTestTest;
+
+1;

Added: branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/under/TestUseAllModulesUnder.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/under/TestUseAllModulesUnder.pm?rev=34949&op=file
==============================================================================
--- branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/under/TestUseAllModulesUnder.pm (added)
+++ branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/under/TestUseAllModulesUnder.pm Fri May  8 07:30:12 2009
@@ -1,0 +1,4 @@
+package #
+  TestUseAllModulesTestUnder;
+
+1;

Modified: branches/upstream/libtest-useallmodules-perl/current/t/NoMANIFEST/lib/NeverTested.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-useallmodules-perl/current/t/NoMANIFEST/lib/NeverTested.pm?rev=34949&op=diff
==============================================================================
--- branches/upstream/libtest-useallmodules-perl/current/t/NoMANIFEST/lib/NeverTested.pm (original)
+++ branches/upstream/libtest-useallmodules-perl/current/t/NoMANIFEST/lib/NeverTested.pm Fri May  8 07:30:12 2009
@@ -1,3 +1,4 @@
-package NeverTested;
+package #
+  NeverTested;
 
 1;




More information about the Pkg-perl-cvs-commits mailing list