.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" 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 >0, 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 .\" ======================================================================== .\" .IX Title "Test::Prereq 3pm" .TH Test::Prereq 3pm "2020-01-04" "perl v5.30.0" "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 and compares that 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 "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" .IP "\(bu" 4 set up a couple fake module distributions to test .IP "\(bu" 4 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 Rezić, 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\-2016, brian d foy . All rights reserved. This software is available under the Artistic License 2.