Test-Prereq-2.005/ 0000755 0000765 0000024 00000000000 14735671642 012670 5 ustar brian staff Test-Prereq-2.005/LICENSE 0000644 0000765 0000024 00000021733 14735671640 013701 0 ustar brian staff The Test::Prereq module is licensed under the same terms as perl
itself, under the Artistic License 2.0.
Artistic License 2.0
Copyright (c) 2000-2006, The Perl Foundation.
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Preamble
********
This license establishes the terms under which a given free software
Package may be copied, modified, distributed, and/or redistributed. The
intent is that the Copyright Holder maintains some artistic control over
the development of that Package while still keeping the Package
available as open source and free software.
You are always permitted to make arrangements wholly outside of this
license directly with the Copyright Holder of a given Package. If the
terms of this license do not permit the full use that you propose to
make of the Package, you should contact the Copyright Holder and seek a
different licensing arrangement.
Definitions
***********
"Copyright Holder" means the individual(s) or organization(s) named in
the copyright notice for the entire Package.
"Contributor" means any party that has contributed code or other
material to the Package, in accordance with the Copyright Holder's
procedures.
"You" and "your" means any person who would like to copy, distribute, or
modify the Package.
"Package" means the collection of files distributed by the Copyright
Holder, and derivatives of that collection and/or of those files. A
given Package may consist of either the Standard Version, or a Modified
Version.
"Distribute" means providing a copy of the Package or making it
accessible to anyone else, or in the case of a company or organization,
to others outside of your company or organization.
"Distributor Fee" means any fee that you charge for Distributing this
Package or providing support for this Package to another party. It does
not mean licensing fees.
"Standard Version" refers to the Package if it has not been modified, or
has been modified only in ways explicitly requested by the Copyright
Holder.
"Modified Version" means the Package, if it has been changed, and such
changes were not explicitly requested by the Copyright Holder.
"Original License" means this Artistic License as Distributed with the
Standard Version of the Package, in its current version or as it may be
modified by The Perl Foundation in the future.
"Source" form means the source code, documentation source, and
configuration files for the Package.
"Compiled" form means the compiled bytecode, object code, binary, or any
other form resulting from mechanical transformation or translation of
the Source form.
Permission for Use and Modification Without Distribution
********************************************************
(1) You are permitted to use the Standard Version and create and use
Modified Versions for any purpose without restriction, provided that you
do not Distribute the Modified Version.
Permissions for Redistribution of the Standard Version
******************************************************
(2) You may Distribute verbatim copies of the Source form of the
Standard Version of this Package in any medium without restriction,
either gratis or for a Distributor Fee, provided that you duplicate all
of the original copyright notices and associated disclaimers. At your
discretion, such verbatim copies may or may not include a Compiled form
of the Package.
(3) You may apply any bug fixes, portability changes, and other
modifications made available from the Copyright Holder. The resulting
Package will still be considered the Standard Version, and as such will
be subject to the Original License.
Distribution of Modified Versions of the Package as Source
**********************************************************
(4) You may Distribute your Modified Version as Source (either gratis or
for a Distributor Fee, and with or without a Compiled form of the
Modified Version) provided that you clearly document how it differs from
the Standard Version, including, but not limited to, documenting any
non-standard features, executables, or modules, and provided that you do
at least ONE of the following:
(a) make the Modified Version available to the Copyright Holder of the
Standard Version, under the Original License, so that the Copyright
Holder may include your modifications in the Standard Version.
(b) ensure that installation of your Modified Version does not prevent
the user installing or running the Standard Version. In addition, the
Modified Version must bear a name that is different from the name of the
Standard Version.
(c) allow anyone who receives a copy of the Modified Version to make the
Source form of the Modified Version available to others under
(i) the Original License or
(ii) a license that permits the licensee to freely copy, modify and
redistribute the Modified Version using the same licensing terms that
apply to the copy that the licensee received, and requires that the
Source form of the Modified Version, and of any works derived from it,
be made freely available in that license fees are prohibited but
Distributor Fees are allowed.
Distribution of Compiled Forms of the Standard Version or Modified
******************************************************************
Versions without the Source
***************************
(5) You may Distribute Compiled forms of the Standard Version without
the Source, provided that you include complete instructions on how to
get the Source of the Standard Version. Such instructions must be valid
at the time of your distribution. If these instructions, at any time
while you are carrying out such distribution, become invalid, you must
provide new instructions on demand or cease further distribution. If
you provide valid instructions or cease distribution within thirty days
after you become aware that the instructions are invalid, then you do
not forfeit any of your rights under this license.
(6) You may Distribute a Modified Version in Compiled form without the
Source, provided that you comply with Section 4 with respect to the
Source of the Modified Version.
Aggregating or Linking the Package
**********************************
(7) You may aggregate the Package (either the Standard Version or
Modified Version) with other packages and Distribute the resulting
aggregation provided that you do not charge a licensing fee for the
Package. Distributor Fees are permitted, and licensing fees for other
components in the aggregation are permitted. The terms of this license
apply to the use and Distribution of the Standard or Modified Versions
as included in the aggregation.
(8) You are permitted to link Modified and Standard Versions with other
works, to embed the Package in a larger work of your own, or to build
stand-alone binary or bytecode versions of applications that include the
Package, and Distribute the result without restriction, provided the
result does not expose a direct interface to the Package.
Items That are Not Considered Part of a Modified Version
********************************************************
(9) Works (including, but not limited to, modules and scripts) that
merely extend or make use of the Package, do not, by themselves, cause
the Package to be a Modified Version. In addition, such works are not
considered parts of the Package itself, and are not subject to the terms
of this license.
General Provisions
******************
(10) Any use, modification, and distribution of the Standard or Modified
Versions is governed by this Artistic License. By using, modifying or
distributing the Package, you accept this license. Do not use, modify,
or distribute the Package, if you do not accept this license.
(11) If your Modified Version has been derived from a Modified Version
made by someone other than you, you are nevertheless required to ensure
that your Modified Version complies with the requirements of this
license.
(12) This license does not grant you the right to use any trademark,
service mark, tradename, or logo of the Copyright Holder.
(13) This license includes the non-exclusive, worldwide, free-of-charge
patent license to make, have made, use, offer to sell, sell, import and
otherwise transfer the Package with respect to any patent claims
licensable by the Copyright Holder that are necessarily infringed by the
Package. If you institute patent litigation (including a cross-claim or
counterclaim) against any party alleging that the Package constitutes
direct or contributory patent infringement, then this Artistic License
to you shall terminate on the date that such litigation is filed.
(14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT
HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT
PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT
HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE
OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Test-Prereq-2.005/Changes 0000644 0000765 0000024 00000010236 14735671640 014163 0 ustar brian staff Revision history for Perl module Test::Prereq
2.005 2025-01-03T05:20:21Z
* refresh distro
* move to BRIANDFOY
2.004 2025-01-03T03:41:05Z
* refresh distro
* move to BRIANDFOY user
* Add SECURITY.md policy
2.003 2019-12-20T06:43:31Z
* Uniq the list of modules this extracts. Module::Extract::Use 1.045
changed slightly to return a bit more than it used to.
2.002 2016-11-23T22:03:31Z
* Support test_requires in Module::Build (Sam Brightman, GitHub #15)
2.001_002 2016-10-28T00:42:22Z
* Fix postderef. I specified v5.22, but it was still experimental then.
Identified by Slaven ReziÄ (https://github.com/briandfoy/test-prereq/issues/14)
2.001_001 2016-10-24T04:12:51Z
* Big changes:
+ No more filtering out core modules (some things are ejected from core!)
+ Switched from Module::Info to Module::Extract::Use
+ Switched from old Test::Builder to Test::Builder::Module from the
new Test::Simple stuff.
1.039 2015-08-08T07:39:45Z
* Bump to stable version
1.038_07 2015-06-22T21:41:25Z
* Don't install README.pod
1.038_06 2015-06-22T18:06:54Z
* Adjust default list for v5.20 kicking out Module::Build
https://bugs.debian.org/789479
RT #105398
1.38_05 - 2014-01-17
* More adjustments for 5.8 tests.
1.38_04 - 2014-01-16
Refactor some tests, with more exploration for 5.8 failures.
1.38_03 - 2014-01-15
* Add some diag messages in tests to investigate
some test failures
1.38_02 - 2014-01-06
* Fixup for CONFIGURE_REQUIRES (GitHub Issue #2)
1.38_01 - 2014-01-03
* Handle TEST_REQUIRES
* Fixes for v5.8, which doesn't include Module::Build
1.38 - 2014-01-02
* Use Makefile.PL instead of Build.PL since Module::Build
is likely to be deprecated
* Fix up Pod encoding issues
1.037 - 2009-06-01
* Fix #46335: qualify calls to find() so Module::Install
doesn't intercept them.
1.035 - 2008-08-02
* Cleaning up the Makefile a bit. No need to upgrade.
1.034 - 2008-07-12
* Various minor cleanups. No big whoop.
1.033 - 2007-03-16
* Fixed load test to not complain when trying to import the same
symbol twice
* No code fixes otherwise. No need to upgrade.
1.032 - 2007-01-09
* updated copyright and license info
* no code changes, so no need to upgrade
1.031 - 2006-05-17
* updates to distro and kwalitee. No need to upgrade
1.030 - 2006-05-17
* Updates to distro and kwalitee. No need to upgrade.
1.030 - 2006-01-11
* Tests should now work even if there is nothing in PREREQ_PM. In the
previous version, an empty PREREQ_PM made the module think Makefile.PL
didn't exit cleanly.
* Everyone should upgrade.
1.029 - 2005-12-25
* Updated some tests that had some problems. No need to upgrade.
1.028 - 2005-07-13
* Simple doc fixes. No need to upgrade.
1.027 - 2005-03-08
* fixed up the bits that deal with the plan, to make things
consistent. prereq_ok will create the plan if it doesn't
exist, or leave it alone if it does.
* You don't need to use Test::More (and you didn't need
to previously, despite the docs)
1.026 - 2005-03-04
* Documentation fix for command line invocation: Test::Prereq
calls plan() for you, so you don't have to.
1.025 - 2004-09-08
* get rid of the 'redefine' warning when we read the Makefile.PL
1.024 - 2004-09-07
* cleaned up distro
* bumped version to a full release (the interface is pretty much set)
* no need to upgrade really (although some modules might require a
version number above 1.x
0.23 - 2004-08-24
* Changed a few things for demo talk
0.23 - 2004-02-20
* got rid of the File::Find::Rule dependency
0.19 - 2002-12-20
* stripped bad whitespace from Pod, no code changes
0.18 - 2002-11-04
* skip CPANPLUS modules by default. still haven't
figured this out.
0.17 - 2002-10-23
* removed extra call to CPAN.pm. this should make
things run faster.
0.16 - 2002-10-11
* add MAN3PODS to WriteMakefile to make man
pages show up in the right place
0.15 - 2002-10-10
* more changes to get around CPANPLUS
0.14 - 2002-10-10
* test suite gives better error output (so i can
figure out what's up with CPANPLUS)
0.13 - 2002-10-09
* expands distributions in PREREQ_PM to look for
modules implicitly declared
0.10 - 2002-10-04
* added support for Module::Build
0.07 - 2002-09-30
* cleaned up Makefile.PL for perl5.8.0 weirdness
Test-Prereq-2.005/MANIFEST 0000644 0000765 0000024 00000001041 14735671642 014015 0 ustar brian staff Changes
examples/README
INSTALL.SKIP
lib/Test/Prereq.pm
lib/Test/Prereq/Build.pm
LICENSE
Makefile.PL
MANIFEST This list of files
MANIFEST.SKIP
META.yml
README.pod
SECURITY.md
t/get_from_file.t
t/get_loaded_modules.t
t/get_prereqs.t
t/import.t
t/load.t
t/pod.t
t/pod_coverage.t
t/prereq_ok.t
t/prior_plan.t
t/test_manifest
testdir/bad_makefile/Makefile.PL
testdir/build_pl/Build.PL
testdir/good_makefile/Makefile.PL
testdir/good_makefile/MANIFEST
xt/changes.t
META.json Module JSON meta-data (added by MakeMaker)
Test-Prereq-2.005/t/ 0000755 0000765 0000024 00000000000 14735671642 013133 5 ustar brian staff Test-Prereq-2.005/t/pod.t 0000644 0000765 0000024 00000000201 14735671640 014071 0 ustar brian staff use Test::More;
eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
all_pod_files_ok();
Test-Prereq-2.005/t/prereq_ok.t 0000644 0000765 0000024 00000000250 14735671640 015302 0 ustar brian staff use Test::More 1.00;
BEGIN { use_ok "Test::Prereq" }
subtest no_ignore => sub {
my @ignore = ();
my $rc = prereq_ok( undef, undef, \@ignore );
};
done_testing();
Test-Prereq-2.005/t/load.t 0000644 0000765 0000024 00000000422 14735671640 014233 0 ustar brian staff use Test::More 1.00;
my @classes = qw(Test::Prereq Test::Prereq::Build);
foreach my $class ( @classes ) {
undef &main::prereq_ok;
BAIL_OUT( "Could not compile $class!" ) unless use_ok( $class );
ok( defined &main::prereq_ok, "prereq_ok imported" );
}
done_testing();
Test-Prereq-2.005/t/prior_plan.t 0000644 0000765 0000024 00000000321 14735671640 015457 0 ustar brian staff # declare a plan beforehand to ensure that loading Test::Prereq
# still works even through a test module might call plan() itself.
use Test::More tests => 1;
use Test::Prereq;
prereq_ok( undef, undef, [] );
Test-Prereq-2.005/t/import.t 0000644 0000765 0000024 00000001204 14735671640 014625 0 ustar brian staff use strict;
use Test::More tests => 4;
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
package Mimi;
my $value = not defined &prereq_ok;
main::ok( $value, 'Test::Prereq has not imported yet' );
require Test::Prereq;
Test::Prereq->import;
main::ok( defined &prereq_ok, 'Test::Prereq imported prereq_ok' );
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
package Buster;
$value = not defined &prereq_ok;
main::ok( $value, 'Test::Prereq::Build has not imported yet' );
require Test::Prereq::Build;
Test::Prereq->import;
main::ok( defined &prereq_ok, 'Test::Prereq::Build imported prereq_ok' );
Test-Prereq-2.005/t/get_prereqs.t 0000644 0000765 0000024 00000003360 14735671640 015640 0 ustar brian staff use strict;
use Test::More 0.95;
use Cwd;
use Test::Prereq;
use Test::Prereq::Build;
use lib qw(.);
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
subtest 'get_prereqs' => sub {
my $cwd = cwd;
chdir "testdir/build_pl" or warn "Could not change directory! $!";
my $modules = Test::Prereq::Build->_get_prereqs();
diag "Didn't find right modules!\nFound <@$modules>\n" unless
is_deeply(
$modules,
[
sort qw( Module::Build Module::CoreList Module::Info
Test::Builder Test::Builder::Tester Test::Manifest Test::More )
],
'Right modules for Build.PL'
);
chdir $cwd or warn "Could not reset directory! $!";
};
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
subtest 'good_makefile' => sub {
my $cwd = cwd;
chdir "testdir/good_makefile" or warn "Could not change directory! $!";
ok( -e 'Makefile.PL', 'Makefile.PL is in the current working directory' );
my $modules = Test::Prereq->_get_prereqs();
isa_ok( $modules, 'ARRAY' );
diag "Didn't find right modules!\nFound <@$modules>\n" unless
is_deeply(
$modules,
[
sort qw( HTTP::Size XML::Twig Test::Output Test::Manifest )
],
'Right modules for Makefile.PL'
);
chdir $cwd or warn "Could not reset directory! $!";
};
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
subtest 'bad_makefile' => sub {
my $cwd = cwd;
chdir "testdir/bad_makefile" or warn "Could not change directory! $!";
diag( "You might see an error about loading a Makefile.PL. That's fine." );
my $modules = Test::Prereq->_get_prereqs();
my $okay = defined $modules ? 0 : 1;
ok( $okay, 'Bad Makefile.PL fails in right way' );
chdir $cwd or warn "Could not reset directory! $!";
};
done_testing();
Test-Prereq-2.005/t/test_manifest 0000644 0000765 0000024 00000000161 14735671640 015717 0 ustar brian staff load.t
pod.t
pod_coverage.t
prereq_ok.t
import.t
get_from_file.t
get_loaded_modules.t
get_prereqs.t
prior_plan.t
Test-Prereq-2.005/t/pod_coverage.t 0000644 0000765 0000024 00000000444 14735671640 015755 0 ustar brian staff use Test::More;
eval "use Test::Pod::Coverage";
if( $@ ) {
plan skip_all => "Test::Pod::Coverage required for testing POD";
}
else {
pod_coverage_ok( "Test::Prereq" );
pod_coverage_ok( "Test::Prereq::Build",
{ trustme => [ qr/create_build_script|prereq_ok/ ] } );
}
done_testing();
Test-Prereq-2.005/t/get_loaded_modules.t 0000644 0000765 0000024 00000002213 14735671640 017133 0 ustar brian staff use Test::More 0.95;
use_ok( 'Test::Prereq' );
subtest 'modules' => sub {
my $modules = Test::Prereq->_get_loaded_modules();
my @keys = sort keys %$modules;
my @expected = sort qw(
Carp
Cwd
ExtUtils::MakeMaker
File::Find
Module::Build
Module::Extract::Use
Test::Builder::Module
Test::More
Test::Prereq
Test::Prereq::Build
feature
lib
parent
strict
utf8
vars
warnings
);
is_deeply( \@keys, \@expected, 'Right modules for modules and tests' )
or
diag( "Didn't find right modules!\n\tFound < @keys >\n\tExpected < @expected >\n" );
};
done_testing();
__END__
TODO: {
local $TODO = "This interface changed, so these tests are not valid";
my $modules = Test::Prereq->_get_loaded_modules( );
my $okay = defined $modules ? 0 : 1;
ok( $okay, '_get_loaded_modules catches no arguments' );
$modules = Test::Prereq->_get_loaded_modules( undef, 't' );
$okay = defined $modules ? 0 : 1;
ok( $okay, '_get_loaded_modules catches missing first arg' );
$modules = Test::Prereq->_get_loaded_modules( 'blib/lib', undef );
$okay = defined $modules ? 0 : 1;
ok( $okay, '_get_loaded_modules catches missing second arg' );
}
Test-Prereq-2.005/t/get_from_file.t 0000644 0000765 0000024 00000001422 14735671640 016116 0 ustar brian staff use Test::More 0.95;
use Test::Prereq;
my @prereq_files = sort qw(
Carp
ExtUtils::MakeMaker
File::Find
Module::Extract::Use
Test::Builder::Module
feature
parent
strict
vars
warnings
utf8
);
my @tests = (
[ 't/pod.t', [ qw(Test::More) ] ],
[ 'lib/Test/Prereq.pm', [ @prereq_files ] ],
);
foreach my $test ( @tests ) {
my( $file, $expected ) = @$test;
@$expected = sort @$expected;
subtest pod => sub {
my @modules = sort @{ from_file( $file ) };
diag "Did not find right modules for $file!\nFound <@modules>\n"
unless is_deeply( \@modules, $expected,
"Found the expected modules for $file"
);
};
}
sub from_file {
my( $file ) = @_;
my $modules = Test::Prereq->_get_from_file( $file );
return $modules;
}
done_testing();
Test-Prereq-2.005/xt/ 0000755 0000765 0000024 00000000000 14735671642 013323 5 ustar brian staff Test-Prereq-2.005/xt/changes.t 0000644 0000765 0000024 00000000203 14735671640 015111 0 ustar brian staff use Test::More;
eval 'use Test::CPAN::Changes';
plan skip_all => 'Test::CPAN::Changes required for this test' if $@;
changes_ok();
Test-Prereq-2.005/README.pod 0000644 0000765 0000024 00000011262 14735671640 014331 0 ustar brian staff =pod
=encoding utf8
=for HTML
=for HTML
=for HTML
=for HTML
=for HTML
=for HTML
=for HTML
=head1 The Test::Prereq module
This is the I for the L Perl module. You're probably
looking at this because you don't know where else to find what you're
looking for. Read this once and you might never have to read one again
for any Perl module.
=head2 Documentation
To read about L, look at the embedded documentation
in the module itself. Inside the distribution, you can format it
with L:
% perldoc lib/Test/Prereq.pm
If you have already installed the module, you can specify the module
name instead of the file location:
% perldoc Test::Prereq
You can read the documentation and inspect the meta data at
L.
The standard module documentation has example uses in the SYNOPSIS
section, but you can also look in the I directory (if it's
there), or look at the test files in I.
=head2 Installation
You can install this module with a CPAN client, which will resolve
and install the dependencies:
% cpan Test::Prereq
% cpanm Test::Prereq
You can also install directly from the distribution directory, which
will also install the dependencies:
% cpan .
% cpanm .
You could install just this module manually:
% perl Makefile.PL
% make
% make test
% make install
You probably don't want to do that unless you're fiddling with the
module and only want to run the tests without installing anything.
=head2 Source location
The meta data, such as the source repository and bug tracker, is in
I or the I files it creates. You can find that on
those CPAN web interfaces, but you can also look at files directly in
the source repository: L
If you find a problem, file a ticket in the L.
There are also backup repositories hosted on other services. These
reflect the state of the main repo and exist only for redundancy:
=over 4
=item * L
=item * L
=item * L
=back
=head2 GitHub Attestations
This distribution now uses
L,
which allow you to verify that the archive file you have was made from
the official repo.
You need a GitHub account and the L.
# download the distro file from GitHub, MetaCPAN, or a CPAN mirror
$ gh auth login
...follow instructions...
$ gh attestation verify Test-Prereq-1.23.tar.gz --owner briandfoy
=head2 Getting help
Although I'm happy to hear from module users in private email,
that's the best way for me to forget to do something.
Besides the issue trackers, you can find help at
L or
L, both of which have many
competent Perlers who can answer your question, almost in real time.
They might not know the particulars of this module, but they can help
you diagnose your problem.
You might like to read L.
=head2 Copyright and License
You should have received a I file, but the license is also noted
in the module files. About the only thing you can't do is pretend that
you wrote code that you didn't.
=head2 Good luck!
Enjoy,
brian d foy, briandfoy@pobox.com
=cut
Test-Prereq-2.005/MANIFEST.SKIP 0000644 0000765 0000024 00000002156 14735671640 014570 0 ustar brian staff
#!start included /usr/local/perls/perl-5.18.1/lib/5.18.1/ExtUtils/MANIFEST.SKIP
# Avoid version control files.
\bRCS\b
\bCVS\b
\bSCCS\b
,v$
\B\.svn\b
\B\.git\b
\B\.gitignore\b
\b_darcs\b
\B\.cvsignore$
# Avoid VMS specific MakeMaker generated files
\bDescrip.MMS$
\bDESCRIP.MMS$
\bdescrip.mms$
# Avoid Makemaker generated and utility files.
\bMANIFEST\.bak
\bMakefile$
\bblib/
\bMakeMaker-\d
\bpm_to_blib\.ts$
\bpm_to_blib$
\bblibdirs\.ts$ # 6.18 through 6.25 generated this
# Avoid Module::Build generated and utility files.
\bBuild$
\b_build/
\bBuild.bat$
\bBuild.COM$
\bBUILD.COM$
\bbuild.com$
# Avoid temp and backup files.
~$
\.old$
\#$
\b\.#
\.bak$
\.tmp$
\.#
\.rej$
# Avoid OS-specific files/dirs
# Mac OSX metadata
\B\.DS_Store
# Mac OSX SMB mount metadata files
\B\._
# Avoid Devel::Cover and Devel::CoverX::Covered files.
\bcover_db\b
\bcovered\b
# Avoid MYMETA files
^MYMETA\.
#!end included /usr/local/perls/perl-5.18.1/lib/5.18.1/ExtUtils/MANIFEST.SKIP
\.?appveyor.yml
\.releaserc
\.lwpcookies
\.cvsignore
hacks/
.*MYMETA.*
Test-.*
\bMANIFEST\s\d
\bChanges\s\d
\.icloud$
\A\.github\b
\.gitattributes\b
Test-Prereq-2.005/examples/ 0000755 0000765 0000024 00000000000 14735671642 014506 5 ustar brian staff Test-Prereq-2.005/examples/README 0000644 0000765 0000024 00000000105 14735671640 015360 0 ustar brian staff See the tests in the t/ directory for examples until I add some more. Test-Prereq-2.005/META.yml 0000664 0000765 0000024 00000002004 14735671642 014137 0 ustar brian staff ---
abstract: 'check if Makefile.PL has the right pre-requisites'
author:
- 'brian d foy '
build_requires:
Test::Builder::Tester: '0'
Test::More: '1'
configure_requires:
ExtUtils::MakeMaker: '6.64'
File::Spec::Functions: '0'
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 7.70, CPAN::Meta::Converter version 2.150010'
license: artistic_2
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: Test-Prereq
no_index:
directory:
- t
- inc
requires:
Carp: '0'
Cwd: '0'
File::Find: '0'
Module::Build: '0'
Module::Extract::Use: '0'
Test::Builder::Module: '0'
feature: '0'
lib: '0'
parent: '0'
perl: '5.022'
strict: '0'
utf8: '0'
vars: '0'
warnings: '0'
resources:
bugtracker: https://github.com/briandfoy/test-prereq/issues
homepage: https://github.com/briandfoy/test-prereq
repository: https://github.com/briandfoy/test-prereq
version: '2.005'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
Test-Prereq-2.005/testdir/ 0000755 0000765 0000024 00000000000 14735671642 014346 5 ustar brian staff Test-Prereq-2.005/testdir/bad_makefile/ 0000755 0000765 0000024 00000000000 14735671642 016731 5 ustar brian staff Test-Prereq-2.005/testdir/bad_makefile/Makefile.PL 0000644 0000765 0000024 00000000557 14735671640 020710 0 ustar brian staff use ExtUtils::MakeMaker;
WriteMakefile (
'NORECURS' => 1,
'NO_META' => 1,
'NO_MYMETA' => 1,
'NAME' => 'Test::Prereq',
'VERSION' => '0.05',
'PREREQ_PM' => {
'HTTP::Size' => 0,
},
'PM' =>
{
'lib/Prereq.pm' => '$(INST_LIBDIR)/Prereq.pm',
},
depend => { Makefile => 't/test_manifest' },
test => { TESTS => $tests },
);
0;
Test-Prereq-2.005/testdir/build_pl/ 0000755 0000765 0000024 00000000000 14735671642 016140 5 ustar brian staff Test-Prereq-2.005/testdir/build_pl/Build.PL 0000755 0000765 0000024 00000002016 14735671640 017434 0 ustar brian staff #!perl
use strict;
use warnings;
use Module::Build;
my $class = do {
if( eval "use Test::Manifest 2.00; 1" ) {
Test::Manifest->get_module_build_subclass;
}
else {
'Module::Build';
}
};
my $build = $class->new(
module_name => 'Test::Prereq',
dist_abstract => 'Ensure a build file lists all pre-requisites',
dist_version_from => 'lib/Prereq.pm',
license => 'perl',
dist_author => 'brian d foy ',
recommends => {
'Test::Manifest' => '2.00',
},
build_requires => {
'perl' => '5.010',
'Test::Builder' => '0',
'Test::Builder::Tester' => '0',
},
test_requires => {
'Test::More' => '0',
},
requires => {
'Module::Build' => '0',
'Module::CoreList' => '0',
'Module::Info' => '0',
},
pm_files => {
'lib/Prereq.pm' => 'lib/Test/Prereq.pm',
'lib/Build.pm' => 'lib/Test/Prereq/Build.pm',
},
add_to_cleanup => [ qw|Test-*| ],
);
$build->create_build_script;
Test-Prereq-2.005/testdir/good_makefile/ 0000755 0000765 0000024 00000000000 14735671642 017133 5 ustar brian staff Test-Prereq-2.005/testdir/good_makefile/MANIFEST 0000644 0000765 0000024 00000000053 14735671640 020260 0 ustar brian staff this is here to make Module::Build shut up
Test-Prereq-2.005/testdir/good_makefile/Makefile.PL 0000644 0000765 0000024 00000000770 14735671640 021107 0 ustar brian staff use ExtUtils::MakeMaker;
WriteMakefile (
'NORECURS' => 1,
'NO_META' => 1,
'NO_MYMETA' => 1,
'NAME' => 'Test::Prereq',
'VERSION' => '0.05',
'CONFIGURE_REQUIRES' => {
'Test::Manifest' => '0',
},
'BUILD_REQUIRES' => {
'Test::Output' => '0',
},
'PREREQ_PM' => {
'HTTP::Size' => '0',
'XML::Twig' => '0',
},
'PM' => {
'lib/Prereq.pm' => '$(INST_LIBDIR)/Prereq.pm',
},
depend => { Makefile => 't/test_manifest' },
test => { TESTS => $tests },
);
1;
Test-Prereq-2.005/lib/ 0000755 0000765 0000024 00000000000 14735671642 013436 5 ustar brian staff Test-Prereq-2.005/lib/Test/ 0000755 0000765 0000024 00000000000 14735671642 014355 5 ustar brian staff Test-Prereq-2.005/lib/Test/Prereq/ 0000755 0000765 0000024 00000000000 14735671642 015613 5 ustar brian staff Test-Prereq-2.005/lib/Test/Prereq/Build.pm 0000644 0000765 0000024 00000003616 14735671640 017214 0 ustar brian staff package Test::Prereq::Build;
use strict;
use parent qw(Test::Prereq);
use vars qw($VERSION @EXPORT);
use warnings;
no warnings;
=encoding utf8
=head1 NAME
Test::Prereq::Build - test prerequisites in Module::Build scripts
=head1 SYNOPSIS
use Test::Prereq::Build;
prereq_ok();
=cut
$VERSION = '2.005';
use Module::Build;
my $Test = __PACKAGE__->builder;
=head1 METHODS
If you have problems, send me your F.
This module overrides methods in C to make it work with
C.
This module does not have any public methods. See L.
To make everything work out with C, this module overrides
some methods to do nothing.
=over 4
=item create_build_script
=item add_build_element
=item args
=item notes
=back
=head1 AUTHOR
brian d foy, C<< >>
=head1 COPYRIGHT AND LICENSE
Copyright © 2002-2025, brian d foy . All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
sub import
{
my $self = shift;
my $caller = caller;
no strict 'refs';
*{$caller.'::prereq_ok'} = \&prereq_ok;
$Test->exported_to($caller);
$Test->plan(@_);
}
sub prereq_ok
{
$Test->plan( tests => 1 ) unless $Test->has_plan;
__PACKAGE__->_prereq_check( @_ );
}
sub _master_file { 'Build.PL' }
# override Module::Build
sub Module::Build::new {
my $class = shift;
my %hash = @_;
my @requires = sort grep $_ ne 'perl', (
keys %{ $hash{requires} },
keys %{ $hash{build_requires} },
keys %{ $hash{test_requires} },
keys %{ $hash{configure_requires} },
keys %{ $hash{recommends} },
);
@Test::Prereq::prereqs = @requires;
# intercept further calls to this object
return bless {}, __PACKAGE__;
}
# fake Module::Build methods
sub create_build_script { 1 };
sub add_build_element { 1 };
sub args { 1 };
sub notes { 1 };
1;
Test-Prereq-2.005/lib/Test/Prereq.pm 0000644 0000765 0000024 00000020570 14735671640 016153 0 ustar brian staff package Test::Prereq;
use parent qw(Test::Builder::Module);
use strict;
use utf8;
use v5.22;
use feature qw(postderef);
no warnings qw(experimental::postderef);
use warnings;
no warnings;
=encoding utf8
=head1 NAME
Test::Prereq - check if Makefile.PL has the right pre-requisites
=head1 SYNOPSIS
# if you use Makefile.PL
use Test::More;
eval "use Test::Prereq";
plan skip_all => "Test::Prereq required to test dependencies" if $@;
prereq_ok();
# 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 = 'Test::Prereq::Build required to test dependencies';
} elsif (not $ENV{TEST_AUTHOR}) {
$msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.';
}
plan skip_all => $msg if $msg;
prereq_ok();
=head1 DESCRIPTION
The C function examines the modules it finds in
F, F, and the test files it finds in F
(and F). It figures out which modules they use and compares
that list of modules to those in the C section of
F.
If you use C instead, see L
instead.
=head2 Warning about redefining ExtUtils::MakeMaker::WriteMakefile
C has its own version of
C so it can run the F
and get the argument list of that function. You may see warnings
about this.
=cut
use vars qw($VERSION $EXCLUDE_CPANPLUS @EXPORT @prereqs);
$VERSION = '2.005';
@EXPORT = qw( prereq_ok );
use Carp qw(carp);
use ExtUtils::MakeMaker;
use File::Find;
use Module::Extract::Use;
my $Test = __PACKAGE__->builder;
{
no warnings;
* ExtUtils::MakeMaker::WriteMakefile = sub {
my %hash = @_;
my $name = $hash{NAME};
my %prereqs =
map { defined $_ ? %$_ : () }
@hash{qw(PREREQ_PM BUILD_REQUIRES CONFIGURE_REQUIRES TEST_REQUIRES)};
@Test::Prereq::prereqs = sort keys %prereqs;
1;
}
}
#unless( caller ) { prereq_ok() }
=head1 FUNCTIONS
=over 4
=item prereq_ok( [ NAME [, SKIP_ARRAY] ] )
Tests F to ensure all non-core module dependencies are in
C. If you haven't set a testing plan already,
C creates a plan of one test.
Valid versions come from C (which uses C<$]>).
#!/usr/bin/perl
use Module::CoreList;
print map "$_\n", sort keys %Module::CoreList::version;
C attempts to remove modules found in F and libraries
found in F from the reported prerequisites.
The optional third argument is an array reference to a list of names
that C should ignore. You might want to use this if your
tests do funny things with C.
Versions prior to 1.038 would use CPAN.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 CPAN.pm takes forever.
If you want the old behavior, set the C
environment variable to a true value.
=cut
my $default_version = $];
my $version = $];
sub prereq_ok {
$Test->plan( tests => 1 ) unless $Test->has_plan;
__PACKAGE__->_prereq_check( @_ );
}
sub import {
my $self = shift;
my $caller = caller;
no strict 'refs';
*{$caller.'::prereq_ok'} = \&prereq_ok;
$Test->exported_to($caller);
$Test->plan(@_);
}
sub _prereq_check {
my $class = shift;
my $name = shift // 'Prereq test';
my $skip = shift // [];
unless( ref $skip eq ref [] ) {
carp( 'The second parameter to prereq_ok must be an array reference!' );
return;
}
# get the declared prereqs from the Makefile.PL
my $prereqs = $class->_get_prereqs();
unless( $prereqs ) {
$class->_not_ok( "\t" .
$class->_master_file . " did not return a true value.\n" );
return 0;
}
my $loaded = $class->_get_loaded_modules();
unless( $loaded ) {
$class->_not_ok( "\tCouldn't look up the modules for some reasons.\n" ,
"\tDo the blib/lib and t directories exist?\n",
);
return 0;
}
# remove modules found in PREREQ_PM
foreach my $module ( @$prereqs ) {
delete $loaded->{$module};
}
# remove modules found in distribution
my $distro = $class->_get_dist_modules( 'blib/lib' );
foreach my $module ( $distro->@* ) {
delete $loaded->{$module};
}
# remove modules found in test directory
$distro = $class->_get_test_libraries();
foreach my $module ( $distro->@* ) {
delete $loaded->{$module};
}
# remove modules in the skip array
foreach my $module ( $skip->@* ) {
delete $loaded->{$module};
}
if( $EXCLUDE_CPANPLUS ) {
foreach my $module ( keys %$loaded ) {
next unless $module =~ m/^CPANPLUS::/;
delete $loaded->{$module};
}
}
if( keys %$loaded ) { # stuff left in %loaded, oops!
$class->_not_ok( "Found some modules that didn't show up in PREREQ_PM or *_REQUIRES\n",
map { "\t$_\n" } sort keys %$loaded );
}
else {
$Test->ok( 1, $name );
}
return 1;
}
sub _not_ok {
my( $self, $name, @message ) = @_;
$Test->ok( 0, $name );
$Test->diag( join "", @message );
}
sub _master_file { 'Makefile.PL' }
sub _get_prereqs {
my $class = shift;
my $file = $class->_master_file;
delete $INC{$file}; # make sure we load it again
{
local $^W = 0;
unless( do "./$file" ) {
print STDERR "_get_prereqs: Error loading $file: $@\n";
return;
}
delete $INC{$file}; # pretend we were never here
}
my @modules = sort @Test::Prereq::prereqs;
@Test::Prereq::prereqs = ();
return \@modules;
}
# get all the loaded modules. we'll filter this later
sub _get_loaded_modules {
my $class = shift;
# return unless( defined $_[0] and defined $_[1] );
# return unless( -d $_[0] and -d $_[1] );
my( @libs, @t, @scripts );
File::Find::find( sub { push @libs, $File::Find::name if m/\.pm$/ }, 'blib/lib' )
if -e 'blib/lib';
File::Find::find( sub { push @t, $File::Find::name if m/\.t$/ }, 't' )
if -e 't';
File::Find::find( sub { push @scripts, $File::Find::name if -f $_ }, 'blib/script' )
if -e 'blib/script';
my @found = ();
foreach my $file ( @libs, @t, @scripts ) {
push @found, @{ $class->_get_from_file( $file ) };
}
return { map { $_, 1 } @found };
}
sub _get_test_libraries {
my $class = shift;
my $dirsep = "/";
my @found = ();
File::Find::find( sub { push @found, $File::Find::name if m/\.p(l|m)$/ }, 't' );
my @files =
map {
my $x = $_;
$x =~ s/^.*$dirsep//;
$x =~ s|$dirsep|::|g;
$x;
}
@found;
push @files, 'test.pl' if -e 'test.pl';
return \@files;
}
sub _get_dist_modules {
my $class = shift;
return unless( defined $_[0] and -d $_[0] );
my $dirsep = "/";
my @found = ();
File::Find::find( sub { push @found, $File::Find::name if m/\.pm$/ }, $_[0] );
my @files =
map {
my $x = $_;
$x =~ s/^$_[0]($dirsep)?//;
$x =~ s/\.pm$//;
$x =~ s|$dirsep|::|g;
$x;
}
@found;
return \@files;
}
sub _get_from_file {
state $extor = Module::Extract::Use->new;
my( $class, $file ) = @_;
my $modules = $extor->get_modules_with_details( $file );
# We also depend on the super classes, which might not be
# part of the distro
my @imports =
map {
state $can_import = { map { $_, 1 } qw(base parent) };
exists $can_import->{$_->module}
?
$_->imports->@*
:
();
} $modules->@*;
my @modules =
grep { state %Seen; ! $Seen{$_}++ } (
@imports,
map { $_->module } $modules->@*
);
return \@modules;
}
=back
=head1 TO DO
=over 4
=item * set up a couple fake module distributions to test
=item * warn about things that show up in C unnecessarily
=back
=head1 SOURCE AVAILABILITY
This source is in Github:
http://github.com/briandfoy/test-prereq
=head1 CONTRIBUTORS
Many thanks to:
Andy Lester, Slavin Rezić, Randal Schwartz, Iain Truskett, Dylan Martin
=head1 AUTHOR
brian d foy, C<< >>
=head1 COPYRIGHT and LICENSE
Copyright © 2002-2025, brian d foy . All rights reserved.
This software is available under the Artistic License 2.
=cut
1;
Test-Prereq-2.005/Makefile.PL 0000644 0000765 0000024 00000006434 14735671640 014647 0 ustar brian staff package Test::Prereq;
use strict;
use warnings;
=encoding utf8
=head1 The build file for Test::Prereq
This build file is a modulino; it works as both a build script and
a module.
To build the distribution, run this file normally:
% perl Makefile.PL
But, it's more interesting than that. You can load it with C
and call C to get the data structure it passes to
C:
my $package = require '/path/to/Makefile.PL';
my $arguments = $package->arguments;
Note that C-ing a file makes an entry in C<%INC> for exactly
that name. If you try to C another file with the same name,
even from a different path, C thinks it has already loaded
the file. As such, I recommend you always require the full path to the
file.
The return value of the C is a package name (in this case,
the name of the main module. Use that to call the C method.
Even if this distribution needs a higher version of Perl, this bit
only needs v5.8. You can play with the data structure with a primitive
Perl.
=cut
use File::Spec::Functions qw(catfile);
my $module = __PACKAGE__;
( my $dist = $module ) =~ s/::/-/g;
my $github = 'https://github.com/briandfoy/test-prereq';
my $main_file = catfile( 'lib', split /::/, "$module.pm" );
my %WriteMakefile = (
'MIN_PERL_VERSION' => '5.022',
'NAME' => $module,
'ABSTRACT_FROM' => $main_file,
'VERSION_FROM' => $main_file,
'LICENSE' => 'artistic_2',
'AUTHOR' => 'brian d foy ',
'CONFIGURE_REQUIRES' => {
'ExtUtils::MakeMaker' => '6.64',
'File::Spec::Functions' => '0',
},
'BUILD_REQUIRES' => {
},
'TEST_REQUIRES' => {
'Test::Builder::Tester' => '0',
'Test::More' => '1',
},
'PREREQ_PM' => {
'Module::Extract::Use' => '0',
'Carp' => '0',
'Cwd' => '0',
'File::Find' => '0',
'Module::Build' => '0',
'Test::Builder::Module' => '0',
'feature' => '0',
'lib' => '0',
'parent' => '0',
'strict' => '0',
'utf8' => '0',
'vars' => '0',
'warnings' => '0',
},
'META_MERGE' => {
'meta-spec' => { version => 2 },
resources => {
repository => {
type => 'git',
url => $github,
web => $github,
},
bugtracker => {
web => "$github/issues",
},
homepage => $github,
},
},
'NORECURS' => 1,
'clean' => { FILES => "$dist-*" },
);
sub arguments { \%WriteMakefile }
# Normally I'd just bail out if there is a caller, but this particular
# module loads the file then expects to run WriteMakefile(). If
my @caller = caller(1);
do_it() unless( caller and $caller[3] !~ /::_get_prereqs\z/ );
sub do_it {
require File::Spec;
my $MM ='ExtUtils::MakeMaker';
my $MM_version =
eval{ "$MM " . $WriteMakefile{'CONFIGURE_REQUIRES'}{'ExtUtils::MakeMaker'} }
||
"$MM 6.64";
eval "use $MM_version; 1" or die "Could not load $MM_version: $@";
eval "use Test::Manifest 1.21"
if -e File::Spec->catfile( qw(t test_manifest) );
my $arguments = arguments();
my $minimum_perl = $arguments->{MIN_PERL_VERSION} || '5.008';
eval "require $minimum_perl;" or die $@;
WriteMakefile( %$arguments );
}
no warnings;
__PACKAGE__;
Test-Prereq-2.005/INSTALL.SKIP 0000644 0000765 0000024 00000000156 14735671640 014466 0 ustar brian staff README\.pod
README.*
# things that might be in local directories after fooling
# around with them
\.DS_Store
Test-Prereq-2.005/SECURITY.md 0000644 0000765 0000024 00000002305 14735671640 014457 0 ustar brian staff # Security Policy for Test::Prereq
## Reporting security issues
**Do not report security problems on public forums or in repository
issues.**
Privately report vulnerabilities to the maintainers listed at the end
of this document. Include as many details as possible to reproduce the
issue, including code samples or test cases. Check that your report
does not expose any of your sensitive data, such as passwords, tokens,
or other secrets.
You do not need to have a solution or fix. Depending on the issue,
CPANSec may be notified. Depending on the issue, CPANSec may be
notified.
You can also privately report issues to the CPAN Security Group
(CPANSec) . This is especially
important if you think a vulnerability is being actively exploited.
CPANSec may report the issue to the relevant authorities. See [Report
a Security Issue](https://security.metacpan.org/docs/report.html).
## Response to reports
The maintainers aim to respond to all reports within one day, but this
may be affected by life and other things that happen to people who
maintain open source code.
A new release will be provided as soon as possible.
## Maintainers
* brian d foy,
Test-Prereq-2.005/META.json 0000664 0000765 0000024 00000003464 14735671642 014322 0 ustar brian staff {
"abstract" : "check if Makefile.PL has the right pre-requisites",
"author" : [
"brian d foy "
],
"dynamic_config" : 1,
"generated_by" : "ExtUtils::MakeMaker version 7.70, CPAN::Meta::Converter version 2.150010",
"license" : [
"artistic_2"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : 2
},
"name" : "Test-Prereq",
"no_index" : {
"directory" : [
"t",
"inc"
]
},
"prereqs" : {
"build" : {
"requires" : {}
},
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "6.64",
"File::Spec::Functions" : "0"
}
},
"runtime" : {
"requires" : {
"Carp" : "0",
"Cwd" : "0",
"File::Find" : "0",
"Module::Build" : "0",
"Module::Extract::Use" : "0",
"Test::Builder::Module" : "0",
"feature" : "0",
"lib" : "0",
"parent" : "0",
"perl" : "5.022",
"strict" : "0",
"utf8" : "0",
"vars" : "0",
"warnings" : "0"
}
},
"test" : {
"requires" : {
"Test::Builder::Tester" : "0",
"Test::More" : "1"
}
}
},
"release_status" : "stable",
"resources" : {
"bugtracker" : {
"web" : "https://github.com/briandfoy/test-prereq/issues"
},
"homepage" : "https://github.com/briandfoy/test-prereq",
"repository" : {
"type" : "git",
"url" : "https://github.com/briandfoy/test-prereq",
"web" : "https://github.com/briandfoy/test-prereq"
}
},
"version" : "2.005",
"x_serialization_backend" : "JSON::PP version 4.16"
}