r35429 - in /branches/upstream/libtest-kwalitee-perl: ./ current/ current/lib/ current/lib/Test/ current/t/

roam-guest at users.alioth.debian.org roam-guest at users.alioth.debian.org
Fri May 15 09:12:29 UTC 2009


Author: roam-guest
Date: Fri May 15 09:12:22 2009
New Revision: 35429

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=35429
Log:
[svn-inject] Installing original source of libtest-kwalitee-perl

Added:
    branches/upstream/libtest-kwalitee-perl/
    branches/upstream/libtest-kwalitee-perl/current/
    branches/upstream/libtest-kwalitee-perl/current/Build.PL
    branches/upstream/libtest-kwalitee-perl/current/ChangeLog
    branches/upstream/libtest-kwalitee-perl/current/MANIFEST
    branches/upstream/libtest-kwalitee-perl/current/META.yml
    branches/upstream/libtest-kwalitee-perl/current/README
    branches/upstream/libtest-kwalitee-perl/current/lib/
    branches/upstream/libtest-kwalitee-perl/current/lib/Test/
    branches/upstream/libtest-kwalitee-perl/current/lib/Test/Kwalitee.pm
    branches/upstream/libtest-kwalitee-perl/current/t/
    branches/upstream/libtest-kwalitee-perl/current/t/01-kwalitee.t
    branches/upstream/libtest-kwalitee-perl/current/t/02-include.t
    branches/upstream/libtest-kwalitee-perl/current/t/03-exclude.t
    branches/upstream/libtest-kwalitee-perl/current/t/04-bare-include.t
    branches/upstream/libtest-kwalitee-perl/current/t/05-bare-exclude.t
    branches/upstream/libtest-kwalitee-perl/current/t/pod-coverage.t
    branches/upstream/libtest-kwalitee-perl/current/t/pod.t

Added: branches/upstream/libtest-kwalitee-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-kwalitee-perl/current/Build.PL?rev=35429&op=file
==============================================================================
--- branches/upstream/libtest-kwalitee-perl/current/Build.PL (added)
+++ branches/upstream/libtest-kwalitee-perl/current/Build.PL Fri May 15 09:12:22 2009
@@ -1,0 +1,25 @@
+#!perl
+
+BEGIN { require 5.006002 }
+use Module::Build;
+
+my $build = Module::Build->new(
+    dist_abstract => 'Test the quality of your distribution, automatically!',
+    module_name   => 'Test::Kwalitee',
+    license       => 'perl',
+    requires      =>
+    {
+        'perl'                      => '5.6.2',
+        'Test::Simple'              =>  '0.47',
+        'Module::CPANTS::Analyse'   =>  '0.82',
+    },
+    meta_merge   =>
+    {
+        resources =>
+        {
+            repository => 'http://onyxneon.svnrepository.com/svn/chromatic_cpan/trunk/Test-Kwalitee/',
+        }
+    }
+);
+
+$build->create_build_script();

Added: branches/upstream/libtest-kwalitee-perl/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-kwalitee-perl/current/ChangeLog?rev=35429&op=file
==============================================================================
--- branches/upstream/libtest-kwalitee-perl/current/ChangeLog (added)
+++ branches/upstream/libtest-kwalitee-perl/current/ChangeLog Fri May 15 09:12:22 2009
@@ -1,0 +1,27 @@
+Test::Kwalitee
+--------------
+
+1.00  Thu Aug 14 05:03:02 UTC 2008
+    - fixed code to work with modern Module::CPANTS::Analyse (Elliot Shank,
+        Xavier Caron, Heiko Eißfeldt, and probably others)
+    - removed old code I don't want to support (Makefile.PL)
+
+0.30  Fri Mar  3 19:01:56 UTC 2006
+    - fix test plan count for including and excluding tests (Chris Dolan)
+    - improve test coverage to check for that, too
+    - added signature and signature test
+
+0.20  Fri Mar  3 07:40:06 UTC 2006
+    - added documentation
+    - fixed include and exclude tests (thanks to Chris Dolan)
+    - suppress weird CPANTS warnings (they didn't think I would do it this way)
+
+0.10  Wed Feb 15 05:06:25 UTC 2006
+    - hey, this version actually works
+    - releasing to my web site, not the CPAN
+    - still needs docs and, ironically, more tests
+
+0.01  Thu Apr  7 05:57:17 UTC 2005
+    - proof of concept
+    - initial release
+    - either know what you're doing or don't use this

Added: branches/upstream/libtest-kwalitee-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-kwalitee-perl/current/MANIFEST?rev=35429&op=file
==============================================================================
--- branches/upstream/libtest-kwalitee-perl/current/MANIFEST (added)
+++ branches/upstream/libtest-kwalitee-perl/current/MANIFEST Fri May 15 09:12:22 2009
@@ -1,0 +1,13 @@
+Build.PL
+lib/Test/Kwalitee.pm
+MANIFEST			This list of files
+META.yml
+t/01-kwalitee.t
+t/02-include.t
+t/03-exclude.t
+t/04-bare-include.t
+t/05-bare-exclude.t
+t/pod.t
+t/pod-coverage.t
+README
+ChangeLog

Added: branches/upstream/libtest-kwalitee-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-kwalitee-perl/current/META.yml?rev=35429&op=file
==============================================================================
--- branches/upstream/libtest-kwalitee-perl/current/META.yml (added)
+++ branches/upstream/libtest-kwalitee-perl/current/META.yml Fri May 15 09:12:22 2009
@@ -1,0 +1,21 @@
+---
+name: Test-Kwalitee
+version: 1.01
+author: []
+abstract: 'Test the quality of your distribution, automatically!'
+license: perl
+resources:
+  license: http://dev.perl.org/licenses/
+  repository: http://onyxneon.svnrepository.com/svn/chromatic_cpan/trunk/Test-Kwalitee/
+requires:
+  Module::CPANTS::Analyse: 0.82
+  Test::Simple: 0.47
+  perl: 5.6.2
+provides:
+  Test::Kwalitee:
+    file: lib/Test/Kwalitee.pm
+    version: 1.01
+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-kwalitee-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-kwalitee-perl/current/README?rev=35429&op=file
==============================================================================
--- branches/upstream/libtest-kwalitee-perl/current/README (added)
+++ branches/upstream/libtest-kwalitee-perl/current/README Fri May 15 09:12:22 2009
@@ -1,0 +1,20 @@
+Test::Kwalitee
+--------------
+
+An automated test for signs of quality in a Perl module distribution.
+
+1.01 released Thu Aug 14 20:04:45 UTC 2008
+
+INSTALLATION
+------------
+
+    $ perl Build.PL
+    $ perl ./Build
+    $ perl ./Build test
+    $ sudo perl ./Build install
+
+COPYRIGHT
+---------
+
+Copyright 2005 - 2008, chromatic (chromatic at wgz dot org) Licensed under the
+same terms as Perl 5.8.x.

Added: branches/upstream/libtest-kwalitee-perl/current/lib/Test/Kwalitee.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-kwalitee-perl/current/lib/Test/Kwalitee.pm?rev=35429&op=file
==============================================================================
--- branches/upstream/libtest-kwalitee-perl/current/lib/Test/Kwalitee.pm (added)
+++ branches/upstream/libtest-kwalitee-perl/current/lib/Test/Kwalitee.pm Fri May 15 09:12:22 2009
@@ -1,0 +1,239 @@
+package Test::Kwalitee;
+
+use Cwd;
+use Test::Builder;
+use Module::CPANTS::Analyse;
+
+use strict;
+use warnings;
+
+use vars qw( $Test $VERSION );
+$VERSION = '1.01';
+
+BEGIN { $Test = Test::Builder->new() }
+
+my %test_types;
+BEGIN
+{
+    %test_types =
+    (
+        extractable           => 'distribution is extractable',
+        has_readme            => 'distribution has a readme file',
+        has_manifest          => 'distribution has a MANIFEST',
+        has_meta_yml          => 'distribution has a META.yml file',
+        has_buildtool         => 'distribution has a build tool file',
+        has_changelog         => 'distribution has a changelog',
+        no_symlinks           => 'distribution has no symlinks',
+        has_tests             => 'distribution has tests',
+        proper_libs           => 'distribution has proper libs',
+        no_pod_errors         => 'distribution has no POD errors',
+        use_strict            => 'distribution files all use strict',
+        has_test_pod          => 'distribution has a POD test file',
+        has_test_pod_coverage => 'distribution has a POD-coverage test file',
+    );
+
+# These three don't really work unless you have a tarball, so skip them for now
+#        extracts_nicely       => 'distribution extracts nicely',
+#        has_version           => 'distribution has a version',
+#        has_proper_version    => 'distribution has a proper version',
+
+    while (my ($subname, $diagnostic) = each %test_types)
+    {
+        my $sub = sub
+        {
+            my ($dist, $metric) = @_;
+            $Test->ok( $metric->{code}->( $dist ), $subname, $diagnostic ) ||
+                $Test->diag( @{ $metric }{qw( remedy error )} );
+        };
+
+        no strict 'refs';
+        *{ $subname } = $sub;
+    }
+}
+
+sub import
+{
+    my ($class, %args)   = @_;
+    $args{basedir}     ||= cwd();
+    $args{tests}       ||= [];
+    my @tests            = @{ $args{tests} } ?
+                           @{ $args{tests} } : keys %test_types;
+    @tests               = keys %test_types if grep { /^-/ } @tests;
+
+    my %run_tests;
+
+    for my $test ( @tests, @{ $args{tests} } )
+    {
+        if ( $test =~ s/^-// )
+        {
+            delete $run_tests{$test};
+        }
+        else
+        {
+            $run_tests{$test} = 1;
+        }
+    }
+
+    my $analyzer = Module::CPANTS::Analyse->new({
+        distdir => $args{basedir},
+        dist    => $args{basedir},
+    });
+
+    $Test->plan( tests => scalar keys %run_tests );
+
+    for my $generator (@{ $analyzer->mck()->generators() } )
+    {
+        next if $generator =~ /Unpack/;
+        next if $generator =~ /CPAN$/;
+        next if $generator =~ /Authors$/;
+
+        # no distname, so no warnings here
+        {
+            local $^W;
+            $generator->analyse($analyzer);
+        }
+
+        for my $indicator (@{ $generator->kwalitee_indicators() })
+        {
+            next unless $run_tests{ $indicator->{name} };
+            my $sub = __PACKAGE__->can( $indicator->{name} );
+            next unless $sub;
+            $sub->( $analyzer->d(), $indicator );
+        }
+    }
+}
+
+1;
+__END__
+
+=head1 NAME
+
+  Test::Kwalitee - test the Kwalitee of a distribution before you release it
+
+=head1 SYNOPSIS
+
+  # in a separate test file
+  use Test::More;
+
+  eval { require Test::Kwalitee; Test::Kwalitee->import() };
+
+  plan( skip_all => 'Test::Kwalitee not installed; skipping' ) if $@;
+
+=head1 DESCRIPTION
+
+Kwalitee is an automatically-measurable gauge of how good your software is.
+That's very different from quality, which a computer really can't measure in a
+general sense.  (If you can, you've solved a hard problem in computer science.)
+
+In the world of the CPAN, the CPANTS project (CPAN Testing Service; also a
+funny acronym on its own) measures Kwalitee with several metrics.  If you plan
+to release a distribution to the CPAN -- or even within your own organization
+-- testing its Kwalitee before creating a release can help you improve your
+quality as well.
+
+C<Test::Kwalitee> and a short test file will do this for you automatically.
+
+=head1 USAGE
+
+Create a test file as shown in the synopsis.  Run it.  It will run all of the
+potential Kwalitee tests on the current distribution, if possible.  If any
+fail, it will report those as regular diagnostics.
+
+If you ship this test and a user does not have C<Test::Kwalitee> installed,
+nothing bad will happen.
+
+To run only a handful of tests, pass their names to the module's C<import()>
+method:
+
+  eval
+  {
+      require Test::Kwalitee;
+      Test::Kwalitee->import( tests => [ qw( use_strict has_tests ) ] );
+  };
+
+To disable a test, pass its name with a leading minus (C<->) to C<import()>:
+
+  eval
+  {
+      require Test::Kwalitee;
+      Test::Kwalitee->import( tests =>
+          [ qw( -has_test_pod -has_test_pod_coverage ) ]
+      );
+  };
+
+
+
+As of version 1.00, the tests include:
+
+=over 4
+
+=item * extractable
+
+Is the distribution extractable?
+
+=item * has_readme
+
+Does the distribution have a F<README> file?
+
+=item * have_manifest
+
+Does the distribution have a F<MANIFEST>?
+
+=item * have_meta_yml
+
+Does the distribution have a F<META.yml> file?
+
+=item * have_buildtool
+
+Does the distribution have a build tool file?
+
+=item * have_changelog
+
+Does the distribution have a changelog?
+
+=item * no_symlinks
+
+Does the distribution have no symlinks?
+
+=item * have_tests
+
+Does the distribution have tests?
+
+=item * proper_libs
+
+Does the distribution have proper libs?
+
+=item * no_pod_errors
+
+Does the distribution have no POD errors?
+
+=item * use_strict
+
+Does the distribution files all use strict?
+
+=item * have_test_pod
+
+Does the distribution have a POD test file?
+
+=item * have_test_pod_coverage
+
+Does the distribution have a POD-coverage test file?
+
+=back
+
+=head1 AUTHOR
+
+chromatic, E<lt>chromatic at wgz dot orgE<gt>
+
+With thanks to CPANTS and Thomas Klausner, as well as test tester Chris Dolan.
+
+=head1 BUGS
+
+No known bugs.
+
+=head1 COPYRIGHT
+
+Copyright (c) 2005 - 2008, chromatic.  Some rights reserved.
+
+This module is free software; you can use, redistribute, and modify it under
+the same terms as Perl 5.8.x.

Added: branches/upstream/libtest-kwalitee-perl/current/t/01-kwalitee.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-kwalitee-perl/current/t/01-kwalitee.t?rev=35429&op=file
==============================================================================
--- branches/upstream/libtest-kwalitee-perl/current/t/01-kwalitee.t (added)
+++ branches/upstream/libtest-kwalitee-perl/current/t/01-kwalitee.t Fri May 15 09:12:22 2009
@@ -1,0 +1,9 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+eval { require Test::Kwalitee; Test::Kwalitee->import() };
+
+plan( skip_all => "Test::Kwalitee not installed: $@; skipping" ) if $@;

Added: branches/upstream/libtest-kwalitee-perl/current/t/02-include.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-kwalitee-perl/current/t/02-include.t?rev=35429&op=file
==============================================================================
--- branches/upstream/libtest-kwalitee-perl/current/t/02-include.t (added)
+++ branches/upstream/libtest-kwalitee-perl/current/t/02-include.t Fri May 15 09:12:22 2009
@@ -1,0 +1,14 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+eval
+{
+	require Test::Kwalitee;
+	Test::Kwalitee->import( tests => [qw( -use_strict -has_readme )] );
+};
+
+plan( skip_all => "Test::Kwalitee not installed: $@; skipping" ) if $@;

Added: branches/upstream/libtest-kwalitee-perl/current/t/03-exclude.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-kwalitee-perl/current/t/03-exclude.t?rev=35429&op=file
==============================================================================
--- branches/upstream/libtest-kwalitee-perl/current/t/03-exclude.t (added)
+++ branches/upstream/libtest-kwalitee-perl/current/t/03-exclude.t Fri May 15 09:12:22 2009
@@ -1,0 +1,20 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::Builder;
+use Test::More tests => 13;
+
+require_ok( 'Test::Kwalitee' );
+
+{
+	local *Test::Builder::plan;
+	*Test::Builder::plan = sub {};
+
+	Test::Kwalitee->import( tests => [qw( -use_strict -has_readme )] );
+}
+
+my $Test = Test::Builder->new();
+
+is( $Test->current_test(), 12, 'Explicitly excluded tests should not run' );

Added: branches/upstream/libtest-kwalitee-perl/current/t/04-bare-include.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-kwalitee-perl/current/t/04-bare-include.t?rev=35429&op=file
==============================================================================
--- branches/upstream/libtest-kwalitee-perl/current/t/04-bare-include.t (added)
+++ branches/upstream/libtest-kwalitee-perl/current/t/04-bare-include.t Fri May 15 09:12:22 2009
@@ -1,0 +1,14 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+eval
+{
+	require Test::Kwalitee;
+	Test::Kwalitee->import( tests => [qw( use_strict has_readme )] );
+};
+
+plan( skip_all => "Test::Kwalitee not installed: $@; skipping" ) if $@;

Added: branches/upstream/libtest-kwalitee-perl/current/t/05-bare-exclude.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-kwalitee-perl/current/t/05-bare-exclude.t?rev=35429&op=file
==============================================================================
--- branches/upstream/libtest-kwalitee-perl/current/t/05-bare-exclude.t (added)
+++ branches/upstream/libtest-kwalitee-perl/current/t/05-bare-exclude.t Fri May 15 09:12:22 2009
@@ -1,0 +1,14 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+eval
+{
+	require Test::Kwalitee;
+	Test::Kwalitee->import( tests => [qw( -use_strict -has_readme )] );
+};
+
+plan( skip_all => "Test::Kwalitee not installed: $@; skipping" ) if $@;

Added: branches/upstream/libtest-kwalitee-perl/current/t/pod-coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-kwalitee-perl/current/t/pod-coverage.t?rev=35429&op=file
==============================================================================
--- branches/upstream/libtest-kwalitee-perl/current/t/pod-coverage.t (added)
+++ branches/upstream/libtest-kwalitee-perl/current/t/pod-coverage.t Fri May 15 09:12:22 2009
@@ -1,0 +1,8 @@
+#!perl -T
+
+use Test::More;
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage"
+    if $@;
+plan tests => 1;
+pod_coverage_ok( 'Test::Kwalitee', { also_private => [qr/^has_/] } );

Added: branches/upstream/libtest-kwalitee-perl/current/t/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-kwalitee-perl/current/t/pod.t?rev=35429&op=file
==============================================================================
--- branches/upstream/libtest-kwalitee-perl/current/t/pod.t (added)
+++ branches/upstream/libtest-kwalitee-perl/current/t/pod.t Fri May 15 09:12:22 2009
@@ -1,0 +1,6 @@
+#!perl -T
+
+use Test::More;
+eval "use Test::Pod 1.14";
+plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
+all_pod_files_ok();




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