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. 8<------------------------script/myapp_regtest.pl-------------------------- #!/usr/bin/perl use strict; use warnings; use Config::IniFiles; use File::Spec::Functions; use FindBin; use POSIX qw/ :signal_h /; my $ini = Config::IniFiles->new( -file => catfile( $FindBin::Bin, updir, 'myapp_regtest.ini' ) ); $ENV{MYAPP_DSN} = $ini->val( 'database', 'dsn' ); defined ( my $catalyst_pid = open(CHILD, '-|') ) or die "cannot fork: $!"; if ( !$catalyst_pid ) { my $port = $ini->val( 'catalyst', 'port' ); exec( catfile( $FindBin::Bin, 'myapp_server.pl' ), '-p', $port ); } print scalar <CHILD>; my $lib = catdir( $FindBin::Bin, updir, 'lib' ); chdir catdir( $FindBin::Bin, updir ); system( 'prove', '--lib', $lib, 't' ); kill SIGINT, $catalyst_pid; 8<----------------------------------END------------------------------------ Regards, Ivan _______________________________________________ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/