r36501 - in /trunk/libtest-useallmodules-perl: Changes MANIFEST META.yml debian/changelog lib/Test/UseAllModules.pm t/06_require.t
ryan52-guest at users.alioth.debian.org
ryan52-guest at users.alioth.debian.org
Wed May 27 15:34:19 UTC 2009
Author: ryan52-guest
Date: Wed May 27 15:34:14 2009
New Revision: 36501
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=36501
Log:
New upstream release
Added:
trunk/libtest-useallmodules-perl/t/06_require.t
- copied unchanged from r36500, branches/upstream/libtest-useallmodules-perl/current/t/06_require.t
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
Modified: trunk/libtest-useallmodules-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-useallmodules-perl/Changes?rev=36501&op=diff
==============================================================================
--- trunk/libtest-useallmodules-perl/Changes (original)
+++ trunk/libtest-useallmodules-perl/Changes Wed May 27 15:34:14 2009
@@ -1,4 +1,8 @@
Revision history for Perl extension Test::UseAllModules.
+
+0.12 2009/05/27
+ - silenced a warnings on require (reported by Kevin Ryde #46389)
+ - now you can do extra tests like Test::NoWarnings with all_uses_ok
0.11 2009/05/08
- Modules under arbitrary directories can be tested now.
Modified: trunk/libtest-useallmodules-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-useallmodules-perl/MANIFEST?rev=36501&op=diff
==============================================================================
--- trunk/libtest-useallmodules-perl/MANIFEST (original)
+++ trunk/libtest-useallmodules-perl/MANIFEST Wed May 27 15:34:14 2009
@@ -9,6 +9,7 @@
t/04_under.t
t/04_under_files.t
t/05_except.t
+t/06_require.t
t/99_pod.t
t/99_podcoverage.t
t/MANIFESTed/lib/TestUseAllModulesTest.pm
Modified: trunk/libtest-useallmodules-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-useallmodules-perl/META.yml?rev=36501&op=diff
==============================================================================
--- trunk/libtest-useallmodules-perl/META.yml (original)
+++ trunk/libtest-useallmodules-perl/META.yml Wed May 27 15:34:14 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Test-UseAllModules
-version: 0.11
+version: 0.12
abstract: do use_ok() for all the MANIFESTed modules
author:
- Kenichi Ishigaki <ishigaki at cpan.org>
Modified: trunk/libtest-useallmodules-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-useallmodules-perl/debian/changelog?rev=36501&op=diff
==============================================================================
--- trunk/libtest-useallmodules-perl/debian/changelog (original)
+++ trunk/libtest-useallmodules-perl/debian/changelog Wed May 27 15:34:14 2009
@@ -1,3 +1,9 @@
+libtest-useallmodules-perl (0.12-1) UNRELEASED; urgency=low
+
+ * New upstream release
+
+ -- Ryan Niebur <ryanryan52 at gmail.com> Wed, 27 May 2009 08:34:07 -0700
+
libtest-useallmodules-perl (0.11-1) unstable; urgency=low
* New upstream release
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=36501&op=diff
==============================================================================
--- trunk/libtest-useallmodules-perl/lib/Test/UseAllModules.pm (original)
+++ trunk/libtest-useallmodules-perl/lib/Test/UseAllModules.pm Wed May 27 15:34:14 2009
@@ -4,7 +4,7 @@
use warnings;
use ExtUtils::Manifest qw( maniread );
-our $VERSION = '0.11';
+our $VERSION = '0.12';
use Exporter;
@@ -13,7 +13,7 @@
use Test::More;
-my $RULE;
+my $RULE = qr{^lib/(.+)\.pm$};
sub import {
shift->export_to_level(1);
@@ -22,7 +22,7 @@
my @dirs = ('lib', @_);
my %seen;
@dirs = grep { !$seen{$_}++ } map { s|/+$||; $_ } @dirs;
- $RULE = '^(?:'.(join '|', @dirs).')/(.*)\.pm\s*$';
+ $RULE = '^(?:'.(join '|', @dirs).')/(.+)\.pm\s*$';
unshift @INC, @dirs;
}
@@ -48,19 +48,21 @@
return @modules;
}
+sub _planned { Test::More->builder->{Have_Plan}; }
+
sub all_uses_ok {
unless (-f 'MANIFEST') {
- plan skip_all => 'no MANIFEST';
- exit;
+ plan skip_all => 'no MANIFEST' unless _planned();
+ return;
}
my @modules = _get_module_list(@_);
unless (@modules) {
- plan skip_all => 'no .pm files are found under the lib directory';
- exit;
+ plan skip_all => 'no .pm files are found under the lib directory' unless _planned();
+ return;
}
- plan tests => scalar @modules;
+ plan tests => scalar @modules unless _planned();
my @failed;
foreach my $module (@modules) {
@@ -107,7 +109,7 @@
I'm sick of writing 00_load.t (or something like that) that'll do use_ok() for every module I write. I'm sicker of updating 00_load.t when I add another file to the distro. This module reads MANIFEST to find modules to be tested and does use_ok() for each of them. Now all you have to do is update MANIFEST. You don't have to modify the test any more (hopefully).
-=head1 EXPORTED FUNCTIONS
+=head1 EXPORTED FUNCTION
=head2 all_uses_ok
@@ -115,9 +117,29 @@
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 PROTECTED FUNCTION
+
+=head2 _get_module_list
+
+Returns module paths to test. This function will not be exported. If you want to use this (see below), you always need to call it by the full qualified name.
+
=head1 NOTES
As of 0.03, this module calls BAIL_OUT of Test::More if any of the use_ok tests should fail. (Thus the following tests will be ignored. Missing or unloadable modules cause a lot of errors of the same kind.)
+
+As of 0.12, you can add extra tests before/after all_uses_ok() if you explicitly declare test plan like this.
+
+ use strict;
+ use warnings;
+ use Test::More;
+ use Test::UseAllModules;
+ use Test::NoWarnings;
+
+ plan tests => Test::UseAllModules::_get_module_list() + 1;
+
+ all_uses_ok();
+
+ # and extra nowarnings test
=head1 SEE ALSO
More information about the Pkg-perl-cvs-commits
mailing list