Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / examples / Advanced / ch_18 / run_test.pl
blob2fd2b99cf4f07b43a5ec2de2f37dca2a8cc41ca8
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
5 # -*- perl -*-
7 use lib "$ENV{ACE_ROOT}/bin";
9 require ACEutils;
10 require Process;
12 $status = 0;
14 # amount of delay between starting servers and client
15 $sleeptime = 15;
19 sub name_server
21 my $prog = "..$DIR_SEPARATOR".
22 "..$DIR_SEPARATOR".
23 "..$DIR_SEPARATOR".
24 "orbsvcs$DIR_SEPARATOR".
25 "Naming_Service$DIR_SEPARATOR".
26 "tao_cosnaming$EXE_EXT";
27 $NS = Process::Create ($prog,"");
32 # create naming service, server, client
33 name_server ();
34 sleep $sleeptime;
36 $server = Process::Create ($EXEPREFIX."server".$EXE_EXT, "");
37 sleep $sleeptime;
39 $client = Process::Create($EXEPREFIX."client".$EXE_EXT, "");
43 # wait for client to finish
44 if ($client->TimedWait (60) == -1) {
45 print STDERR "ERROR: client timedout\n";
46 $status = 1;
47 $client->Kill (); $client->TimedWait (1);
51 # gracefully kill the server
52 $server->Terminate ();
53 if ($server->TimedWait (5) == -1) {
54 print STDERR "ERROR: cannot terminate the server\n";
55 $server->Kill (); $server->TimedWait (1);
56 $status = 1;
59 # gracefully kill the Naming Service
60 $NS->Terminate ();
61 if ($NS->TimedWait (5) == -1) {
62 print STDERR "ERROR: cannot terminate the server\n";
63 $NS->Kill (); $server->TimedWait (1);
64 $status = 1;
67 exit $status;