r34951 - in /trunk/libtest-useallmodules-perl: Changes MANIFEST META.yml debian/changelog lib/Test/UseAllModules.pm t/04_under.t t/04_under_files.t t/05_except.t t/MANIFESTed/ t/NoMANIFEST/lib/NeverTested.pm
ryan52-guest at users.alioth.debian.org
ryan52-guest at users.alioth.debian.org
Fri May 8 07:31:35 UTC 2009
Author: ryan52-guest
Date: Fri May 8 07:31:30 2009
New Revision: 34951
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=34951
Log:
New upstream release
Added:
trunk/libtest-useallmodules-perl/t/04_under.t
- copied unchanged from r34950, branches/upstream/libtest-useallmodules-perl/current/t/04_under.t
trunk/libtest-useallmodules-perl/t/04_under_files.t
- copied unchanged from r34950, branches/upstream/libtest-useallmodules-perl/current/t/04_under_files.t
trunk/libtest-useallmodules-perl/t/05_except.t
- copied unchanged from r34950, branches/upstream/libtest-useallmodules-perl/current/t/05_except.t
trunk/libtest-useallmodules-perl/t/MANIFESTed/
- copied from r34950, branches/upstream/libtest-useallmodules-perl/current/t/MANIFESTed/
Modified:
trunk/libtest-useallmodules-perl/Changes
trunk/libtest-useallmodules-perl/MANIFEST
trunk/libtest-useallmodules-perl/META.yml
trunk/libtest-useallmodules-perl/debian/changelog
trunk/libtest-useallmodules-perl/lib/Test/UseAllModules.pm
trunk/libtest-useallmodules-perl/t/NoMANIFEST/lib/NeverTested.pm
Modified: trunk/libtest-useallmodules-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-useallmodules-perl/Changes?rev=34951&op=diff
==============================================================================
--- trunk/libtest-useallmodules-perl/Changes (original)
+++ trunk/libtest-useallmodules-perl/Changes Fri May 8 07:31:30 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: trunk/libtest-useallmodules-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-useallmodules-perl/MANIFEST?rev=34951&op=diff
==============================================================================
--- trunk/libtest-useallmodules-perl/MANIFEST (original)
+++ trunk/libtest-useallmodules-perl/MANIFEST Fri May 8 07:31:30 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: trunk/libtest-useallmodules-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-useallmodules-perl/META.yml?rev=34951&op=diff
==============================================================================
--- trunk/libtest-useallmodules-perl/META.yml (original)
+++ trunk/libtest-useallmodules-perl/META.yml Fri May 8 07:31:30 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: trunk/libtest-useallmodules-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-useallmodules-perl/debian/changelog?rev=34951&op=diff
==============================================================================
--- trunk/libtest-useallmodules-perl/debian/changelog (original)
+++ trunk/libtest-useallmodules-perl/debian/changelog Fri May 8 07:31:30 2009
@@ -1,3 +1,9 @@
+libtest-useallmodules-perl (0.11-1) UNRELEASED; urgency=low
+
+ * New upstream release
+
+ -- Ryan Niebur <ryanryan52 at gmail.com> Fri, 08 May 2009 00:31:21 -0700
+
libtest-useallmodules-perl (0.10-1) unstable; urgency=low
* Initial Release. (Closes: #526247)
Modified: trunk/libtest-useallmodules-perl/lib/Test/UseAllModules.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-useallmodules-perl/lib/Test/UseAllModules.pm?rev=34951&op=diff
==============================================================================
--- trunk/libtest-useallmodules-perl/lib/Test/UseAllModules.pm (original)
+++ trunk/libtest-useallmodules-perl/lib/Test/UseAllModules.pm Fri May 8 07:31:30 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
Modified: trunk/libtest-useallmodules-perl/t/NoMANIFEST/lib/NeverTested.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-useallmodules-perl/t/NoMANIFEST/lib/NeverTested.pm?rev=34951&op=diff
==============================================================================
--- trunk/libtest-useallmodules-perl/t/NoMANIFEST/lib/NeverTested.pm (original)
+++ trunk/libtest-useallmodules-perl/t/NoMANIFEST/lib/NeverTested.pm Fri May 8 07:31:30 2009
@@ -1,3 +1,4 @@
-package NeverTested;
+package #
+ NeverTested;
1;
More information about the Pkg-perl-cvs-commits
mailing list