Apache::Test hooks?

Torsten Förtsch <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
Hi,

for my current project I need an additional server process to run to run my 
tests. What I came up with is this (snippet from t/TEST.PL):

use Apache::TestTrace;
use Apache::TestServer ();
BEGIN {
  no warnings 'redefine';
  my $orig_start=\&Apache::TestServer::start;
  *Apache::TestServer::start=sub {
    my $rc=$orig_start->(@_);
    if( $rc ) {
      notice "Starting sessionserver";
    }
    return $rc;
  };

  my $orig_stop=\&Apache::TestServer::stop;
  *Apache::TestServer::stop=sub {
    my $rc=$orig_stop->(@_);
    if( $rc!=-1 ) {
      notice "Stopping sessionserver";
    }
    return $rc;
  };
}

Is that the right way to go?

Torsten Förtsch

-- 
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.