The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::Kwalitee - test the Kwalitee of a distribution before you release it

VERSION

version 1.08

SYNOPSIS

  # in a separate test file

  BEGIN {
      unless ($ENV{RELEASE_TESTING})
      {
          use Test::More;
          plan(skip_all => 'these tests are for release candidate testing');
      }
  }

  use Test::Kwalitee;

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.

Test::Kwalitee and a short test file will do this for you automatically.

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, it will not run for anyone else, because of the RELEASE_TESTING guard. (You can omit this guard if you move the test to xt/release/, which is not run automatically by other users.)

To run only a handful of tests, pass their names to the module in the test argument (either in the use directive, or when calling import() directly):

  use Test::Kwalitee tests => [ qw( use_strict has_tests ) ];

To disable a test, pass its name with a leading minus (-):

  use Test::Kwalitee tests => [ qw( -has_test_pod -has_test_pod_coverage ));

As of version 1.00, the tests include:

  • extractable

    This test does nothing without a tarball; it will be removed in a subsequent version.

  • has_buildtool

    Does the distribution have a build tool file?

  • has_changelog

    Does the distribution have a changelog?

  • has_manifest

    Does the distribution have a MANIFEST?

  • has_meta_yml

    Does the distribution have a META.yml file?

  • has_readme

    Does the distribution have a README file?

  • has_tests

    Does the distribution have tests?

  • no_symlinks

    Does the distribution have no symlinks?

  • proper_libs

    Does the distribution have proper libs?

  • no_pod_errors

    Does the distribution have no POD errors?

  • has_test_pod

    Does the distribution have a test for pod correctness? (Note that this is a bad test to include in a distribution where it will be run by users; this check will be removed in a subsequent version.)

  • has_test_pod_coverage

    Does the distribution have a test for pod coverage? (This test will be removed in a subsequent version; see has_test_pod above.)

  • use_strict

    Does the distribution files all use strict?

ACKNOWLEDGEMENTS

With thanks to CPANTS and Thomas Klausner, as well as test tester Chris Dolan.

SEE ALSO

AUTHOR

chromatic <chromatic@wgz.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2005 by chromatic.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

CONTRIBUTORS

  • Gavin Sherlock <sherlock@cpan.org>

  • Karen Etheridge <ether@cpan.org>

  • Kenichi Ishigaki <ishigaki@cpan.org>

  • Nathan Haigh <nathanhaigh@ukonline.co.uk>