summaryrefslogtreecommitdiff
path: root/TAO/examples/POA/Reference_Counted_Servant/run_test.pl
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/examples/POA/Reference_Counted_Servant/run_test.pl')
-rwxr-xr-xTAO/examples/POA/Reference_Counted_Servant/run_test.pl95
1 files changed, 52 insertions, 43 deletions
diff --git a/TAO/examples/POA/Reference_Counted_Servant/run_test.pl b/TAO/examples/POA/Reference_Counted_Servant/run_test.pl
index 99631aec9c6..dcdcbfa92ac 100755
--- a/TAO/examples/POA/Reference_Counted_Servant/run_test.pl
+++ b/TAO/examples/POA/Reference_Counted_Servant/run_test.pl
@@ -5,10 +5,10 @@ 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 ("poa.ior");
+$iorfile = "ior";
$oneway = "";
$iterations = 100;
@@ -16,61 +16,70 @@ $iterations = 100;
$extra_args = "";
# Parse the arguments
-for ($i = 0; $i <= $#ARGV; $i++) {
- 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";
- print "-f -- ior file\n";
- print "-i iterations -- specifies iterations\n";
- print "-o -- call issued are oneways\n";
- exit;
+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";
+ print "-f -- ior file\n";
+ print "-i iterations -- specifies iterations\n";
+ 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];
+ }
}
unlink $iorfile;
-$SV = new PerlACE::Process ("server", "-f $iorfile $extra_args");
-$CL = new PerlACE::Process ("../Generic_Servant/client", "$extra_args $oneway -i $iterations -f $iorfile -x");
-
-$status = 0;
-
-$SV->Spawn ();
+$SV = Process::Create ($EXEPREFIX."server$EXE_EXT", "-f $iorfile $extra_args");
-if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
- print STDERR "ERROR: cannot find file <$iorfile>\n";
- $SV->Kill ();
- exit 1;
+if (ACE::waitforfile_timed ($iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
}
-$client = $CL->SpawnWaitKill (60);
+$CL = Process::Create ("../Generic_Servant/client$EXE_EXT ",
+ " $extra_args $oneway -i $iterations -f $iorfile -x");
-if ($client != 0) {
- print STDERR "ERROR: client returned $client\n";
- $status = 1;
+$client = $CL->TimedWait (60);
+if ($client == -1) {
+ print STDERR "ERROR: client timedout\n";
+ $CL->Kill (); $CL->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;
-exit $status;
+if ($server != 0 || $client != 0){
+ exit 1;
+}
+
+exit 0;