Author: kwilliams
Date: Tue Aug 22 18:42:08 2006
New Revision: 6825
Modified:
Module-Build/trunk/Changes
Module-Build/trunk/lib/Module/Build.pm
Module-Build/trunk/lib/Module/Build/API.pod
Module-Build/trunk/lib/Module/Build/Base.pm
Log:
Instead of the --test_with_blib parameter, add a 'retest' action that
accomplishes basically the same thing.
Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes (original)
+++ Module-Build/trunk/Changes Tue Aug 22 18:42:08 2006
@@ -17,10 +17,8 @@
the eval() was unsuccessful, rather than continuing blindly on and
dying mysteriously later.
- - Added a 'test_with_blib' parameter, default true, that lets users
- avoid adding the blib/ directories to @INC when testing, and
- therefore lets people run the current regression tests on
- previously-installed versions of a distribution.
+ - Added a 'retest' action that lets users run the current regression
+ tests on a previously-installed version of a distribution.
0.2805 Sat Jul 29 22:01:24 CDT 2006
Modified: Module-Build/trunk/lib/Module/Build.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build.pm (original)
+++ Module-Build/trunk/lib/Module/Build.pm Tue Aug 22 18:42:08 2006
@@ -504,6 +504,17 @@
C<realclean> action, you are essentially starting over, so you will
have to re-create the C<Build> script again.
+=item retest
+
+[version 0.2806]
+
+This is just like the C<test> action, but doesn't actually build the
+distribution first, and doesn't add F<blib/> to the load path, and
+therefore will test against a I<previously> installed version of the
+distribution. This can be used to verify that a certain installed
+distribution still works, or to see whether newer versions of a
+distribution still pass the old regression tests, and so on.
+
=item skipcheck
[version 0.05]
Modified: Module-Build/trunk/lib/Module/Build/API.pod
==============================================================================
--- Module-Build/trunk/lib/Module/Build/API.pod (original)
+++ Module-Build/trunk/lib/Module/Build/API.pod Tue Aug 22 18:42:08 2006
@@ -716,21 +716,6 @@
for C<*.t> files.
-=item test_with_blib
-
-[version 0.2806]
-
-A boolean parameter, default true, that indicates whether the F<blib/>
-directories will be added to C<@INC> when testing. When set to false,
-this lets users run the current regression tests on
-previously-installed versions of a distribution.
-
-This isn't always guaranteed to work, of course -- some distributions
-might do some fancy stuff during testing, or might explicitly check
-whether the code is being loaded from F<blib/>, or some other thing to
-foil your attempts, but sometimes it can be helpful.
-
-
=item xs_files
[version 0.19]
Modified: Module-Build/trunk/lib/Module/Build/Base.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/Base.pm (original)
+++ Module-Build/trunk/lib/Module/Build/Base.pm Tue Aug 22 18:42:08 2006
@@ -17,6 +17,7 @@
use Module::Build::ModuleInfo;
use Module::Build::Notes;
+use Module::Build::Config;
#################### Constructors ###########################
@@ -759,7 +760,6 @@
__PACKAGE__->add_property(use_rcfile => 1);
__PACKAGE__->add_property(create_packlist => 1);
__PACKAGE__->add_property(allow_mb_mismatch => 0);
-__PACKAGE__->add_property(test_with_blib => 1);
{
my $Is_ActivePerl = eval {require ActivePerl::DocTools};
@@ -1984,13 +1984,45 @@
return $out;
}
+sub ACTION_retest {
+ my ($self) = @_;
+
+ # Protect others against our @INC changes
+ local @INC = @INC;
+
+ # Filter out nonsensical @INC entries - some versions of
+ # Test::Harness will really explode the number of entries here
+ @INC = grep {ref() || -d} @INC if @INC > 100;
+
+ $self->do_tests;
+}
+
+
sub ACTION_test {
my ($self) = @_;
my $p = $self->{properties};
- require Test::Harness;
$self->depends_on('code');
+ # Protect others against our @INC changes
+ local @INC = @INC;
+
+ # Make sure we test the module in blib/
+ unshift @INC, (File::Spec->catdir($p->{base_dir}, $self->blib, 'lib'),
+ File::Spec->catdir($p->{base_dir}, $self->blib, 'arch'));
+
+ # Filter out nonsensical @INC entries - some versions of
+ # Test::Harness will really explode the number of entries here
+ @INC = grep {ref() || -d} @INC if @INC > 100;
+
+ $self->do_tests;
+}
+
+sub do_tests {
+ my $self = shift;
+ my $p = $self->{properties};
+ require Test::Harness;
+
# Do everything in our power to work with all versions of Test::Harness
my @harness_switches = $p->{debugger} ? qw(-w -d) : ();
local $Test::Harness::switches = join ' ', grep defined,
$Test::Harness::switches, @harness_switches;
@@ -2006,19 +2038,6 @@
$ENV{TEST_VERBOSE},
$ENV{HARNESS_VERBOSE}) = ($p->{verbose} || 0) x 4;
- # Protect others against our @INC changes
- local @INC = @INC;
-
- if ($p->{test_with_blib}) {
- # Make sure we test the module in blib/
- unshift @INC, (File::Spec->catdir($p->{base_dir}, $self->blib, 'lib'),
- File::Spec->catdir($p->{base_dir}, $self->blib, 'arch'));
- }
-
- # Filter out nonsensical @INC entries - some versions of
- # Test::Harness will really explode the number of entries here
- @INC = grep {ref() || -d} @INC if @INC > 100;
-
my $tests = $self->find_test_files;
if (@$tests) {