You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2001/09/05 06:43:54 UTC

[patch] pre-run core scan

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:stas@stason.org   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [patch] pre-run core scan

Posted by Stas Bekman <st...@stason.org>.
On Wed, 5 Sep 2001, Doug MacEachern wrote:

> On Wed, 5 Sep 2001, Stas Bekman wrote:
>
> > 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.
>
> good idea.
>
> but how to break this habit of yours? ;-)
> > +sub warn_core{
>   +sub warn_core {

Mea Culpa

It's hard to change habits ;)


_____________________________________________________________________
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/



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [patch] pre-run core scan

Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 5 Sep 2001, Stas Bekman wrote:

> 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.

good idea.

but how to break this habit of yours? ;-)
> +sub warn_core{
  +sub warn_core {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org