summaryrefslogtreecommitdiff
path: root/TAO/examples/Callback_Quoter/run_test.pl
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/examples/Callback_Quoter/run_test.pl')
-rwxr-xr-xTAO/examples/Callback_Quoter/run_test.pl95
1 files changed, 52 insertions, 43 deletions
diff --git a/TAO/examples/Callback_Quoter/run_test.pl b/TAO/examples/Callback_Quoter/run_test.pl
index 78aeb41bd07..aac24db5939 100755
--- a/TAO/examples/Callback_Quoter/run_test.pl
+++ b/TAO/examples/Callback_Quoter/run_test.pl
@@ -5,67 +5,76 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# $Id$
# -*- perl -*-
-use lib '../../../bin';
-use PerlACE::Run_Test;
-
-$status = 0;
-$ns_ior = PerlACE::LocalFile ("NameService.ior");
-$sleeptime = 5;
-
-unlink $ns_ior;
-
-$NS = new PerlACE::Process ("../../orbsvcs/Naming_Service/Naming_Service", "-o $ns_ior");
-$N = new PerlACE::Process ("notifier", "-ORBInitRef NameService=file://$ns_ior");
-$C = new PerlACE::Process ("consumer", "-ORBInitRef NameService=file://$ns_ior -t 12 -a TAO");
-$S = new PerlACE::Process ("supplier", "-ORBInitRef NameService=file://$ns_ior -iexample.stocks");
+unshift @INC, '../../../bin';
+require Process;
+require ACEutils;
print STDERR "================ Remote test\n";
-$NS->Spawn ();
+$ns_ior = "NameService.ior";
-if (PerlACE::waitforfile_timed ($ns_ior, 5) == -1) {
- print STDERR "ERROR: cannot find file <$ns_ior>\n";
- $NS->Kill ();
- exit 1;
+unlink $ns_ior;
+$NS = Process::Create ("..".$DIR_SEPARATOR.
+ "..".$DIR_SEPARATOR.
+ "orbsvcs".$DIR_SEPARATOR.
+ "Naming_Service".$DIR_SEPARATOR.
+ "Naming_Service".$EXE_EXT,
+ " -o $ns_ior ");
+
+if (ACE::waitforfile_timed ($ns_ior, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$ns_ior>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
+$N = Process::Create (".".$DIR_SEPARATOR.
+ "notifier".$EXE_EXT,
+ " -ORBInitRef NameService=file://$ns_ior ");
-$N->Spawn ();
+sleep 5;
-sleep $sleeptime;
+$C = Process::Create (".".$DIR_SEPARATOR.
+ "consumer".$EXE_EXT,
+ " -ORBInitRef NameService=file://$ns_ior "
+ . " -t 12 -a TAO");
-$C->Spawn ();
+sleep 5;
-sleep $sleeptime;
+$S = Process::Create (".".$DIR_SEPARATOR.
+ "supplier".$EXE_EXT,
+ " -ORBInitRef NameService=file://$ns_ior "
+ . " -iexample.stocks");
-$supplier = $S->SpawnWaitKill (60);
-
-if ($supplier != 0) {
- print STDERR "ERROR: supplier returned $supplier\n";
- $status = 1;
+if ($S->TimedWait (60) == -1) {
+ print STDERR "ERROR: supplier timedout\n";
+ $S->Kill (); $S->TimedWait (1);
+ $C->Kill (); $C->TimedWait (1);
+ $N->Kill (); $N->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-$server = $C->TerminateWaitKill (5);
-
-if ($server != 0) {
- print STDERR "ERROR: consumer returned $server\n";
- $status = 1;
+$C->Terminate (); if ($C->TimedWait (5) == -1) {
+ print STDERR "ERROR: consumer timedout\n";
+ $C->Kill (); $C->TimedWait (1);
+ $N->Kill (); $N->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-$server = $N->TerminateWaitKill (5);
-
-if ($server != 0) {
- print STDERR "ERROR: notifier returned $server\n";
- $status = 1;
+$N->Terminate (); if ($N->TimedWait (5) == -1) {
+ print STDERR "ERROR: cannot terminate notifier\n";
+ $N->Kill (); $N->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-$server = $NS->TerminateWaitKill (5);
-
-if ($server != 0) {
- print STDERR "ERROR: naming service returned $server\n";
- $status = 1;
+$NS->Terminate (); if ($NS->TimedWait (5) == -1) {
+ print STDERR "ERROR: cannot terminate naming service\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
unlink $ns_ior;
-exit $status;
+exit 0;