r71808 - in /branches/upstream/libtest-pod-content-perl: ./ current/ current/lib/ current/lib/Test/ current/lib/Test/Pod/ current/t/
roam-guest at users.alioth.debian.org
roam-guest at users.alioth.debian.org
Mon Mar 21 09:40:27 UTC 2011
Author: roam-guest
Date: Mon Mar 21 09:40:11 2011
New Revision: 71808
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=71808
Log:
[svn-inject] Installing original source of libtest-pod-content-perl (0.0.5)
Added:
branches/upstream/libtest-pod-content-perl/
branches/upstream/libtest-pod-content-perl/current/
branches/upstream/libtest-pod-content-perl/current/Build.PL
branches/upstream/libtest-pod-content-perl/current/Changes
branches/upstream/libtest-pod-content-perl/current/HACKING
branches/upstream/libtest-pod-content-perl/current/MANIFEST
branches/upstream/libtest-pod-content-perl/current/META.yml
branches/upstream/libtest-pod-content-perl/current/Makefile.PL
branches/upstream/libtest-pod-content-perl/current/README
branches/upstream/libtest-pod-content-perl/current/lib/
branches/upstream/libtest-pod-content-perl/current/lib/Test/
branches/upstream/libtest-pod-content-perl/current/lib/Test/Pod/
branches/upstream/libtest-pod-content-perl/current/lib/Test/Pod/Content.pm
branches/upstream/libtest-pod-content-perl/current/t/
branches/upstream/libtest-pod-content-perl/current/t/096_characters.t
branches/upstream/libtest-pod-content-perl/current/t/097_kwalitee.t
branches/upstream/libtest-pod-content-perl/current/t/098_pod.t
branches/upstream/libtest-pod-content-perl/current/t/099_pod_coverage.t
branches/upstream/libtest-pod-content-perl/current/t/critic.t
branches/upstream/libtest-pod-content-perl/current/t/license.t
branches/upstream/libtest-pod-content-perl/current/t/perlcriticrc
branches/upstream/libtest-pod-content-perl/current/t/synopsis.t
Added: branches/upstream/libtest-pod-content-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/Build.PL?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/Build.PL (added)
+++ branches/upstream/libtest-pod-content-perl/current/Build.PL Mon Mar 21 09:40:11 2011
@@ -1,0 +1,16 @@
+use strict; use warnings;
+use Module::Build;
+Module::Build->new(
+ dist_author => 'Martin Kutter <martin.kutter at fen-net.de>',
+ create_makefile_pl => 'passthrough',
+ dist_abstract => 'Test Pod content',
+ dist_name => 'Test-Pod-Content',
+ version_from => 'Test::Pod::Content',
+ module_name => 'Test::Pod::Content',
+ license => 'artistic',
+ requires => {
+ 'version' => 0,
+ 'Test::More' => 0,
+ 'Pod::Simple' => 0,
+ }
+)->create_build_script;
Added: branches/upstream/libtest-pod-content-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/Changes?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/Changes (added)
+++ branches/upstream/libtest-pod-content-perl/current/Changes Mon Mar 21 09:40:11 2011
@@ -1,0 +1,19 @@
+0.0.5
+- added kwalitee tests to MANIFEST
+- fixed version string error
+
+0.0.4
+- added kwalitee tests
+- fixed a POD error
+
+0.0.3
+- added "version" to prereqs
+- added .perlcriticrc
+- updated docs and code to allow perlcritic -1 to pass (with .perlcriticrc)
+
+0.0.2 - Dec 25 2007
+- updated tests
+- updated docs
+
+0.0.1 - Dec 22 2007
+- first (unreleased) version
Added: branches/upstream/libtest-pod-content-perl/current/HACKING
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/HACKING?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/HACKING (added)
+++ branches/upstream/libtest-pod-content-perl/current/HACKING Mon Mar 21 09:40:11 2011
@@ -1,0 +1,46 @@
+HACKING Test::Pod::Content
+--------------------------
+
+VCS
+---
+
+Test::Pod::Content uses a Subversion repository at
+
+http://svn.hyper-framework.org/Hyper/Test-Pod-Content/
+
+Developer (commit) SVN access is restricted, but you may use the SVN version
+for generating patches.
+
+Patches should be generated as unified diff (svn can do this for you - try
+svn help diff or just say 'svn diff --old .' in your Test::Pod::Content
+working dir. You'll have to say 'svn add FILENAME' for new files before,
+and 'svn revert FILENAME' afterwards).
+
+CODING STYLE
+------------
+
+Test modules require a high quality coding style, so Test::Pod::Content does
+it's best to comply to the style laid out in Perl Best Practices by Damian
+Conway.
+
+As always, there's a few exceptions:
+
+ * The use of $@ is allowed for simplicity
+ "use English" can induce subtle misbehaviours, and $@ really is a well-known
+ variable.
+
+ * The use of "die" is allowed, because Test::Pod::Content never dies to
+ signal errors, but only to (reliably) terminate a Pod Parser run.
+ It's pretty useless to croak on an exception that get's caught anyway.
+ There are some die statements which might not get caught, but these are just
+ re-throwing previously-throwed exceptions.
+
+The exceptions are configured in t/perlcriticrc.
+
+The module may be criticised via
+
+ perlcritic -profile t/perlcriticrc lib
+
+December 2007
+
+Martin Kutter
Added: branches/upstream/libtest-pod-content-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/MANIFEST?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/MANIFEST (added)
+++ branches/upstream/libtest-pod-content-perl/current/MANIFEST Mon Mar 21 09:40:11 2011
@@ -1,0 +1,16 @@
+Build.PL
+Changes
+HACKING
+lib/Test/Pod/Content.pm
+Makefile.PL
+MANIFEST This list of files
+META.yml
+README
+t/096_characters.t
+t/097_kwalitee.t
+t/098_pod.t
+t/099_pod_coverage.t
+t/critic.t
+t/license.t
+t/perlcriticrc
+t/synopsis.t
Added: branches/upstream/libtest-pod-content-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/META.yml?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/META.yml (added)
+++ branches/upstream/libtest-pod-content-perl/current/META.yml Mon Mar 21 09:40:11 2011
@@ -1,0 +1,21 @@
+---
+name: Test-Pod-Content
+version: 0.0.5
+author:
+ - 'Martin Kutter <martin.kutter at fen-net.de>'
+abstract: Test Pod content
+license: artistic
+resources:
+ license: http://opensource.org/licenses/artistic-license.php
+requires:
+ Pod::Simple: 0
+ Test::More: 0
+ version: 0
+provides:
+ Test::Pod::Content:
+ file: lib/Test/Pod/Content.pm
+ version: 0.0.5
+generated_by: Module::Build version 0.2808
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.2.html
+ version: 1.2
Added: branches/upstream/libtest-pod-content-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/Makefile.PL?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/Makefile.PL (added)
+++ branches/upstream/libtest-pod-content-perl/current/Makefile.PL Mon Mar 21 09:40:11 2011
@@ -1,0 +1,31 @@
+# Note: this file was auto-generated by Module::Build::Compat version 0.03
+
+ unless (eval "use Module::Build::Compat 0.02; 1" ) {
+ print "This module requires Module::Build to install itself.\n";
+
+ require ExtUtils::MakeMaker;
+ my $yn = ExtUtils::MakeMaker::prompt
+ (' Install Module::Build now from CPAN?', 'y');
+
+ unless ($yn =~ /^y/i) {
+ die " *** Cannot install without Module::Build. Exiting ...\n";
+ }
+
+ require Cwd;
+ require File::Spec;
+ require CPAN;
+
+ # Save this 'cause CPAN will chdir all over the place.
+ my $cwd = Cwd::cwd();
+
+ CPAN::Shell->install('Module::Build::Compat');
+ CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
+ or die "Couldn't install Module::Build, giving up.\n";
+
+ chdir $cwd or die "Cannot chdir() back to $cwd: $!";
+ }
+ eval "use Module::Build::Compat 0.02; 1" or die $@;
+
+ Module::Build::Compat->run_build_pl(args => \@ARGV);
+ require Module::Build;
+ Module::Build::Compat->write_makefile(build_class => 'Module::Build');
Added: branches/upstream/libtest-pod-content-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/README?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/README (added)
+++ branches/upstream/libtest-pod-content-perl/current/README Mon Mar 21 09:40:11 2011
@@ -1,0 +1,25 @@
+Test::Pod::Content readme
+-------------------------
+
+Test::Pod::Content is a simple test module for testing a pod's content.
+
+INSTALLING
+----------
+
+ perl Build.PL
+ perl Build
+ perl Build test
+ perl Build install
+
+EXAMPLES
+--------
+
+For examples on Test::Pod::Content's usage, see the test files provided.
+
+They test Test::Pod::Content's own Pod using Test::Pod::Content.
+
+LICENSE
+-------
+
+This library is free software - you may distribute/modify it under the same
+terms as perl itself.
Added: branches/upstream/libtest-pod-content-perl/current/lib/Test/Pod/Content.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/lib/Test/Pod/Content.pm?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/lib/Test/Pod/Content.pm (added)
+++ branches/upstream/libtest-pod-content-perl/current/lib/Test/Pod/Content.pm Mon Mar 21 09:40:11 2011
@@ -1,0 +1,262 @@
+package Test::Pod::Content;
+use strict;
+use warnings;
+use base qw(Pod::Simple Test::More);
+use Exporter;
+use version; our $VERSION = qv('0.0.5');
+
+our @EXPORT = qw(pod_section_is pod_section_like);
+
+# Globals for running a simple state machine
+my $_state = q{};
+my $_section = q{};
+my $_content = q{};
+my $_test_content_sub;
+
+# cleanup everything once we've run our test
+sub _reset {
+ my $parser = shift;
+ $_state = q{};
+ $_section = q{};
+ $_content = q{};
+
+ # source_dead is not reliable - just die to force terminating the
+ # parser run
+ $parser->source_dead(1);
+ die "OK\n";
+}
+
+sub pod_section_is {
+ my ($name, $section, $content, $comment ) = @_;
+
+ my $found = 0;
+
+ $_test_content_sub = sub {
+ my ($parser, $section_name, $test_content) = @_;
+ if ($section_name eq $section) {
+ $found++;
+ Test::More::is($test_content, $content, $comment);
+ _reset($parser);
+ }
+ };
+
+ eval { Test::Pod::Content->filter( _find_file($name) ) };
+ if ($@) { die $@ if ($@ !~m{^OK\n$}xm) };
+
+ if (not $found) {
+ Test::More::fail $comment;
+ }
+ return;
+}
+
+sub pod_section_like {
+ my ($name, $section, $regex, $comment ) = @_;
+
+ my $found = 0;
+
+ $_test_content_sub = sub {
+ my ($parser, $section_name, $test_content) = @_;
+ if ($section_name eq $section) {
+ $found++;
+ Test::More::like($test_content, $regex, $comment);
+ _reset($parser);
+ }
+ };
+
+ eval { Test::Pod::Content->filter( _find_file($name) ) };
+ if ($@) { die $@ if ($@ !~m{^OK\n$}xm) };
+
+ if (not $found) {
+ Test::More::fail $comment;
+ }
+ return;
+}
+
+sub _find_file {
+ my $name = shift;
+ return $name if (-e $name);
+ for my $path (@INC) {
+ return "$path/$name" if -e "$path/$name";
+ }
+ $name =~s{::}{/}xmg;
+ $name .= '.pm';
+ for my $path (@INC) {
+ return "$path/$name" if -e "$path/$name";
+ }
+ return;
+}
+
+sub _handle_element_start {
+ my($parser, $element_name, $attr_hash_r) = @_;
+ # print "START $element_name\n";
+ if ($element_name =~m{^head\d$}xm) {
+ # Test last section's content on every new section
+ $_test_content_sub->($parser, $_section, $_content);
+ $_state = 'section';
+ $_content = q{};
+ }
+ return;
+}
+
+sub _handle_element_end {
+ my($parser, $element_name) = @_;
+ # print "END $element_name\n";
+ if ($element_name =~m{^Document$}xm) {
+ $_test_content_sub->($parser, $_section, $_content);
+ }
+ return;
+}
+
+sub _handle_text {
+ my($parser, $text) = @_;
+ # print "TEXT $text\n";
+ if ($_state eq 'section') {
+ $_section = $text;
+ $_state = 'section_content_start';
+ return;
+ }
+ if ($_state eq 'section_content_start') {
+ $_content .= $text;
+ }
+ return;
+}
+
+
+1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Test::Pod::Content - Test a Pod's content
+
+=head1 SYNOPSIS
+
+ use Test::Pod::Content tests => 3;
+ pod_section_is 'Test::Pod::Content' , 'NAME', "Test::Pod::Content - Test a Pod's content", 'NAME section';
+ pod_section_like 'Test/Pod/Content.pm', 'SYNOPSIS', qr{ use \s Test::Pod::Content; }xm, 'SYNOPSIS section';
+ pod_section_like 'Test/Pod/Content.pm', 'DESCRIPTION', qr{ Test::Pod::Content \s provides \s the }xm, 'DESCRIPTION section';
+
+=head1 DESCRIPTION
+
+This is a very simple module for testing a Pod's content. It is mainly
+intended for testing the content of generated Pod - that is, the Pod included
+in perl modules generated by some mechanism.
+
+Another usage example is to test whether all files contain the same copyright
+notice:
+
+=for test
+
+ plan tests => scalar @filelist;
+
+ for my $file (sort @filelist) {
+ pod_section_like( $file, 'LICENSE AND COPYRIGHT', qr{
+ This \s library \s is \s free \s software\. \s
+ You \s may \s distribute/modify \s it \s under \s
+ the \s same \s terms \s as \s perl \s itself
+ }xms, "$file License notice");
+ }
+
+See the files in the t/ directory for live examples.
+
+Test::Pod::Content has a very simple concept of Pods: To Test::Pod::Content, a
+Pod is separated into section. Each section starts with a =head(1|2|3|4)
+directive, and ends with the next =head, or with the end of the document
+(=cut).
+
+This is a very drastic simplification of Pod's document object model, and only
+allows for coarse-grained tests.
+
+Test::Pod::Content provides the following subroutines for testing a Pod's content:
+
+=head1 SUBROUTINES/METHODS
+
+=head2 pod_section_is
+
+ pod_section_is $file, $section, $content, $comment;
+
+Tests whether a Pod section contains exactly the text given. Most useful
+for testing the NAME section. You probably want to use pod_section_like
+for all other sections.
+
+$file may either be a filename (including path) or a module name.
+Test::Pod::Content will search in @INC for the file/module given.
+
+=head2 pod_section_like
+
+ pod_section_like $file, $section, qr{ use \s Test::Pod::Content\s }xm, $comment;
+
+Tests whether the text in a Pod section matches the given regex. Be sure to
+include the m / s regex qualifier if you expect your Pod section to span
+multiple lines.
+
+$file may either be a filename (including path) or a module name.
+Test::Pod::Content will search in @INC for the file/module given.
+
+=head1 BUGS AND LIMITATIONS
+
+=over
+
+=item * Performance
+
+Every call to a pod_section_* method searches for the file in question in
+ at INC and parses it from its start. This means that every test requires
+a Pod parser run, which is quite inefficient if you conduct a big number of
+tests.
+
+=item * Pod Syntax
+
+Test::Pod::Coverage may report wrong test results if your pod is not
+syntactically correct. You should use L<Test::Pod|Test::Pod> to check your
+Pod's syntax.
+
+=back
+
+=head1 DEPENDENCIES
+
+L<Test::More|Test::More>
+
+L<Pod::Simple|Pod::Simple>
+
+L<version|version>
+
+=head1 INCOMPATIBILITIES
+
+None known
+
+=head1 SEE ALSO
+
+L<Test::Pod|Test::Pod> for testing your POD's validity
+
+L<Test::Pod::Coverage|Test::Pod::Coverage> for checking wether your pod is
+complete
+
+L<Pod::Tests|Pod::Tests>, L<Test::Pod::Snippets|Test::Pod::Snippets> and
+L<Pod::Snippets|Pod::Snippets> for extracting and executing tests from a POD
+(If you plan doing so, here's a little brain-train: Which of the
+tests in this module's L</SYNOPSIS> section would fail if you extracted and
+executed it?).
+
+=head1 LICENSE AND COPYRIGHT
+
+Copyright 2007 Martin Kutter.
+
+This library is free software. You may distribute/modify it under
+the same terms as perl itself
+
+=head1 AUTHOR
+
+Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
+
+=head1 REPOSITORY INFORMATION
+
+ $Id: Content.pm 504 2008-06-19 18:45:05Z kutterma $
+ $Revision: 504 $
+ $Source: a $
+ $Date: 2008-06-19 20:45:05 +0200 (Do, 19 Jun 2008) $
+ $HeadURL: http://svn.hyper-framework.org/Hyper/Test-Pod-Content/trunk/lib/Test/Pod/Content.pm $
+
+=cut
Added: branches/upstream/libtest-pod-content-perl/current/t/096_characters.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/t/096_characters.t?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/t/096_characters.t (added)
+++ branches/upstream/libtest-pod-content-perl/current/t/096_characters.t Mon Mar 21 09:40:11 2011
@@ -1,0 +1,74 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+use Test::More;
+use English qw(-no_match_vars);
+use File::Find;
+use IO::File;
+
+
+if ( not $ENV{RELEASE_TESTING} ) {
+ my $msg = 'Author test. Set $ENV{RELEASE_TESTING} to a true value to run.';
+ plan( skip_all => $msg );
+}
+my $dir = 'blib/lib';
+if (-d '../t') {
+ $dir = '../lib';
+}
+
+my @filelist = ();
+find( \&filelist, $dir);
+
+sub filelist {
+ my $name = $_;
+ return if -d $name;
+ return if $File::Find::name =~ m{\.(?:c|o|svn)$}x;
+
+ push @filelist, $File::Find::name;
+}
+
+plan tests => scalar @filelist;
+
+for my $file (sort @filelist) {
+
+ check_file($file);
+}
+
+sub check_file {
+ my $file = shift;
+ my $fh = IO::File->new($file, O_RDONLY) or die "Cannot open $file";
+ my $line_nr = 0;
+ my $error_count = 0;
+
+ while (my $line = $fh->getline() ) {
+ # check for trailing whitespace
+ # allow single whitespace on line to allow
+ # pod source blocks with empty lines
+ #
+ $line_nr++;
+ if ($line =~m{ (:?[^\s]+|\s)\s\r?\n$ }x) {
+ $error_count++;
+ print "# trailing whitespace in $file line $line_nr at end of line\n"
+ }
+
+ # check for tabs and report their position
+ my @tab_pos_from = ();
+ my $pos = -1;
+ while (1) {
+ $pos = index($line, "\t", $pos + 1);
+ last if $pos <0;
+ push @tab_pos_from, $pos + 1;
+ }
+ if (@tab_pos_from) {
+ print "# tab found in $file line $line_nr cols ${ \join(', ', @tab_pos_from) }\n";
+ $error_count += scalar(@tab_pos_from);
+ }
+
+ if ($line=~m{\r}) {
+ print "# CR (\\r) found in $file line $line_nr. Convert to LF only.\n";
+ $error_count++;
+ }
+ }
+ is $error_count, 0 , "$file characters";
+}
Added: branches/upstream/libtest-pod-content-perl/current/t/097_kwalitee.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/t/097_kwalitee.t?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/t/097_kwalitee.t (added)
+++ branches/upstream/libtest-pod-content-perl/current/t/097_kwalitee.t Mon Mar 21 09:40:11 2011
@@ -1,0 +1,21 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+use English qw(-no_match_vars);
+
+if ( not $ENV{RELEASE_TESTING} ) {
+ my $msg = 'Author test. Set $ENV{RELEASE_TESTING} to a true value to run.';
+ plan( skip_all => $msg );
+}
+
+chdir '..' if -d ('../t');
+
+eval 'use Test::Kwalitee';
+
+if ( $EVAL_ERROR ) {
+ my $msg = 'Test::Kwalitee not installed; skipping';
+ plan( skip_all => $msg );
+}
Added: branches/upstream/libtest-pod-content-perl/current/t/098_pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/t/098_pod.t?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/t/098_pod.t (added)
+++ branches/upstream/libtest-pod-content-perl/current/t/098_pod.t Mon Mar 21 09:40:11 2011
@@ -1,0 +1,25 @@
+use Test::More;
+
+if ( not $ENV{RELEASE_TESTING} ) {
+ my $msg = 'Author test. Set $ENV{RELEASE_TESTING} to a true value to run.';
+ plan( skip_all => $msg );
+}
+
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+
+my @dir_from = ();
+if (!$ENV{HARNESS_ACTIVE}) {
+ # perl Build test or make test run from top-level dir.
+ if ( -d '../t/' ) {
+ @dir_from = ('../lib/');
+ }
+}
+
+my @files = all_pod_files(@dir_from);
+
+plan tests => scalar(@files);
+
+foreach my $module (@files){
+ pod_file_ok( $module )
+}
Added: branches/upstream/libtest-pod-content-perl/current/t/099_pod_coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/t/099_pod_coverage.t?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/t/099_pod_coverage.t (added)
+++ branches/upstream/libtest-pod-content-perl/current/t/099_pod_coverage.t Mon Mar 21 09:40:11 2011
@@ -1,0 +1,30 @@
+use Test::More;
+
+if ( not $ENV{RELEASE_TESTING} ) {
+ my $msg = 'Author test. Set $ENV{RELEASE_TESTING} to a true value to run.';
+ plan( skip_all => $msg );
+}
+
+eval "use Test::Pod::Coverage 1.00";
+plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD" if $@;
+
+my @dirs = ( 'lib' );
+if (-d '../t/') { # we are inside t/
+ @dirs = ('../lib');
+}
+else { # we are outside t/
+ # add ./lib to include path if blib/lib is not there (e.g. we're not
+ # run from Build test or the like)
+ push @INC, './lib' if not grep { $_ eq 'blib/lib' } @INC;
+}
+
+my @files = all_modules( @dirs );
+plan tests => scalar @files;
+foreach (@files) {
+ pod_coverage_ok( $_ ,
+ {
+ private => [
+ qr/^_/,
+ ]
+ });
+}
Added: branches/upstream/libtest-pod-content-perl/current/t/critic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/t/critic.t?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/t/critic.t (added)
+++ branches/upstream/libtest-pod-content-perl/current/t/critic.t Mon Mar 21 09:40:11 2011
@@ -1,0 +1,21 @@
+eval {
+ require Test::Perl::Critic;
+ Test::Perl::Critic::import('Test::Perl::Critic',
+ -profile => 't/perlcriticrc', -serverity => 1
+ );
+};
+if ($@) {
+ require Test::More;
+ Test::More::plan(
+ skip_all => 'Test::Critic required for testing criticism'
+ );
+}
+if (-d 't/') {
+ all_critic_ok();
+}
+else {
+ # chdir .. is stupid, but the profile has to be given
+ # as argument to import and is loaded in all_critic_ok...
+ chdir '..';
+ all_critic_ok('lib');
+}
Added: branches/upstream/libtest-pod-content-perl/current/t/license.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/t/license.t?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/t/license.t (added)
+++ branches/upstream/libtest-pod-content-perl/current/t/license.t Mon Mar 21 09:40:11 2011
@@ -1,0 +1,14 @@
+use strict; use warnings;
+use Test::More;
+use Test::Pod::Content;
+my @filelist = qw( Test::Pod::Content );
+
+plan( tests => scalar @filelist);
+
+ for my $file (sort @filelist) {
+ pod_section_like( $file, 'LICENSE AND COPYRIGHT', qr{
+ This \s library \s is \s free \s software\. \s
+ You \s may \s distribute/modify \s it \s under \s
+ the \s same \s terms \s as \s perl \s itself
+ }xms, "$file License notice");
+ }
Added: branches/upstream/libtest-pod-content-perl/current/t/perlcriticrc
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/t/perlcriticrc?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/t/perlcriticrc (added)
+++ branches/upstream/libtest-pod-content-perl/current/t/perlcriticrc Mon Mar 21 09:40:11 2011
@@ -1,0 +1,14 @@
+# Disable checking for automatic exports, as it is part of
+# Test:: module's API...
+[-Perl::Critic::Policy::Modules::ProhibitAutomaticExportation]
+
+# Disable requiring to croak, as we always catch, or re-throw
+[-ErrorHandling::RequireCarping]
+
+# allow_messages_ending_with_newlines = 0
+[Variables::ProhibitPunctuationVars]
+allow = $@
+
+[Documentation::RequirePodSections]
+lib_sections = NAME | SYNOPSIS | DESCRIPTION | SUBROUTINES/METHODS | DEPENDENCIES | BUGS AND LIMITATIONS | LICENSE AND COPYRIGHT | AUTHOR
+script_sections = NAME | USAGE | OPTIONS | EXIT STATUS | AUTHOR
Added: branches/upstream/libtest-pod-content-perl/current/t/synopsis.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-content-perl/current/t/synopsis.t?rev=71808&op=file
==============================================================================
--- branches/upstream/libtest-pod-content-perl/current/t/synopsis.t (added)
+++ branches/upstream/libtest-pod-content-perl/current/t/synopsis.t Mon Mar 21 09:40:11 2011
@@ -1,0 +1,6 @@
+use strict; use warnings;
+use lib '../lib';
+use Test::Pod::Content tests => 3;
+pod_section_is 'Test::Pod::Content' , 'NAME', "Test::Pod::Content - Test a Pod's content", 'NAME section';
+pod_section_like 'Test/Pod/Content.pm', 'SYNOPSIS', qr{ use \s Test::Pod::Content }xm, 'SYNOPSIS section';
+pod_section_like 'Test/Pod/Content.pm', 'DESCRIPTION', qr{ Test::Pod::Content \s provides \s the }xm, 'DESCRIPTION section';
More information about the Pkg-perl-cvs-commits
mailing list