diff options
Diffstat (limited to 'TAO/examples/POA/Loader/run_test.pl')
-rwxr-xr-x | TAO/examples/POA/Loader/run_test.pl | 101 |
1 files changed, 55 insertions, 46 deletions
diff --git a/TAO/examples/POA/Loader/run_test.pl b/TAO/examples/POA/Loader/run_test.pl index 9a8ff679ab4..a849b92bac7 100755 --- a/TAO/examples/POA/Loader/run_test.pl +++ b/TAO/examples/POA/Loader/run_test.pl @@ -5,20 +5,23 @@ 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 ("ior"); +$iorfile = "ior"; -$status = 0; $oneway = ""; $iterations = 100; $extra_args = ""; # Parse the arguments -for ($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") { +for ($i = 0; $i <= $#ARGV; $i++) +{ + SWITCH: + { + if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") + { print "run_test [-h] [-i iterations] [-o] [-f ior file]\n"; print "\n"; print "-h -- prints this information\n"; @@ -27,20 +30,25 @@ for ($i = 0; $i <= $#ARGV; $i++) { print "-o -- call issued are oneways\n"; exit; } - elsif ($ARGV[$i] eq "-o") { - $oneway = "-o"; + if ($ARGV[$i] eq "-o") + { + $oneway = "-o"; + last SWITCH; } - elsif ($ARGV[$i] eq "-i") { - $iterations = $ARGV[$i + 1]; - $i++; + if ($ARGV[$i] eq "-i") + { + $iterations = $ARGV[$i + 1]; + $i++; + last SWITCH; } - elsif ($ARGV[$i] eq "-f") { - $iorfile = $ARGV[$i + 1]; - $i++; - } - else { - $extra_args .= " " . $ARGV[$i]; + if ($ARGV[$i] eq "-f") + { + $iorfile = $ARGV[$i + 1]; + $i++; + last SWITCH; } + $extra_args .= " " . $ARGV[$i]; + } } $iorfile_1 = $iorfile."_1"; @@ -49,49 +57,50 @@ $iorfile_2 = $iorfile."_2"; unlink $iorfile_1; unlink $iorfile_2; -$SV = new PerlACE::Process ("server", "-f $iorfile $extra_args"); -$CL = new PerlACE::Process ("../Generic_Servant/client"); - -$SV->Spawn (); +$SV = Process::Create ($EXEPREFIX."server$EXE_EXT", "-f $iorfile $extra_args"); -if (PerlACE::waitforfile_timed ($iorfile_1, 5) == -1) { - print STDERR "ERROR: cannot find file <$iorfile_1>\n"; - $SV->Kill (); - exit 1; +if (ACE::waitforfile_timed ($iorfile_1, 5) == -1) { + print STDERR "ERROR: cannot find file <$iorfile_1>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; } -if (PerlACE::waitforfile_timed ($iorfile_2, 5) == -1) { - print STDERR "ERROR: cannot find file <$iorfile_2>\n"; - $SV->Kill (); - exit 1; +if (ACE::waitforfile_timed ($iorfile_2, 5) == -1) { + print STDERR "ERROR: cannot find file <$iorfile_2>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; } -$CL->Arguments ("$extra_args $oneway -i $iterations -f $iorfile_1"); -$client = $CL->SpawnWaitKill (60); +$CL_1 = Process::Create ("../Generic_Servant/client$EXE_EXT ", + " $extra_args $oneway -i $iterations -f $iorfile_1"); -if ($client != 0) { - print STDERR "ERROR: client 1 returned $client\n"; - $status = 1; +$client_1 = $CL_1->TimedWait (60); +if ($client_1 == -1) { + print STDERR "ERROR: client 1 timedout\n"; + $CL_1->Kill (); $CL_1->TimedWait (1); } -$CL->Arguments ("$extra_args $oneway -i $iterations -f $iorfile_2 -x"); - -$client = $CL->SpawnWaitKill (60); +$CL_2 = Process::Create ("../Generic_Servant/client$EXE_EXT ", + " $extra_args $oneway -i $iterations -f $iorfile_2 -x"); -if ($client != 0) { - print STDERR "ERROR: client 2 returned $client\n"; - $status = 1; +$client_2 = $CL_2->TimedWait (60); +if ($client_2 == -1){ + print STDERR "ERROR: client 2 timedout\n"; + $CL_2->Kill (); $CL_2->TimedWait (1); } -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; +$server = $SV->TimedWait (5); +if ($server == -1) { + print STDERR "ERROR: server timedout\n"; + $SV->Kill (); $SV->TimedWait (1); } unlink $iorfile_1; unlink $iorfile_2; -exit $status; +if ($server !=0 || $client_1 != 0 || $client_2 != 0) { + exit 1; +} + +exit 0; |