The new scanning for the core file is nice, but many times I get a false
alarm when I get an old core file alert. This patch warns the user when a
core file is found before tests have started.

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.49
diff -u -r1.49 TestRun.pm
--- Apache-Test/lib/Apache/TestRun.pm   2001/08/31 17:44:36     1.49
+++ Apache-Test/lib/Apache/TestRun.pm   2001/09/05 04:38:52
@@ -433,6 +433,8 @@

     $self->{test_config} = $self->new_test_config;

+    $self->warn_core();
+
     $self->{server} = $self->{test_config}->server;

     local($SIG{__DIE__}, $SIG{INT});
@@ -480,6 +482,22 @@
         error "for stacktrace, run: gdb $vars->{httpd} -core $core";
     }, $vars->{top_dir});
 }
+
+
+# warn the user that there is a core file before the tests
+# start. suggest to delete it before proceeding or a false alarm can
+# be generated at the end of the test routine run.
+sub warn_core{
+    my $self = shift;
+    my $vars = $self->{test_config}->{vars};
+
+    finddepth(sub {
+        return unless /^core$/;
+        my $core = "$File::Find::dir/$_";
+        error "consider removing an old $core file before running tests";
+    }, $vars->{top_dir});
+}
+

 sub run_request {
     my($test_config, $opts) = @_;



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



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to