Test-Prereq-1.037/000075500000000000000000000000001213533131500136725ustar00rootroot00000000000000Test-Prereq-1.037/Build.PL000064400000000000000000000017701213533131500151730ustar00rootroot00000000000000#!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::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-1.037/Changes000064400000000000000000000055461213533131500151770ustar00rootroot00000000000000# $Id$ 1.37 - Mon Jun 1 00:20:54 2009 * Fix #46335: qualify calls to find() so Module::Install doesn't intercept them. 1.035 - Sat Aug 2 23:24:14 2008 * Cleaning up the Makefile a bit. No need to upgrade. 1.034 - Sat Jul 12 21:32:16 2008 * Various minor cleanups. No bg whoop. 1.033 - Fri Mar 16 23:00:57 2007 * Fixed load test to not complain when trying to import the same symbol twice * No code fixes otherwise. No need to upgrade. 1.032 - Tue Jan 9 22:54:40 2007 * updated copyright and license info * no code changes, so no need to upgrade 1.031 - Wed May 17 22:23:23 2006 * updates to distro and kwalitee. No need to upgrade 1.30 - Wed May 17 22:15:01 2006 * Updates to distro and kwalitee. No need to upgrade. 1.30 - Wed Jan 11 00:11:21 2006 * 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.29 - Sun Dec 25 20:03:47 2005 * Updated some tests that had some problems. No need to upgrade. 1.028 - Wed Jul 13 17:31:13 2005 * Simple doc fixes. No need to upgrade. 1.027 - Tue Mar 8 00:18:28 2005 * 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 - Fri Mar 4 08:09:41 2005 * Documentation fix for command line invocation: Test::Prereq calls plan() for you, so you don't have to. 1.025 - Wed Sep 8 00:59:57 2004 * get rid of the 'redefine' warning when we read the Makefile.PL 1.024 - Tue Sep 7 19:52:30 2004 * 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 - Tue Aug 24 19:58:53 2004 * Changed a few things for demo talk 0.23 - Fri Feb 20 05:42:18 2004 * got rid of the File::Find::Rule dependency 0.19 - Fri Dec 20 16:18:39 2002 * stripped bad whitespace from Pod, no code changes 0.18 Mon Nov 4 19:25:56 CST 2002 - skip CPANPLUS modules by default. still haven't figured this out. 0.17 Wed Oct 23 11:55:28 CDT 2002 - removed extra call to CPAN.pm. this should make things run faster. 0.16 Fri Oct 11 03:46:12 CDT 2002 - add MAN3PODS to WriteMakefile to make man pages show up in the right place 0.15 Thu Oct 10 19:34:20 CDT 2002 - more changes to get around CPANPLUS 0.14 Thu Oct 10 17:19:27 CDT 2002 - test suite gives better error output (so i can figure out what's up with CPANPLUS) 0.13 Wed Oct 9 19:37:47 EDT 2002 - expands distributions in PREREQ_PM to look for modules implicitly declared 0.10 Fri Oct 4 18:27:57 CDT 2002 - added support for Module::Build 0.07 Mon Sep 30 00:53:19 PDT 2002 - cleaned up Makefile.PL for perl5.8.0 weirdness Test-Prereq-1.037/LICENSE000064400000000000000000000000751213533131500147010ustar00rootroot00000000000000You can use Test::Prereq under the same terms as Perl itself.Test-Prereq-1.037/MANIFEST000064400000000000000000000005401213533131500150220ustar00rootroot00000000000000Build.PL Changes examples/README lib/Build.pm lib/Prereq.pm LICENSE MANIFEST This list of files META.yml README t/get_from_file.t t/get_from_prereqs.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/Makefile.PL testdir/MANIFEST Test-Prereq-1.037/META.yml000064400000000000000000000013101213533131500151360ustar00rootroot00000000000000--- name: Test-Prereq version: 1.037_02 author: - 'brian d foy ' abstract: Ensure a build file lists all pre-requisites license: perl resources: license: http://dev.perl.org/licenses/ build_requires: Test::Builder: 0 Test::Builder::Tester: 0 Test::More: 0 perl: 5.010 requires: Module::Build: 0 Module::CoreList: 0 Module::Info: 0 recommends: Test::Manifest: 2.00 configure_requires: Module::Build: 0.35 provides: Test::Prereq: file: lib/Prereq.pm version: 1.037_02 Test::Prereq::Build: file: lib/Build.pm version: 1.037_02 generated_by: Module::Build version 0.35 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 Test-Prereq-1.037/README000064400000000000000000000007431213533131500145560ustar00rootroot00000000000000$Id$ You can install this using in the usual Perl fashion perl Makefile.PL make make test make install The documentation is in the module file. Once you install the file, you can read it with perldoc. perldoc Test::Prereq If you want to read it before you install it, you can use perldoc directly on the module file. perldoc lib/Prereq.pm This module is also in CVS on SourceForge http://sourceforge.net/projects/brian-d-foy/ Enjoy, brian d foy, bdfoy@cpan.orgTest-Prereq-1.037/examples/000075500000000000000000000000001213533131500155105ustar00rootroot00000000000000Test-Prereq-1.037/examples/README000064400000000000000000000001051213533131500163640ustar00rootroot00000000000000See the tests in the t/ directory for examples until I add some more.Test-Prereq-1.037/lib/000075500000000000000000000000001213533131500144405ustar00rootroot00000000000000Test-Prereq-1.037/lib/Build.pm000064400000000000000000000035271213533131500160440ustar00rootroot00000000000000package Test::Prereq::Build; use strict; use base qw(Test::Prereq); use vars qw($VERSION @EXPORT); use warnings; no warnings; =head1 NAME Test::Prereq::Build - test prerequisites in Module::Build scripts =head1 SYNOPSIS use Test::Prereq::Build; prereq_ok(); =cut $VERSION = '1.037_02'; use Module::Build; use Test::Builder; my $Test = Test::Builder->new; =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 (c) 2002-2010 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{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-1.037/lib/Prereq.pm000064400000000000000000000262021213533131500162360ustar00rootroot00000000000000package Test::Prereq; use strict; use utf8; use warnings; no warnings; =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(); # specify a perl version, test name, or module names to skip prereq_ok( $version, $name, \@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 = '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, skips the modules that are in the Perl core, and compares the remaining list of modules to those in the C section of F. If you use C instead, see L instead. =head2 Modules Test::Prereq can't find C only tells C 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 C asks CPAN.pm to expand anything in C 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. C only asks CPAN.pm for help if it needs it, since CPAN.pm can be slow if it has to fetch things from the network. Once it fetches the right things, it should be much faster. =head2 Problem with Module::Info C appears to do something weird if a file it analyzes does not use (or require) any modules. You may get a message like Can't locate object method "name" via package "B::NULL" at /usr/perl5.8.0/lib/site_perl/5.8.0/B/Module/Info.pm line 176. Also, if a file cannot compile, C dumps a lot of text to the terminal. You probably want to bail out of testing if the files do not compile, though. =head2 Problem with CPANPLUS C apparently does some weird things, and since it is still young and not part of the Standard Library, C's tests do not do the right thing under it (for some reason). C cheats by ignoring C completely in the tests---at least until someone has a better solution. If you do not like that, you can set C<$EXCLUDE_CPANPLUS> to a false value. You should be able to do a 'make test' manually to make everything work, though. =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 base qw(Exporter); use vars qw($VERSION $EXCLUDE_CPANPLUS @EXPORT @prereqs); $VERSION = '1.037_02'; @EXPORT = qw( prereq_ok ); use Carp qw(carp); use ExtUtils::MakeMaker; use File::Find; use Module::CoreList; use Module::Info; use Test::Builder; use Test::More; my $Test = Test::Builder->new; my $Namespace = ''; $EXCLUDE_CPANPLUS = 1; { no warnings; * ExtUtils::MakeMaker::WriteMakefile = sub { my %hash = @_; my $name = $hash{NAME}; my %prereqs = map { defined $_ ? %$_ : () } @hash{qw(PREREQ_PM BUILD_REQUIRES CONFIGURE_REQUIRES)}; $Namespace = $name; @Test::Prereq::prereqs = sort keys %prereqs; 1; } } #unless( caller ) { prereq_ok() } =head1 FUNCTIONS =over 4 =item prereq_ok( [ VERSION, [ 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. If you don't specify a version, C assumes you want to compare the list of prerequisite modules to the version of perl running the 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; $version = shift || $default_version; my $name = shift || 'Prereq test'; my $skip = shift || []; $version = $default_version unless exists $Module::CoreList::version{$version}; unless( ref $skip eq ref [] ) { carp( 'Third 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 anything is left, look for modules in the distributions # in PREREQ_PM. this is slow, so we should only do it if # we might need it. if( keys %$loaded and $class->_should_i_expand_prereqs ) { my $modules = $class->_get_from_prereqs( $prereqs ); foreach my $module ( @$modules ) { 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; } # expand prereqs and see what we get sub _should_i_expand_prereqs { !! $ENV{TEST_PREREQ_EXPAND_WITH_CPAN} } sub _get_from_prereqs { my $class = shift; my $modules = shift; my @dist_modules = (); return [] unless $class->_should_i_expand_prereqs; require CPAN; foreach my $module ( @$modules ) { my $mod = CPAN::Shell->expand( "Module", $module ); next unless ref $mod; my $distfile = $mod->cpan_file; my $dist = CPAN::Shell->expand( "Distribution", $distfile ); my @found = $dist->containsmods; push @dist_modules, @found; } return \@dist_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 { my( $class, $file ) = @_; my $module = Module::Info->new_from_file( $file ); $module->die_on_compilation_error(1); my @used = eval{ $module->modules_used }; my @modules = sort grep { not exists $Module::CoreList::version{$version}{$_} } @used; @modules = grep { not /$Namespace/ } @modules if $Namespace; return \@modules; } =back =head1 TO DO * set up a couple fake module distributions to test * warn about things that show up in C unnecessarily =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-2010, brian d foy, All rights reserved This software is available under the same terms as perl. =cut 1; Test-Prereq-1.037/t/000075500000000000000000000000001213533131500141355ustar00rootroot00000000000000Test-Prereq-1.037/t/get_from_file.t000064400000000000000000000011221213533131500171170ustar00rootroot00000000000000use Test::More tests => 2; use Test::Prereq; my $modules = Test::Prereq->_get_from_file( 't/pod.t' ); my @modules = grep ! /^CPANPLUS/, @$modules; diag "Did not find right modules from t/pod.t!\n" . "Found <@modules>\n" unless ok( eq_array( \@modules, [] ), 'Right modules for t/pod.t' ); $modules = Test::Prereq->_get_from_file( 'lib/Prereq.pm' ); @modules = grep ! /^CPANPLUS/, @$modules; diag "Did not find right modules for lib/Prereq.pm!\n" . "Found <@modules>\n" unless ok( eq_array( \@modules, [ qw( Module::Info ) ] ), 'Right modules for t/Prereq.pm' ); Test-Prereq-1.037/t/get_from_prereqs.t000064400000000000000000000002731213533131500176670ustar00rootroot00000000000000use strict; use Test::Prereq; use Test::More tests => 1; use lib qw(.); print STDERR "\nThis may take awhile...\n"; my $modules = Test::Prereq->_get_from_prereqs( [ 'Tk' ] ); ok(1); Test-Prereq-1.037/t/get_loaded_modules.t000064400000000000000000000016401213533131500201420ustar00rootroot00000000000000use Test::More tests => 1; use Test::Prereq; { my $modules = Test::Prereq->_get_loaded_modules(); my $keys = [ grep ! /^CPANPLUS/, sort keys %$modules ]; print STDERR "Didn't find right modules! Found < @$keys >\n" unless ok( eq_array( $keys, [ qw( Module::Info Test::Prereq Test::Prereq::Build ) ] ), 'Right modules for modules and tests' ); } __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-1.037/t/get_prereqs.t000064400000000000000000000027431213533131500166500ustar00rootroot00000000000000use strict; BEGIN{ $^W = 0; } use Test::More tests => 5; use Cwd; use Test::Prereq; use Test::Prereq::Build; use lib qw(.); # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 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' ); # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # { my $cwd = cwd; chdir "testdir" 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 dirctory! $!"; } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # { 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 dirctory! $!"; } Test-Prereq-1.037/t/import.t000064400000000000000000000012041213533131500156310ustar00rootroot00000000000000use 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-1.037/t/load.t000064400000000000000000000004431213533131500152420ustar00rootroot00000000000000BEGIN { @classes = qw(Test::Prereq Test::Prereq::Build); } use Test::More tests => 2 * scalar @classes; 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" ); } Test-Prereq-1.037/t/pod.t000064400000000000000000000002011213533131500150750ustar00rootroot00000000000000use 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-1.037/t/pod_coverage.t000064400000000000000000000004531213533131500167610ustar00rootroot00000000000000use Test::More; eval "use Test::Pod::Coverage"; if( $@ ) { plan skip_all => "Test::Pod::Coverage required for testing POD"; } else { plan tests => 2; pod_coverage_ok( "Test::Prereq" ); pod_coverage_ok( "Test::Prereq::Build", { trustme => [ qr/create_build_script|prereq_ok/ ] } ); } Test-Prereq-1.037/t/prereq_ok.t000064400000000000000000000001311213533131500163040ustar00rootroot00000000000000use Test::Prereq::Build; prereq_ok( undef, undef, [ qw(CPANPLUS::Internals::System) ] ); Test-Prereq-1.037/t/prior_plan.t000064400000000000000000000001741213533131500164710ustar00rootroot00000000000000use Test::More tests => 2; use Test::Prereq::Build; prereq_ok( undef, undef, [ qw(CPANPLUS::Internals::System) ] ); ok(1); Test-Prereq-1.037/t/test_manifest000064400000000000000000000002041213533131500167210ustar00rootroot00000000000000load.t pod.t pod_coverage.t prereq_ok.t import.t get_from_file.t get_from_prereqs.t get_loaded_modules.t get_prereqs.t prior_plan.t Test-Prereq-1.037/testdir/000075500000000000000000000000001213533131500153505ustar00rootroot00000000000000Test-Prereq-1.037/testdir/MANIFEST000064400000000000000000000000531213533131500164770ustar00rootroot00000000000000this is here to make Module::Build shut up Test-Prereq-1.037/testdir/Makefile.PL000064400000000000000000000010201213533131500173130ustar00rootroot00000000000000use ExtUtils::MakeMaker; WriteMakefile ( '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-1.037/testdir/bad_makefile/000075500000000000000000000000001213533131500177335ustar00rootroot00000000000000Test-Prereq-1.037/testdir/bad_makefile/Makefile.PL000064400000000000000000000006041213533131500217050ustar00rootroot00000000000000use ExtUtils::MakeMaker; WriteMakefile ( '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;