[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cgiapp] Re: Testing CGI::Application with HTTP::Server::Simple(::CGI)


On 2005-06-29, Shawn Sorichetti <suppressed> wrote:
>
>      HTTP::Server::Simple is a module by Jesse Vincent. It uses only  
> modules that are included with Perl to provide a basic webserver,  
> that works really well for testing.

Two questions: 

1. Does this technique make it faster to run the test suite than using a
   real Apache? 

2. What about customizing the port number? [ checks. ] I can answer this
   one myself: $server->port($my_personal_port_no).


> # If something goes wrong, make sure to stop the HTTP server.
> sub cleanup { kill(9,$pid) }
> $SIG{__DIE__}=\&cleanup;

Would it be better to put this in an END block? I'm not sure if this
signal gets thrown at a normal exit. I use END blocks in test scripts
for stuff like this and they work well. 

I think END blocks works whether the death is premature or not. 

    Mark

-- 
http://mark.stosberg.com/ 


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.