Apache-Test
view release on metacpan or search on metacpan
superclass' method. [Stas]
Apache::TestRunPerl now performs an early check whether it can load
the right mod_perl environment. [William McKee <william@knowmad.com>,
Stas]
$ENV{APACHE_TEST_NO_STICKY_PREFERENCES}, if true, will both suppress
generation of persistent preferences and ignore any that already exist.
[Geoffrey Young]
make the project's test suite relocatable, handling the case where
after Apache-Test configuration was created and not cleaned up before
the directory was moved. This is especially important for those cases
where users try to run 'make test' as root from /root, A-T tells them
that they can't do that (because of the perms) and suggests to try
again, afer moving the whole project under /tmp or similar. [Stas]
When running as 'root' make the client side drop the root permissions
and run with the same permissions as the server side
(e.g. nobody). This is needed in case the client side creates any
files after the initial check (during server side startup and beyond),
lib/Apache/TestRun.pm view on Meta::CPAN
chdir $top if $top and -d $top;
}
# reconstruct argv, preserve multiwords args, eg 'PerlTrace all'
my $argv = join " ", map { /^-/ ? $_ : qq['$_'] } @ARGV;
$orig_command = "$^X $0 $argv";
$orig_cwd = Cwd::cwd();
$self->set_ulimit;
$self->set_env; #make sure these are always set
$self->detect_relocation($orig_cwd);
my(@argv) = @_;
$self->getopts(\@argv);
$self->pre_configure();
# can't setup the httpd-specific parts of the config object yet
$self->{test_config} = $self->new_test_config();
lib/Apache/TestRun.pm view on Meta::CPAN
}
# make it easy to move the whole distro w/o running
# 't/TEST -clean' before moving. when moving the whole package,
# the old cached config will stay, so we want to nuke it only if
# we realize that it's no longer valid. we can't just check the
# existance of the saved top_dir value, since the project may have
# been copied and the old dir could be still there, but that's not
# the one that we work in
sub detect_relocation {
my($self, $cur_top_dir) = @_;
my $config_file = catfile qw(t conf apache_test_config.pm);
return unless -e $config_file;
my %inc = %INC;
eval { require "./$config_file" };
%INC = %inc; # be stealth
warn($@), return if $@;
my $cfg = 'apache_test_config'->new;
# if the top_dir from saved config doesn't match the current
# top_dir, that means that the whole project was relocated to a
# different directory, w/o running t/TEST -clean first (in each
# directory with a test suite)
my $cfg_top_dir = $cfg->{vars}->{top_dir};
return unless $cfg_top_dir;
return if $cfg_top_dir eq $cur_top_dir;
# if that's the case silently fixup the saved config to use the
# new paths, and force a complete cleanup. if we don't fixup the
# config files, the cleanup process won't be able to locate files
# to delete and re-configuration will fail
( run in 1.175 second using v1.01-cache-2.11-cpan-71847e10f99 )