[Catalyst] Test server as a child process

Andy Grundman andy at hybridized.org
Tue Jul 31 14:40:01 GMT 2007


On Jul 31, 2007, at 4:33 AM, Ivan Fomichev wrote:

> Hello,
>
> I intend to write a script, that would start the test server as a
> child process and then run tests. The thing I'm failing to do is to
> get output from the test server in order to determine, when the server
> has started.
>
> The problem is that test server doesn't print its prompt ("You can
> connect to your server at http://localhost:3000") when run as a child
> process :-(
>
> I dug Catalyst's sources, but didn't understood much. I put 'sleep' in
> parent process for now, but I don't like it. Could anyone suggest an
> adequate work-around? Thank you in advance.

Take a look at the core test file t/optional_http-server.t.  It does  
exactly what you are looking to do: launch the HTTP server, wait for  
it to start, run some tests, and shut it down again.  But note that  
you don't actually need to run the HTTP server in order to test your  
code.



More information about the Catalyst mailing list