perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Foertsch <torsten.foert...@gmx.net>
Subject Re: svn commit: r428355 - in /perl/Apache-SizeLimit/trunk/t: apache/check_n_requests.t apache/check_n_requests2.t response/TestApache/check_n_requests.pm response/TestApache/check_n_requests2.pm
Date Thu, 03 Aug 2006 19:51:02 GMT
On Thursday 03 August 2006 13:41, Philip M. Gollucci wrote:
> Now,
>   is there a way to programatically check the t/logs/error_log for the
> existance / non existance of the A::SL child killed message ?  In the mean
> time, this at least exercises the code that caused David Wheeler's error.

In one of my tests I use this:

{
  my $f;
  sub t_start_error_log_watch {
    my $name=File::Spec->catfile( Apache::Test::vars->{t_logs}, 'error_log' );
    open $f, "$name" or die "ERROR: Cannot open $name: $!\n";
    seek $f, 0, 2;
  }

  sub t_finish_error_log_watch {
    local $/="\n";
    my @lines=<$f>;
    undef $f;
    return @lines;
  }
}

then

t_start_error_log_watch;
do_it;
ok grep {...} t_finish_error_log_watch;

Torsten

Mime
View raw message