.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Test::Prereq 3pm" .TH Test::Prereq 3pm "2014-01-02" "perl v5.18.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::Prereq \- check if Makefile.PL has the right pre\-requisites .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 5 \& # if you use Makefile.PL \& use Test::More; \& eval "use Test::Prereq"; \& plan skip_all => "Test::Prereq required to test dependencies" if $@; \& prereq_ok(); \& \& # specify a perl version, test name, or module names to skip \& prereq_ok( $version, $name, \e@skip ); \& \& # if you use Module::Build \& use Test::More; \& eval "use Test::Prereq::Build"; \& plan skip_all => "Test::Prereq::Build required to test dependencies" if $@; \& prereq_ok(); \& \& # or from the command line for a one\-off check \& perl \-MTest::Prereq \-eprereq_ok \& \& #The prerequisites test take quite some time so the following construct is \& #recommended for non\-author testers \& use Test::More; \& eval "use Test::Prereq::Build"; \& \& my $msg; \& if ($@) { \& $msg = \*(AqTest::Prereq::Build required to test dependencies\*(Aq; \& } elsif (not $ENV{TEST_AUTHOR}) { \& $msg = \*(AqAuthor test. Set $ENV{TEST_AUTHOR} to a true value to run.\*(Aq; \& } \& plan skip_all => $msg if $msg; \& prereq_ok(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \f(CW\*(C`prereq_ok()\*(C'\fR function examines the modules it finds in \&\fIblib/lib/\fR, \fIblib/script\fR, and the test files it finds in \fIt/\fR (and \fItest.pl\fR). It figures out which modules they use, skips the modules that are in the Perl core, and compares the remaining list of modules to those in the \f(CW\*(C`PREREQ_PM\*(C'\fR section of \fIMakefile.PL\fR. .PP If you use \f(CW\*(C`Module::Build\*(C'\fR instead, see Test::Prereq::Build instead. .SS "Modules Test::Prereq can't find" .IX Subsection "Modules Test::Prereq can't find" \&\f(CW\*(C`Module::Info\*(C'\fR only tells \f(CW\*(C`Test::Prereq\*(C'\fR which modules you used, not which distribution they came in. This can be a problem for things in packages like libnet, libwww, Tk, and so on. At the moment \&\f(CW\*(C`Test::Prereq\*(C'\fR asks \s-1CPAN\s0.pm to expand anything in \f(CW\*(C`PREREQ_PM\*(C'\fR to see if one of the distributions you explicity list contains the module you actually used. This might fail in some cases. Please send me anything that does not do what you think it should. .PP \&\f(CW\*(C`Test::Prereq\*(C'\fR only asks \s-1CPAN\s0.pm for help if it needs it, since \&\s-1CPAN\s0.pm can be slow if it has to fetch things from the network. Once it fetches the right things, it should be much faster. .SS "Problem with Module::Info" .IX Subsection "Problem with Module::Info" \&\f(CW\*(C`Module::Info\*(C'\fR appears to do something weird if a file it analyzes does not use (or require) any modules. You may get a message like .PP Can't locate object method \*(L"name\*(R" via package \*(L"B::NULL\*(R" at /usr/perl5.8.0/lib/site_perl/5.8.0/B/Module/Info.pm line 176. .PP Also, if a file cannot compile, \f(CW\*(C`Module::Info\*(C'\fR dumps a lot of text to the terminal. You probably want to bail out of testing if the files do not compile, though. .SS "Problem with \s-1CPANPLUS\s0" .IX Subsection "Problem with CPANPLUS" \&\f(CW\*(C`CPANPLUS\*(C'\fR apparently does some weird things, and since it is still young and not part of the Standard Library, \f(CW\*(C`Test::Prereq\*(C'\fR's tests do not do the right thing under it (for some reason). \f(CW\*(C`Test::Prereq\*(C'\fR cheats by ignoring \f(CW\*(C`CPANPLUS\*(C'\fR completely in the tests\-\-\-at least until someone has a better solution. If you do not like that, you can set \f(CW$EXCLUDE_CPANPLUS\fR to a false value. .PP You should be able to do a 'make test' manually to make everything work, though. .SS "Warning about redefining ExtUtils::MakeMaker::WriteMakefile" .IX Subsection "Warning about redefining ExtUtils::MakeMaker::WriteMakefile" \&\f(CW\*(C`Test::Prereq\*(C'\fR has its own version of \&\f(CW\*(C`ExtUtils::MakeMaker::WriteMakefile\*(C'\fR so it can run the \fIMakefile.PL\fR and get the argument list of that function. You may see warnings about this. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .IP "prereq_ok( [ \s-1VERSION,\s0 [ \s-1NAME\s0 [, \s-1SKIP_ARRAY\s0] ] ] )" 4 .IX Item "prereq_ok( [ VERSION, [ NAME [, SKIP_ARRAY] ] ] )" Tests \fIMakefile.PL\fR to ensure all non-core module dependencies are in \&\f(CW\*(C`PREREQ_PM\*(C'\fR. If you haven't set a testing plan already, \&\f(CW\*(C`prereq_ok()\*(C'\fR creates a plan of one test. .Sp If you don't specify a version, \f(CW\*(C`prereq_ok\*(C'\fR assumes you want to compare the list of prerequisite modules to the version of perl running the test. .Sp Valid versions come from \f(CW\*(C`Module::CoreList\*(C'\fR (which uses \f(CW$]\fR). .Sp .Vb 3 \& #!/usr/bin/perl \& use Module::CoreList; \& print map "$_\en", sort keys %Module::CoreList::version; .Ve .Sp \&\f(CW\*(C`prereq_ok\*(C'\fR attempts to remove modules found in \fIlib/\fR and libraries found in \fIt/\fR from the reported prerequisites. .Sp The optional third argument is an array reference to a list of names that \f(CW\*(C`prereq_ok\*(C'\fR should ignore. You might want to use this if your tests do funny things with \f(CW\*(C`require\*(C'\fR. .Sp Versions prior to 1.038 would use \s-1CPAN\s0.pm to virtually include prerequisites in distributions that you declared explicitly. This isn't really a good idea. Some modules have moved to different distributions, so you should just specify all the modules that you use instead of relying on a particular distribution to provide them. Not only that, expanding distributions with \s-1CPAN\s0.pm takes forever. .Sp If you want the old behavior, set the \f(CW\*(C`TEST_PREREQ_EXPAND_WITH_CPAN\*(C'\fR environment variable to a true value. .SH "TO DO" .IX Header "TO DO" * set up a couple fake module distributions to test .PP * warn about things that show up in \f(CW\*(C`PREREQ_PM\*(C'\fR unnecessarily .SH "SOURCE AVAILABILITY" .IX Header "SOURCE AVAILABILITY" This source is in Github: .PP .Vb 1 \& http://github.com/briandfoy/test\-prereq .Ve .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" Many thanks to: .PP Andy Lester, Slavin ReziX, Randal Schwartz, Iain Truskett, Dylan Martin .SH "AUTHOR" .IX Header "AUTHOR" brian d foy, \f(CW\*(C`\*(C'\fR .SH "COPYRIGHT and LICENSE" .IX Header "COPYRIGHT and LICENSE" Copyright 2002\-2014, brian d foy, All rights reserved .PP This software is available under the same terms as perl.