summaryrefslogtreecommitdiff
path: root/TAO/tests
diff options
context:
space:
mode:
authorbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-05-11 23:17:27 +0000
committerbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-05-11 23:17:27 +0000
commit88fbbbcec97a68d0383b5d09285fb1f8bba192c2 (patch)
treebd939fe093a18fd7c140b79c3fa2ce1d882317f4 /TAO/tests
parentb477148f72a7cc38a043bb743c2b9d54938b0d13 (diff)
downloadATCD-88fbbbcec97a68d0383b5d09285fb1f8bba192c2.tar.gz
A neat new Win32 Perl script.
Diffstat (limited to 'TAO/tests')
-rwxr-xr-xTAO/tests/Quoter/run_test.bat8
-rwxr-xr-xTAO/tests/Quoter/run_test.pl194
2 files changed, 202 insertions, 0 deletions
diff --git a/TAO/tests/Quoter/run_test.bat b/TAO/tests/Quoter/run_test.bat
new file mode 100755
index 00000000000..9d7ac1bcbd1
--- /dev/null
+++ b/TAO/tests/Quoter/run_test.bat
@@ -0,0 +1,8 @@
+@echo off
+perl run_test.pl %1 %2 %3 %4 %5 %6 %7 %8 %9
+
+rem If there were errors (like perl wasn't found) echo this message
+if errorlevel 1 echo.
+if errorlevel 1 echo You need to have Perl for Win32 installed to run this script.
+if errorlevel 1 echo It can be found at http://www.activestate.com/pw32/
+if errorlevel 1 echo Also remember to add the perl\doc directory to the PERLLIB environment variable.
diff --git a/TAO/tests/Quoter/run_test.pl b/TAO/tests/Quoter/run_test.pl
new file mode 100755
index 00000000000..65c2ea81093
--- /dev/null
+++ b/TAO/tests/Quoter/run_test.pl
@@ -0,0 +1,194 @@
+# This is a Perl script that runs the client and all the other servers that
+# are needed
+
+use Win32::Process;
+
+$nsiorfile = $ENV{TEMP}."\\qns_ior";
+
+# amount of delay between running the
+$sleeptime = 2;
+
+# variables for parameters
+
+$nsport = 20002;
+$clport = 20003;
+$svport = 20004;
+$ffport = 20005;
+$gfport = 20006;
+
+# other variables
+
+$n = 1;
+$leave = 0;
+$ior = 0;
+$done = "";
+$debug = "";
+$mt = "";
+$other = "";
+
+sub read_nsior
+{
+ open (FH, "<".$nsiorfile);
+
+ read (FH, $ior, 255);
+
+ close (FH);
+}
+
+sub name_server
+{
+ my $exe = sprintf ("..\\..\\orbsvcs\\Naming_Service\\Naming_Service.exe %s".
+ " -ORBport %d -ORBobjrefstyle url -o %s",
+ $other,
+ $nsport,
+ $nsiorfile);
+
+ Win32::Process::Create ($NS, "..\\..\\orbsvcs\\Naming_Service\\Naming_Service.exe",
+ $exe, 1, CREATE_NEW_CONSOLE, ".");
+}
+
+sub server
+{
+ my $exe = sprintf ("server.exe %s %s -ORBport %d -ORBobjrefstyle url -ORBnameserviceior %s -ORBsvcconf server.conf",
+ $other,
+ $debug,
+ $svport,
+ $ior);
+
+ Win32::Process::Create ($SV, "server.exe",
+ $exe, 1, CREATE_NEW_CONSOLE, ".");
+}
+
+sub factory_finder
+{
+ my $exe = sprintf ("Factory_Finder.exe %s -ORBport %d -ORBobjrefstyle url -ORBnameserviceior %s -ORBsvcconf svc.conf",
+ $other,
+ $ffport,
+ $ior);
+
+ Win32::Process::Create ($FF, "Factory_Finder.exe",
+ $exe, 1, CREATE_NEW_CONSOLE, ".");
+
+}
+
+sub generic_factory
+{
+ my $exe = sprintf ("Generic_Factory.exe %s -ORBport %d -ORBobjrefstyle url -ORBnameserviceior %s -ORBsvcconf svc.conf",
+ $other,
+ $gfport,
+ $ior);
+
+ Win32::Process::Create ($GF, "Generic_Factory.exe",
+ $exe, 1, CREATE_NEW_CONSOLE, ".");
+
+}
+
+sub client
+{
+ my $exe = sprintf ("client.exe %s %s %s -ORBobjrefstyle url -ORBport %d -ORBnameserviceior %s -ORBsvcconf client.conf",
+ $other,
+ $debug,
+ $mt,
+ $clport,
+ $ior);
+
+# Win32::Process::Create ($CL, "client.exe",
+# $exe, 1, 0, ".");
+ system ($exe);
+
+}
+
+# Parse the arguments
+
+for ($i = 0; $i <= $#ARGV; $i++)
+{
+ SWITCH: {
+ if ($ARGV[i] eq "-h" || $ARGV[i] eq "-?")
+ {
+ print "run_test [-n num] [-leave] [-d] [-h] [-m] [-ns|sv|ff|cl|gf]\n";
+ print "\n";
+ print "-n num -- runs the client num times\n";
+ print "-leave -- leaves the servers running and their windows open\n";
+ print "-d -- runs each in debug mode\n";
+ print "-h -- prints this information\n";
+ print "-m -- use more than one thread in the client\n";
+ print "-ns -sv -ff -cl -gf -- runs only one of the executables\n";
+ exit;
+ }
+ if ($ARGV[i] eq "-n")
+ {
+ $n = $ARGV[i + 1];
+ $i++;
+ last SWITCH;
+ }
+ if ($ARGV[i] eq "-d")
+ {
+ $debug = "-d";
+ last SWITCH;
+ }
+ if ($ARGV[i] eq "-m")
+ {
+ $mt = "-m";
+ last SWITCH;
+ }
+ if ($ARGV[i] eq "-leave")
+ {
+ $leave = 1;
+ last SWITCH;
+ }
+ if ($ARGV[i] eq "-ns")
+ {
+ name_server ();
+ exit;
+ }
+ if ($ARGV[i] eq "-sv")
+ {
+ server ();
+ exit;
+ }
+ if ($ARGV[i] eq "-ff")
+ {
+ factory_finder ();
+ exit;
+ }
+ if ($ARGV[i] eq "-gf")
+ {
+ generic_factory ();
+ exit;
+ }
+ if ($ARGV[i] eq "-cl")
+ {
+ client;
+ exit;
+ }
+ # all other args are ignored.
+ }
+}
+
+name_server ();
+
+read_nsior ();
+
+sleep $sleeptime;
+
+server ();
+
+sleep $sleeptime;
+
+factory_finder ();
+
+sleep $sleeptime;
+
+generic_factory ();
+
+sleep $sleeptime;
+
+client ();
+
+if (leave == 0)
+{
+ $GF->Kill (0);
+ $FF->Kill (0);
+ $SV->Kill (0);
+ $NS->Kill (0);
+} \ No newline at end of file