httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: forcing cleanup
Date Sun, 02 Sep 2001 13:49:00 GMT
On Fri, 31 Aug 2001, Doug MacEachern wrote:

> On Fri, 31 Aug 2001, Stas Bekman wrote:
>
> > When you cvs update, make sure to run './t/TEST -clean'. I've noticed that
> > one of the subtests in alias.t was failing. It was because extra.conf.in
> > has been changed, but the stale autogenerated extra.conf was used.
> >
> > what about using MD5 checksums, to decide whether to rebuild .in files or
> > not, to cause less errors and questions?
>
> just comparing mtimes would be good enough.

this works for me. I had to exit on reconfiguration, since otherwise it'd
fail to continue. Should I reconfigure in a different way, so I won't have
to exit?

This patch: force reconfiguration when:

- httpd is newer than conf/httpd.conf
- conf/*.in are newer than the autogenerated conf/*

Index: Apache-Test/lib/Apache/TestConfig.pm
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.50
diff -u -r1.50 TestConfig.pm
--- Apache-Test/lib/Apache/TestConfig.pm	2001/08/28 16:02:56	1.50
+++ Apache-Test/lib/Apache/TestConfig.pm	2001/09/02 13:45:23
@@ -774,6 +774,30 @@
     close $out or die "close $conf_file: $!";
 }

+sub need_reconfiguration{
+    my $self = shift;
+    my @reasons = ();
+    my $vars = $self->{vars};
+
+    # if httpd.conf is older than httpd executable
+    push @reasons,
+        "$vars->{httpd} is newer than $vars->{t_conf_file}"
+            if -e $vars->{httpd} &&
+               -e $vars->{t_conf_file} &&
+               -M $vars->{httpd} < -M $vars->{t_conf_file};
+
+    # if .in files are newer than their derived versions
+    if (my $extra_conf = $self->generate_extra_conf) {
+        for my $file (@$extra_conf) {
+            push @reasons, "$file.in is newer than $file"
+                if -e $file && -M "$file.in" < -M $file;
+        }
+    }
+
+    return @reasons;
+}
+
+
 #shortcuts

 my %include_headers = (GET => 1, HEAD => 2);
Index: Apache-Test/lib/Apache/TestRun.pm
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
retrieving revision 1.46
diff -u -r1.46 TestRun.pm
--- Apache-Test/lib/Apache/TestRun.pm	2001/08/31 10:22:31	1.46
+++ Apache-Test/lib/Apache/TestRun.pm	2001/09/02 13:45:23
@@ -400,6 +400,13 @@
         $self->opt_clean(1);
     }

+    if (my @reasons = $self->{test_config}->need_reconfiguration) {
+        warning "forcing current re-configuration:";
+        warning "\t- $_." for @reasons;
+        $self->opt_clean(1);
+        exit;
+    }
+
     $self->configure;

     if ($self->{opts}->{configure}) {


_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:stas@stason.org   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



Mime
View raw message