diff options
Diffstat (limited to 'TAO/examples/Logging/run_test.pl')
-rwxr-xr-x | TAO/examples/Logging/run_test.pl | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/TAO/examples/Logging/run_test.pl b/TAO/examples/Logging/run_test.pl index 58aac5eaaed..891abc3421f 100755 --- a/TAO/examples/Logging/run_test.pl +++ b/TAO/examples/Logging/run_test.pl @@ -7,37 +7,41 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # This is a Perl script that runs the Logger client and server -use lib '../../../bin'; -use PerlACE::Run_Test; - -$status = 0; +unshift @INC, '../../../bin'; +require Process; # amount of delay between running the servers $sleeptime = 7; -$SV = new PerlACE::Process ("Logging_Service"); -$CL = new PerlACE::Process ("Logging_Test"); +# Starts the Logging Service +sub service +{ + my $args = ""; + my $prog = $EXEPREFIX."Logging_Service" + .$EXE_EXT; + $SV = Process::Create ($prog, $args); +} + +# Starts the test client +sub test +{ + my $args = ""; + my $prog = $EXEPREFIX."Logging_Test".$EXE_EXT; + + system ("$prog $args"); +} # Start the service -$SV->Spawn (); +service (); # Give the service time to settle sleep $sleeptime; -# Start the client -$client = $CL->SpawnWaitKill (60); +# Start the client (which exits automatically) +test (); -if ($client != 0) { - print STDERR "ERROR: test returned $client\n"; - $status = 1; -} +# Give the client time to log and exit +sleep 3; # Kill the service -$server = $SV->TerminateWaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: service returned $server\n"; - $status = 1; -} - -exit $status; +$SV->Kill (); |