diff options
Diffstat (limited to 'TAO/tests/Multiple/run_test.pl')
-rwxr-xr-x | TAO/tests/Multiple/run_test.pl | 95 |
1 files changed, 51 insertions, 44 deletions
diff --git a/TAO/tests/Multiple/run_test.pl b/TAO/tests/Multiple/run_test.pl index fca870955df..789f921beb4 100755 --- a/TAO/tests/Multiple/run_test.pl +++ b/TAO/tests/Multiple/run_test.pl @@ -6,93 +6,100 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # -*- perl -*- use lib "../../../bin"; -use PerlACE::Run_Test; +require Process; + + +unshift @INC, '../../../bin'; +require ACEutils; +use Cwd; -$status = 0; -$direct_colloc = "-ORBCollocationStrategy direct"; -$no_colloc = "-ORBCollocation no"; +$status = 0; +$EXEPREFIX = "./"; +$DIRECT_COLLOC = "-ORBCollocationStrategy direct"; +$NO_COLLOC = "-ORBCollocation no"; -# @todo Test should take -o and -k options to specify iorfile -# Hard coded in test. -$iorfile = "s.ior"; +$cwd = getcwd(); +$iorfile = "$cwd$DIR_SEPARATOR" . "s.ior"; unlink $iorfile; -$SV = new PerlACE::Process ("server"); -$CL = new PerlACE::Process ("client"); +ACE::checkForTarget($cwd); # # Test using ThruPOA collocation. # -$SV->Spawn (); -if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); - exit 1; +$Server = Process::Create ($EXEPREFIX."server$EXE_EXT ", + ""); + +if (ACE::waitforfile_timed ($iorfile, 5) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $Server->Kill (); $Server->TimedWait (1); + exit 1; } -$client = $CL->SpawnWaitKill (60); -$SV->Kill (); +$Client = Process::Create($EXEPREFIX."client$EXE_EXT", ""); -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; +if ($Client->TimedWait (60) == -1) { + print STDERR "ERROR: client timedout\n"; + $status = 1; + $Client->Kill (); } +$Server->Kill (); + + # # Test using Direct Collocation # unlink $iorfile; -$SV->Arguments ($direct_colloc); - -$SV->Spawn (); +$Server = Process::Create ($EXEPREFIX."server$EXE_EXT", $DIRECT_COLLOC); -if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); - exit 1; +if (ACE::waitforfile_timed ($iorfile, 5) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $Server->Kill (); $Server->TimedWait (1); + exit 1; } -$client = $CL->SpawnWaitKill (60); -$SV->Kill (); +$Client = Process::Create($EXEPREFIX."client$EXE_EXT", ""); -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; +if ($Client->TimedWait (60) == -1) { + print STDERR "ERROR: client timedout\n"; + $status = $status+1; + $Client->Kill (); } +$Server->Kill (); + # # Test using No Collocation # unlink $iorfile; -$SV->Arguments ($no_colloc); +$Server = Process::Create ($EXEPREFIX."server$EXE_EXT", $NO_COLLOC); -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); - exit 1; +if (ACE::waitforfile_timed ($iorfile, 5) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $Server->Kill (); $Server->TimedWait (1); + exit 1; } -$client = $CL->SpawnWaitKill (60); -$SV->Kill (); +$Client = Process::Create($EXEPREFIX."client$EXE_EXT", ""); -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; +if ($Client->TimedWait (60) == -1) { + print STDERR "ERROR: client timedout\n"; + $status = $status+1; + $Client3->Kill (); } -unlink $iorfile; +$Server->Kill (); exit $status |