POD2TEST(1p) User Contributed Perl Documentation POD2TEST(1p)NAME
pod2test - Convert embedded tests and code examples to .t files
SYNOPSIS
pod2test [-Mmodule] [input [output]]
DESCRIPTION
pod2test is a front-end for Pod::Tests (formerly Test::Inline 1). It generates TAP-compatible .t testing scripts from embedded tests and
code examples.
If output is not specified, the resulting .t file will go to STDOUT. Otherwise, it will go to the given output file. If input is not
given, it will draw from STDIN.
If the given file contains no tests or code examples, no output will be given, no output file will be created and pod2test will exit with
1.
The Test::More module is made available to the testing blocks using the 'no_plan' feature. Any further modules which should be used are
specified with -M. UNIMPLEMENTED
BUGS and CAVEATS
This is a very simple rough cut. It only does very rudimentary tests on the examples.
SUPPORT
This script has been superceded by "inline2test" from the newer Test::Inline 2. Most testing code that currently works with "pod2test"
should continue to work with the new version.
The most notable exceptions are "=for begin" and "=for end", which are deprecated in the newer version.
After upgrading Test::Inline, Pod::Tests and "pod2test" were split out to provide a compatibility package for legacy code.
"pod2test" will stay in CPAN, but should remain unchanged indefinately, with the exception of any minor bugs that will require squishing.
Bugs in this dist should be reported via the following URL. Feature requests should not be submitted, as further development is now
occuring in Test::Inline.
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Pod-Tests <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Pod-Tests>
AUTHOR
Michael G Schwern <schwern@pobox.com>
Adam Kennedy <adamk@cpan.org>
SEE ALSO
Pod::Tests, Test::Inline
COPYRIGHT
Copyright 2005 - 2008 Adam Kennedy.
Copyright 2001 - 2003 Michael G Schwern.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.12.4 2008-07-13 POD2TEST(1p)
Check Out this Related Man Page
Test::Pod::Content(3pm) User Contributed Perl Documentation Test::Pod::Content(3pm)NAME
Test::Pod::Content - Test a Pod's content
SYNOPSIS
use Test::Pod::Content tests => 3;
pod_section_is 'Test::Pod::Content' , 'NAME', "Test::Pod::Content - Test a Pod's content", 'NAME section';
pod_section_like 'Test/Pod/Content.pm', 'SYNOPSIS', qr{ use s Test::Pod::Content; }xm, 'SYNOPSIS section';
pod_section_like 'Test/Pod/Content.pm', 'DESCRIPTION', qr{ Test::Pod::Content s provides s the }xm, 'DESCRIPTION section';
DESCRIPTION
This is a very simple module for testing a Pod's content. It is mainly intended for testing the content of generated Pod - that is, the Pod
included in perl modules generated by some mechanism.
Another usage example is to test whether all files contain the same copyright notice:
plan tests => scalar @filelist;
for my $file (sort @filelist) {
pod_section_like( $file, 'LICENSE AND COPYRIGHT', qr{
This s library s is s free s software. s
You s may s distribute/modify s it s under s
the s same s terms s as s perl s itself
}xms, "$file License notice");
}
See the files in the t/ directory for live examples.
Test::Pod::Content has a very simple concept of Pods: To Test::Pod::Content, a Pod is separated into section. Each section starts with a
=head(1|2|3|4) directive, and ends with the next =head, or with the end of the document (=cut).
This is a very drastic simplification of Pod's document object model, and only allows for coarse-grained tests.
Test::Pod::Content provides the following subroutines for testing a Pod's content:
SUBROUTINES /METHODS
pod_section_is
pod_section_is $file, $section, $content, $comment;
Tests whether a Pod section contains exactly the text given. Most useful for testing the NAME section. You probably want to use
pod_section_like for all other sections.
$file may either be a filename (including path) or a module name. Test::Pod::Content will search in @INC for the file/module given.
pod_section_like
pod_section_like $file, $section, qr{ use s Test::Pod::Contents }xm, $comment;
Tests whether the text in a Pod section matches the given regex. Be sure to include the m / s regex qualifier if you expect your Pod
section to span multiple lines.
$file may either be a filename (including path) or a module name. Test::Pod::Content will search in @INC for the file/module given.
BUGS AND LIMITATIONS
o Performance
Every call to a pod_section_* method searches for the file in question in @INC and parses it from its start. This means that every test
requires a Pod parser run, which is quite inefficient if you conduct a big number of tests.
o Pod Syntax
Test::Pod::Coverage may report wrong test results if your pod is not syntactically correct. You should use Test::Pod to check your
Pod's syntax.
DEPENDENCIES
Test::More
Pod::Simple
version
INCOMPATIBILITIES
None known
SEE ALSO
Test::Pod for testing your POD's validity
Test::Pod::Coverage for checking wether your pod is complete
Pod::Tests, Test::Pod::Snippets and Pod::Snippets for extracting and executing tests from a POD (If you plan doing so, here's a little
brain-train: Which of the tests in this module's "SYNOPSIS" section would fail if you extracted and executed it?).
LICENSE AND COPYRIGHT
Copyright 2007 Martin Kutter.
This library is free software. You may distribute/modify it under the same terms as perl itself
AUTHOR
Martin Kutter <martin.kutter fen-net.de>
REPOSITORY INFORMATION
$Id: Content.pm 505 2008-06-22 09:54:54Z kutterma $
$Revision: 505 $
$Source: a $
$Date: 2008-06-22 11:54:54 +0200 (So, 22 Jun 2008) $
$HeadURL: http://svn.hyper-framework.org/Hyper/Test-Pod-Content/trunk/lib/Test/Pod/Content.pm $
perl v5.12.4 2011-11-09 Test::Pod::Content(3pm)