diff options
Diffstat (limited to 'TAO/tests/Xt_Stopwatch/run_test.pl')
-rwxr-xr-x | TAO/tests/Xt_Stopwatch/run_test.pl | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/TAO/tests/Xt_Stopwatch/run_test.pl b/TAO/tests/Xt_Stopwatch/run_test.pl index 57d8fdfbfc4..546d8c8b716 100755 --- a/TAO/tests/Xt_Stopwatch/run_test.pl +++ b/TAO/tests/Xt_Stopwatch/run_test.pl @@ -5,43 +5,41 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../bin'; -require Process; -require ACEutils; +use lib '../../../bin'; +use PerlACE::Run_Test; -print STDERR "\n\n==== XtReactor demo test\n"; - -$file="test.ior"; +$status = 0; +$file = PerlACE::LocalFile ("test.ior"); unlink $file; -$SV = Process::Create ($EXEPREFIX."server".$EXE_EXT, - "-o $file"); -if (ACE::waitforfile_timed ($file, 3) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); $SV->TimedWait (1); - exit 1; -} +$SV = new PerlACE::Process ("server", "-o $file"); +$CL = new PerlACE::Process ("client", "file://$file"); -$CL = Process::Create ($EXEPREFIX."client".$EXE_EXT, - "file://$file"); +print STDERR "\n\n==== XtReactor demo test\n"; -$client = $CL->TimedWait (60); -if ($client == -1) { - print STDERR "ERROR: client timedout\n"; - $CL->Kill (); $CL->TimedWait (1); +$SV->Spawn (); + +if (PerlACE::waitforfile_timed ($file, 3) == -1) { + print STDERR "ERROR: cannot find file <$file>\n"; + $SV->Kill (); + exit 1; } -$server = $SV->TimedWait (5); -if ($server == -1) { - print STDERR "ERROR: server timedout\n"; - $SV->Kill (); $SV->TimedWait (1); +$client = $CL->SpawnWaitKill (60); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; } -if ($client == -1 || $server == -1) { - exit 1; +$server = $SV->WaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; } unlink $file; -exit 0; +exit $status; |