httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRun.pm
Date Mon, 31 Dec 2001 06:16:07 GMT
stas        01/12/30 22:16:07

  Modified:    perl-framework/Apache-Test/lib/Apache TestRun.pm
  Log:
  - s/scan/scan_core/ for consistency with warn_core
  - don't complain aloud when a core file from an earlier tests run is found
  
  Revision  Changes    Path
  1.77      +18 -6     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.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- TestRun.pm	22 Dec 2001 02:28:27 -0000	1.76
  +++ TestRun.pm	31 Dec 2001 06:16:07 -0000	1.77
  @@ -16,6 +16,8 @@
   
   use constant STARTUP_TIMEOUT => 300; # secs (good for extreme debug cases)
   
  +my %core_files  = ();
  +
   my @std_run      = qw(start-httpd run-tests stop-httpd);
   my @others       = qw(verbose configure clean help ssl http11);
   my @flag_opts    = (@std_run, @others);
  @@ -274,7 +276,7 @@
                local $?; # preserve the exit status
                eval {
                   Apache::TestRun->new(test_config =>
  -                                     Apache::TestConfig->thaw)->scan;
  +                                     Apache::TestConfig->thaw)->scan_core;
                };
            }';
   }
  @@ -573,7 +575,7 @@
       $oh[ rand scalar @oh ];
   }
   
  -sub scan {
  +sub scan_core {
       my $self = shift;
       my $vars = $self->{test_config}->{vars};
       my $times = 0;
  @@ -581,10 +583,16 @@
       finddepth(sub {
           return unless /^core$/;
           my $core = "$File::Find::dir/$_";
  -        my $oh = oh();
  -        my $again = $times++ ? "again" : "";
  -        error "oh $oh, server dumped core $again";
  -        error "for stacktrace, run: gdb $vars->{httpd} -core $core";
  +        if (exists $core_files{$core} && $core_files{$core} == -M $core) {
  +            # we have seen this core file before the start of the test
  +            info "an old core file has been found: $core";
  +        }
  +        else {
  +            my $oh = oh();
  +            my $again = $times++ ? "again" : "";
  +            error "oh $oh, server dumped core $again";
  +            error "for stacktrace, run: gdb $vars->{httpd} -core $core";
  +        }
       }, $vars->{top_dir});
   }
   
  @@ -594,11 +602,15 @@
   sub warn_core {
       my $self = shift;
       my $vars = $self->{test_config}->{vars};
  +    %core_files = (); # reset global
   
       finddepth(sub {
           return unless /^core$/;
           my $core = "$File::Find::dir/$_";
           error "consider removing an old $core file before running tests";
  +        # remember the timestamp of $core so we can check if it's the
  +        # old core file at the end of the run and not complain then
  +        $core_files{$core} = -M $core;
       }, $vars->{top_dir});
   }
   
  
  
  

Mime
View raw message