NAME

Test::DistManifest - Tests that your MANIFEST matches the distribution as it exists, excluding those in your MANIFEST.SKIP

VERSION

Version 1.0 ($Id: DistManifest.pm 11 2008-12-25 23:44:13Z frequency $)

EXPORTS

By default, this module exports the following functions:

  • manifest_ok

DESCRIPTION

This module provides a simple method of testing that a MANIFEST matches the distribution.

SYNOPSIS

use Test::More;

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 , $skipfile )

This subroutine checks the manifest list contained in $manifest by using Module::Manifest 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 MANIFEST file is generated by ExtUtils::MakeMaker or Module::Build, 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 dist # For ExtUtils::MakeMaker
$ ./Build dist # For Module::Build

GUTS

This module internally plans 3 tests:

  1. MANIFEST and MANIFEST.SKIP can be parsed by Module::Manifest

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

  3. Check which files are specified in MANIFEST 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.

If you want to run tests on multiple different MANIFEST 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 "3 internal tests" may change in the future.

Example code:

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

AUTHOR

Jonathan Yu <frequency@cpan.org>

CONTRIBUTORS

Your name here ;-)

ACKNOWLEDGEMENTS

  • Thanks to Adam Kennedy <adamk@cpan.org>, developer of Module::Manifest, which is used in this module.

SUPPORT

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

perldoc Test::DistManifest

You can also look for information at:

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 CPAN 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. Regular bug reports are always accepted and appreciated via the CPAN bug tracker.

SEE ALSO

Test::CheckManifest, a module providing similar functionality

CAVEATS

KNOWN BUGS

There are no known bugs as of this release.

LIMITATIONS

  • There is currently no way to test a MANIFEST/MANIFEST.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.

COPYRIGHT

Copyright (C) 2008 by Jonathan Yu <frequency@cpan.org>

LICENSE

This package is distributed under a triple licensing scheme. You are entitled to enjoy the covenants of, at your option:

  1. The Free Software Foundation's GNU General Public License (GPL), version 3 or later; or

  2. The Perl Foundation's Artistic License, version 2.0 or later; or

  3. The terms that Perl itself is licensed under (at time of writing, this is a dual license of the GNU General Public License and the Perl Artistic License).

DISCLAIMER OF WARRANTY

This software is provided by the copyright holders and contributors "AS IS" and ANY EXPRESS OR IMPLIED WARRANTIES, including, but not limited to, the IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.

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.