VERSION

Version 1.009 ($Id: DistManifest.pm 10671 2009-12-29 01:49:23Z [email protected] $)

EXPORTS

By default, this module exports the following functions:

  • manifest_ok

DESCRIPTION

This module provides a simple method of testing that a \s-1MANIFEST\s0 matches the distribution.

It tests three things:

1.

Everything in \s-1MANIFEST\s0 exists

2.

Everything in the package is listed in \s-1MANIFEST\s0, or subsequently matches a regular expression mask in \s-1MANIFEST\s0.SKIP

3.

Nothing exists in \s-1MANIFEST\s0 that also matches a mask in \s-1MANIFEST\s0.SKIP, so as to avoid an unsatisfiable dependency conditions

If there is no \s-1MANIFEST\s0.SKIP included in your distribution, this module will replicate the toolchain behaviour of using the default system-wide \s-1MANIFEST\s0.SKIP file. To view the contents of this file, use the command:

  $ perldoc -m ExtUtils::MANIFEST.SKIP

SYNOPSIS

use Test::More;

# This is the common idiom for author test modules like this, but see # the full example in examples/checkmanifest.t and, more importantly, # Adam Kennedy's article: http://use.perl.org/~Alias/journal/38822 eval 'use Test::DistManifest'; if ($@) { plan skip_all => 'Test::DistManifest required to test MANIFEST'; }

manifest_ok('MANIFEST', 'MANIFEST.SKIP'); # Default options

manifest_ok(); # Functionally equivalent to above

COMPATIBILITY

This module was tested under Perl 5.10.0, using Debian Linux. However, because it's Pure Perl and doesn't do anything too obscure, it should be compatible with any version of Perl that supports its prerequisite modules.

If you encounter any problems on a different version or architecture, please contact the maintainer.

FUNCTIONS

manifest_ok

manifest_ok( $manifest, $skipfile )

This subroutine checks the manifest list contained in $manifest by using \*(C`Module::Manifest\*(C' to determine the list of files and then checking for the existence of all such files. Then, it checks if there are any files in the distribution that were not specified in the $manifest file but do not match any regular expressions provided in the $skipfile exclusion file.

If your \s-1MANIFEST\s0 file is generated by a module installation toolchain system such as ExtUtils::MakeMaker, Module::Build or Module::Install, then you shouldn't have any problems with these files. It's just a helpful test to remind you to update these files, using:

$ make manifest # For ExtUtils::MakeMaker $ ./Build manifest # For Module::Build

Non-Fatal Errors

By default, errors in the \s-1MANIFEST\s0 or \s-1MANIFEST\s0.SKIP files are treated as fatal, which really is the purpose of using \*(C`Test::DistManifest\*(C' as part of your author test suite.

In some cases this is not desirable behaviour, such as with the Debian Perl Group, which runs all tests - including author tests - as part of its module packaging process. This wreaks havoc because Debian adds its control files in \*(C`debian/\*(C' downstream, and that directory or its files are generally not in \s-1MANIFEST\s0.SKIP.

By setting the environment variable \s-1MANIFEST_WARN_ONLY\s0 to a true value, errors will be non-fatal - they show up as diagnostic messages only, but all tests pass from the perspective of \*(C`Test::Harness\*(C'.

This can be used in a test script as:

$ENV{MANIFEST_WARN_ONLY} = 1;

or from other shell scripts as:

export MANIFEST_WARN_ONLY=1

Note that parsing errors in \s-1MANIFEST\s0 and circular dependencies will always be considered fatal. The author is not aware of any cases where other behaviour would be useful.

GUTS

This module internally plans 4 tests:

1.

\s-1MANIFEST\s0 can be parsed by \*(C`Module::Manifest\*(C'

2.

Check which files exist in the distribution directory that do not match an existing regular expression in \s-1MANIFEST\s0.SKIP and not listed in the \s-1MANIFEST\s0 file. These files should either be excluded from the test by addition of a mask in \s-1MANIFEST\s0.SKIP (in the case of temporary development or test files) or should be included in the \s-1MANIFEST\s0.

3.

Check which files are specified in \s-1MANIFEST\s0 but do not exist on the disk. This usually occurs when one deletes a test or similar script from the distribution, or accidentally moves it.

4.

Check which files are specified in both \s-1MANIFEST\s0 and \s-1MANIFEST\s0.SKIP. This is clearly an unsatisfiable condition, since the file in question cannot be expected to be included while also simultaneously ignored.

If you want to run tests on multiple different \s-1MANIFEST\s0 files, you can simply pass 'no_plan' to the import function, like so:

use Test::DistManifest 'no_plan';

# Multiple tests work properly now manifest_ok('MANIFEST', 'MANIFEST.SKIP'); manifest_ok(); manifest_ok('MANIFEST.OTHER', 'MANIFEST.SKIP');

I doubt this will be useful to users of this module. However, this is used internally for testing and it might be helpful to you. You can also plan more tests, but keep in mind that the idea of \*(L"3 internal tests\*(R" may change in the future.

Example code:

use Test::DistManifest tests => 5; manifest_ok(); # 4 tests ok(1, 'is 1 true?');

AUTHOR

Jonathan Yu <[email protected]>

\s-1CONTRIBUTORS\s0

Your name here ;-)

ACKNOWLEDGEMENTS

  • Thanks to Adam Kennedy for developing Module::Manifest, which provides much of the core functionality for these tests.

  • Thanks to Apocalypse <[email protected]>, for helping me track down an obscure bug caused by circular dependencies: when files are expected by \s-1MANIFEST\s0 but explictly skipped by \s-1MANIFEST\s0.SKIP.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Test::DistManifest

You can also look for information at:

  • AnnoCPAN: Annotated \s-1CPAN\s0 documentation <http://annocpan.org/dist/Test-Dist-Manifest>

  • \s-1CPAN\s0 Ratings <http://cpanratings.perl.org/d/Test-Dist-Manifest>

  • Search \s-1CPAN\s0 <http://search.cpan.org/dist/Test-Dist-Manifest>

  • \s-1CPAN\s0 Request Tracker <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Dist-Manifest>

  • \s-1CPAN\s0 Testing Service (Kwalitee Tests) <http://cpants.perl.org/dist/overview/Test-DistManifest>

REPOSITORY

You can access the most recent development version of this module at:

<http://svn.ali.as/cpan/trunk/Test-DistManifest>

If you are a \s-1CPAN\s0 developer and would like to make modifications to the code base, please contact Adam Kennedy <[email protected]>, the repository administrator. I only ask that you contact me first to discuss the changes you wish to make to the distribution.

FEEDBACK

Please send relevant comments, rotten tomatoes and suggestions directly to the maintainer noted above.

If you have a bug report or feature request, please file them on the \s-1CPAN\s0 Request Tracker at <http://rt.cpan.org>. If you are able to submit your bug report in the form of failing unit tests, you are strongly encouraged to do so.

RELATED TO Test::DistManifest…

Test::CheckManifest, a module providing similar functionality

CAVEATS

\s-1KNOWN\s0 \s-1BUGS\s0

There are no known bugs as of this release.

\s-1LIMITATIONS\s0

  • There is currently no way to test a \s-1MANIFEST/MANIFEST\s0.SKIP without having the files actually exist on disk. I am planning for this to change in the future.

  • This module has not been tested very thoroughly with Unicode.

  • This module does not produce any useful diagnostic messages in terms of how to correct the situation. Hopefully this will be obvious for anybody using the module; the emphasis should be on generating helpful error messages.

QUALITY ASSURANCE METRICS

\s-1TEST\s0 \s-1COVERAGE\s0

File stmt bran cond sub pod total ----------------------- ------ ------ ------ ------ ------ ------ Test/DistManifest.pm 96.1 95.8 100.0 100.0 100.0 96.8

LICENSE

Copyright 2008-2009 by Jonathan Yu <[email protected]>

This package is distributed under the same terms as Perl itself. Please see the \s-1LICENSE\s0 file included in this distribution for full details of these terms.

DISCLAIMER OF WARRANTY

This software is provided by the copyright holders and contributors \*(L"\s-1AS\s0 \s-1IS\s0\*(R" and \s-1ANY\s0 \s-1EXPRESS\s0 \s-1OR\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0, including, but not limited to, the \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0 \s-1MERCHANTABILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0 \s-1ARE\s0 \s-1DISCLAIMED\s0.

In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.