summaryrefslogtreecommitdiff
path: root/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl')
-rwxr-xr-xTAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl304
1 files changed, 91 insertions, 213 deletions
diff --git a/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl b/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl
index f3d52ad8721..738d2c8fa96 100755
--- a/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl
+++ b/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl
@@ -11,259 +11,137 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# Do not use environment variables here since not all platforms use ACE_ROOT
use lib "../../../../../bin";
-
+use PerlACE::Run_Test;
use English;
-require Process;
-require ACEutils;
-$iorfile = "cubit.ior";
-$exepref = '.' . $DIR_SEPARATOR;
+$status = 0;
+
+$iorfile = PerlACE::LocalFile ("cubit.ior");
+$iiop_lite_conf = PerlACE::LocalFile ("iiop_lite.conf");
+$uiop_lite_conf = PerlACE::LocalFile ("uiop_lite.conf");
+$server_shmiop_conf = PerlACE::LocalFile ("server_shmiop.conf");
+
$svnsflags = " -f $iorfile";
$clnsflags = " -f $iorfile";
$clflags = "";
$svflags = "";
-$quietflag = "-q";
-$liteflag = "";
-$svliteflag = "";
-$clliteflag = "";
+$quietflag = " -q ";
+$giopliteflag = 0;
+
+###############################################################################
# Parse the arguments
-for ($i = 0; $i <= $#ARGV; $i++)
-{
- SWITCH:
- {
- if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
- {
- print "run_test [-h] [-n num] [-sleeptime t]",
- " [-debug] [-release] [-orblite] [-verbose]\n";
- print "\n";
- print "-h -- prints this information\n";
- print "-n num -- client uses <num> iterations\n";
- print "-sleeptime t -- run_test should sleep for <t> seconds between running\n";
- print " the server and client (default is 5 seconds)\n";
- print "-debug -- sets the debug flag for both client and server\n";
- print "-release -- runs the Release version of the test (for NT use)\n";
- print "-orblite -- Use the lite version of the orb";
- exit;
- }
- if ($ARGV[$i] eq "-debug")
- {
- $clflags .= " -d";
- $svflags .= " -d";
- last SWITCH;
+for ($i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") {
+ print "run_test [-h] [-n num] [-debug] [-orblite] [-verbose]\n";
+ print "\n";
+ print "-h -- prints this information\n";
+ print "-n num -- client uses <num> iterations\n";
+ print "-debug -- sets the debug flag for both client and "
+ . "server\n";
+ print "-orblite -- Use the lite version of the orb";
+ exit;
}
- if ($ARGV[$i] eq "-release")
- {
- $exepref = "Release".$DIR_SEPARATOR;
- last SWITCH;
+ elsif ($ARGV[$i] eq "-debug") {
+ $clflags .= " -d ";
+ $svflags .= " -d ";
}
- if ($ARGV[$i] eq "-n")
- {
- $clflags .= " -n $ARGV[$i + 1]";
- $i++;
- last SWITCH;
+ elsif ($ARGV[$i] eq "-n") {
+ $clflags .= " -n $ARGV[$i + 1] ";
+ $i++;
}
- if ($ARGV[$i] eq "-sleeptime")
- {
- $ACE::sleeptime = $ARGV[$i + 1];
- $i++;
- last SWITCH;
+ elsif ($ARGV[$i] eq " -orblite ") {
+ $giopliteflag = 1;
}
- if ($ARGV[$i] eq "-orblite")
- {
- $liteflag = "uselite";
- last SWITCH;
+ elsif ($ARGV[$i] eq " -verbose ") {
+ $quietflag = "";
}
- if ($ARGV[$i] eq "-verbose")
- {
- $quietflag = "";
- last SWITCH;
+ else {
+ print STDERR "ERROR: Unknown Option: ".$ARGV[$i]."\n";
}
- print "run_test: Unknown Option: ".$ARGV[$i]."\n";
- }
}
-(-f $exepref."server".$EXE_EXT &&
- -f $exepref."client".$EXE_EXT) ||
- die "$0: server and/or client need to be built!\n";
-
-unlink $iorfile;
-
-sleep 2;
+$SV = new PerlACE::Process ("server");
+$CL = new PerlACE::Process ("client");
-print stderr "\nRunning IDL_Cubit with the default ORB protocol.\n\n";
+###############################################################################
+# run_test_helper
-if ($liteflag eq "uselite")
+sub run_test_helper ()
{
- $svliteflag = "-ORBSvcConf iiop_lite.conf";
- $clliteflag = "-ORBSvcConf iiop_lite.conf";
- print stderr "\nRunning IDL_Cubit with the a lite ORB protocol.\n\n";
-}
-
-$SV = Process::Create ($exepref."server".$EXE_EXT,
- $svflags.
- $svliteflag.
- $svnsflags);
-
-if (ACE::waitforfile_timed ($iorfile, 10) == -1) {
- print STDERR "ERROR: cannot find file <$iorfile>\n";
- $SV->Kill (); $SV->TimedWait (1);
- exit 1;
-}
-
-$CL = Process::Create ($exepref . "client".$EXE_EXT,
- " $quietflag $clflags $clnsflags $clliteflag -x");
+ $SV->Spawn ();
-$client = $CL->TimedWait (120);
-if ($client == -1) {
- print STDERR "ERROR: client timedout\n";
- $CL->Kill (); $CL->TimedWait (1);
-}
-
-$server = $SV->TimedWait (10);
-if ($server == -1) {
- print STDERR "ERROR: server timedout\n";
- $SV->Kill (); $SV->TimedWait (1);
-}
-
-unlink $iorfile;
+ if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
+ }
-if ($server != 0) {
- print STDERR "ERROR: server error status $server\n";
-}
+ my $client = $CL->SpawnWaitKill (120);
+ my $server = $SV->WaitKill (30);
+
+ unlink $iorfile;
-if ($client != 0) {
- print STDERR "ERROR: client error status $client\n";
-}
+ if ($server != 0) {
+ print STDERR "ERROR: server error status $server\n";
+ $status = 1;
+ }
-if ($server != 0 || $client != 0) {
- exit 1;
+ if ($client != 0) {
+ print STDERR "ERROR: client error status $client\n";
+ $status = 1;
+ }
}
-if ($OSNAME ne "MSWin32")
-{
- # Only run the UIOP test on Unix platforms.
-
- Process::Wait();
-
- # No need to unlink the iorfile again.
- # unlink $iorfile;
+###############################################################################
- sleep 2;
-
- print stderr "\nRunning IDL_Cubit with the UIOP protocol.\n\n";
- if ($liteflag eq "uselite")
- {
- $svliteflag = "-ORBSvcConf uiop_lite.conf";
- $clliteflag = "-ORBSvcConf uiop_lite.conf";
- print stderr "\nRunning IDL_Cubit with the a UIOP lite ORB protocol.\n\n";
- }
-
- # Save the original server flags.
- $save_svflags = $svflags;
-
- $svflags .= " -ORBEndpoint uiop://";
-
- $SV = Process::Create ($exepref."server".$EXE_EXT,
- $svflags.
- $svliteflag.
- $svnsflags);
-
- if (ACE::waitforfile_timed ($iorfile, 10) == -1) {
- print STDERR "ERROR: cannot find file <$iorfile>\n";
- $SV->Kill (); $SV->TimedWait (1);
- exit 1;
- }
-
- $CL = Process::Create ($exepref . "client".$EXE_EXT,
- " $quietflag $clflags $clnsflags $clliteflag -x");
-
- $client = $CL->TimedWait (120);
- if ($client == -1) {
- print STDERR "ERROR: client timedout\n";
- $CL->Kill (); $CL->TimedWait (1);
- }
-
- $server = $SV->TimedWait (30);
- if ($server == -1) {
- print STDERR "ERROR: server timedout\n";
- $SV->Kill (); $SV->TimedWait (1);
- }
-
- # Restore the original server flags
- $svflags = $save_svflags;
-
- unlink $iorfile;
-
- if ($server != 0) {
- print STDERR "ERROR: server error status $server\n";
- }
-
- if ($client != 0) {
- print STDERR "ERROR: client error status $client\n";
- }
-
- if ($server != 0 || $client != 0) {
+if (! (-x $SV->Executable () && -x $CL->Executable)) {
+ print STDERR "ERROR: server and/or client missing or not executable!\n";
exit 1;
- }
}
-# Run the SHMIOP test.
-
-Process::Wait();
-
-# No need to unlink the iorfile again.
-# unlink $iorfile;
-
-sleep 2;
+unlink $iorfile;
-print stderr "\nRunning IDL_Cubit with the SHMIOP protocol.\n\n";
+print STDERR "============================================================\n";
+print STDERR "Running IDL_Cubit with the default ORB protocol.\n\n";
-# Save the original server flags.
-$save_svflags = $svflags;
+$SV->Arguments ($svflags . $svnsflags);
+$CL->Arguments ($clflags . $clnsflags . $quietflag . " -x ");
-$svflags .= " -ORBEndpoint shmiop:// -ORBSvcconf server_shmiop.conf ";
+if ($giopliteflag) {
+ print STDERR "\nRunning IDL_Cubit with the a lite ORB protocol.\n\n";
+ $SV->Arguments ($SV->Arguments () . " -ORBSvcConf $iiop_lite_conf ");
+ $CL->Arguments ($CL->Arugments () . " -ORBSvcConf $iiop_lite_conf ");
+}
-$SV = Process::Create ($exepref."server".$EXE_EXT,
- $svflags.
- $svnsflags);
+run_test_helper ();
-if (ACE::waitforfile_timed ($iorfile, 10) == -1) {
- print STDERR "ERROR: cannot find file <$iorfile>\n";
- $SV->Kill (); $SV->TimedWait (1);
- exit 1;
-}
+if ($OSNAME ne "MSWin32") {
+ print STDERR "============================================================\n";
+ print STDERR "Running IDL_Cubit with the UIOP protocol.\n\n";
-$CL = Process::Create ($exepref . "client".$EXE_EXT,
- " $quietflag $clflags $clnsflags -x");
+ $SV->Arguments ($svflags . $svnsflags . " -ORBEndpoint uiop:// ");
+ $CL->Arguments ($clflags . $clnsflags . $quietflag . " -x ");
-$client = $CL->TimedWait (120);
-if ($client == -1) {
- print STDERR "ERROR: client timedout\n";
- $CL->Kill (); $CL->TimedWait (1);
-}
+ if ($giopliteflag) {
+ print STDERR "\nRunning IDL_Cubit with the a UIOP lite ORB protocol.\n\n";
+ $SV->Arguments ($SV->Arguments () . " -ORBSvcConf $uiop_lite_conf ");
+ $CL->Arguments ($CL->Arugments () . " -ORBSvcConf $uiop_lite_conf ");
+ }
-$server = $SV->TimedWait (30);
-if ($server == -1) {
- print STDERR "ERROR: server timedout\n";
- $SV->Kill (); $SV->TimedWait (1);
+ run_test_helper ();
}
-# Restore the original server flags
-$svflags = $save_svflags;
-
-unlink $iorfile;
+print STDERR "============================================================\n";
+print STDERR "Running IDL_Cubit with the SHMIOP protocol.\n\n";
-if ($server != 0) {
- print STDERR "ERROR: server error status $server\n";
-}
+$SV->Arguments ($svflags . $svnsflags
+ . " -ORBEndpoint shmiop:// -ORBSvcconf $server_shmiop_conf ");
+$CL->Arguments ($clflags . $clnsflags . $quietflag . " -x ");
-if ($client != 0) {
- print STDERR "ERROR: client error status $client\n";
-}
+run_test_helper ();
-if ($server != 0 || $client != 0) {
- exit 1;
-}
+# Clean up SHMIOP files
+unlink glob ("server_shmiop_*");
-exit 0;
+exit $status;