stas 2004/01/30 17:53:09
Modified: perl-framework/Apache-Test/lib/Apache TestConfig.pm
TestRun.pm
Log:
more reconfiguration tweaks: remove the last change adding unconditional
reconfigure when 'reconfigure' attr was set, replace with a check
whether env vars were passed, with a nicely printed reason for
reconfiguraton. (more tweaks are needed)
Revision Changes Path
1.204 +10 -0
httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm
Index: TestConfig.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.203
retrieving revision 1.204
diff -u -u -r1.203 -r1.204
--- TestConfig.pm 31 Jan 2004 01:46:43 -0000 1.203
+++ TestConfig.pm 31 Jan 2004 01:53:09 -0000 1.204
@@ -1397,6 +1397,16 @@
}
}
+ # if special env variables are used (since they can change any time)
+ # XXX: may be we could check whether they have changed since the
+ # last run and thus avoid the reconfiguration?
+ {
+ my $passenv = passenv();
+ if (my @env_vars = grep { $ENV{$_} } keys %$passenv) {
+ push @reasons, "environment variables (@env_vars) are set";
+ }
+ }
+
return @reasons;
}
1.145 +5 -13
httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm
Index: TestRun.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -u -r1.144 -r1.145
--- TestRun.pm 31 Jan 2004 01:12:17 -0000 1.144
+++ TestRun.pm 31 Jan 2004 01:53:09 -0000 1.145
@@ -243,7 +243,10 @@
# only test files/dirs if any at all are left in argv
$self->{argv} = [EMAIL PROTECTED];
- # force regeneration of httpd.conf if commandline args want to modify it
+ # force regeneration of httpd.conf if commandline args want to
+ # modify it. configure_opts() has more checks to decide whether to
+ # reconfigure or not.
+ # XXX: $self->passenv() is already tested in need_reconfiguration()
$self->{reconfigure} = $opts{configure} ||
(grep { $opts{$_}->[0] } qw(preamble postamble)) ||
(grep { $Apache::TestConfig::Usage{$_} } keys %conf_opts ) ||
@@ -276,6 +279,7 @@
if ($self->{reconfigure}) {
$conf_opts{save} = 1;
+ delete $self->{reconfigure};
}
else {
$conf_opts{thaw} = 1;
@@ -417,18 +421,6 @@
}
else {
$test_config->{vars}->{proxy} = 'off';
- }
-
- if (!$refreshed && $self->{reconfigure}) {
- # XXX: there is a whole bunch of reasons, see above where
- # $self->{reconfigure} is defined, could add reasons there or
- # may be move the logic from there here?
- warning "forcing re-configuration";
- unless ($refreshed) {
- $self->refresh;
- $refreshed = 1;
- $test_config = $self->{test_config};
- }
}
return unless $$save;