diff options
Diffstat (limited to 'TAO/examples/POA/Default_Servant/run_test.pl')
-rwxr-xr-x | TAO/examples/POA/Default_Servant/run_test.pl | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/TAO/examples/POA/Default_Servant/run_test.pl b/TAO/examples/POA/Default_Servant/run_test.pl index c232bbd92b8..c303370d131 100755 --- a/TAO/examples/POA/Default_Servant/run_test.pl +++ b/TAO/examples/POA/Default_Servant/run_test.pl @@ -5,39 +5,38 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -use lib "../../../../bin"; -use PerlACE::Run_Test; +unshift @INC, '../../../../bin'; +require ACEutils; -$iorfile = PerlACE::LocalFile ("server.ior"); -$status = 0; +$iorfile = "server.ior"; unlink $iorfile; -$SV = new PerlACE::Process ("server", "-o $iorfile"); -$CL = new PerlACE::Process ("client", "-k $iorfile"); +$SV = Process::Create ($EXEPREFIX."server".$EXE_EXT, + " -o $iorfile"); -$SV->Spawn (); +if (ACE::waitforfile_timed ($iorfile, 5) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} + +$CL = Process::Create ($EXEPREFIX."client$EXE_EXT ", + " -k $iorfile"); -if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); - exit 1; +$client = $CL->TimedWait (60); +if ($client == -1) { + print STDERR "ERROR: client timedout\n"; + $CL->Kill (); $CL->TimedWait (1); } -$client = $CL->SpawnWaitKill (60); -$server = $SV->TerminateWaitKill (10); +$SV->Kill (); $SV->TimedWait (1); unlink $iorfile; unlink "test"; # created by the program if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; + exit 1; } -exit $status; +exit 0; |