When using this module in a test script, it goes through all the modules in your distribution, checks their POD, checks that they compile ok and checks that they all define the same $VERSION.

It defines its own testing plan, so you usually don't use it in conjunction with other Test::* modules in the same file. It's recommended that you just create a one-line test script as shown in the SYNOPSIS above. However, there are options...

Specifies that only certain sets of tests are to be run. Possible values are those mentioned in TEST TYPES below. For example, if you only want to run the POD tests, you could say:

use Test::Distribution only => 'pod';

To specify that you only want to run the POD tests and the use tests, and also that you are going to run two tests of your own, use:

use Test::Distribution
only => [ qw/pod use/ ],
tests => 2;

Note that when you specify the versions option, the use option is automatically added. This is because in order to get a module's $VERSION, it has to be loaded. In this case we might as well run a use test.

The value for only can be a string or a reference to a list of strings.

Specifies that certain types of tests should not be run. All tests not mentioned in this argument are run. For example, if you want to test everything except the POD, use:

use Test::Distribution
not => 'pod';

The value for not can be a string or a reference to a list of strings. Although it doesn't seem to make much sense, you can use both only and not. In this case only the tests specified in only, but not not are run (if this makes any sense).

Test::Distribution uses File::Find::Rule and Test::Pod, amongst other modules. Each of these modules have their own rather long list of prerequisites. If you use the CPAN shell or a package manager to install modules, this is probably of no concern, but if you install modules manually, you might not care to install a lot of modules just to get Test::Distribution to run.

Because of this, Test::Distribution checks whether you have the required modules installed and skips tests (per Test::More definition) as necessary if these modules are not found. If you don't have Test::Pod, you can't run the pod tests. If you don't have Module::CoreList, you can't run the prereq tests. But if you don't have File::Find::Rule, all tests are skipped.

This is a list of packages that have been found. That is, we assume that each file contains a package of the name indicated by the file's relative position. For example, a file in blib/lib/Foo/Bar.pm is expected to be available via use Foo::Bar.