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