Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / InterfaceRepo / Latency_Test / run_test.pl
blob43e052a6cf23d1be2e5f4c75fb3b422915ec620c
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";
8 use PerlACE::TestTarget;
10 $status = 0;
12 $nice = "-ORBDottedDecimalAddresses 1";
13 $debug = "";
14 $history = "";
15 $iterations = "";
16 $other = "";
18 for ($i = 0; $i <= $#ARGV; $i++) {
19 if ($ARGV[$i] eq "-d") {
20 $debug = "-d";
22 elsif ($ARGV[$i] eq "-h") {
23 $history = "-h ";
24 $i++;
26 elsif ($ARGV[$i] eq "-i") {
27 $iterations = "-i ".$ARGV[$i + 1];
28 $i++;
30 else {
31 $other .= $ARGV[$i];
35 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
36 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
38 my $iorbase = "if_repo.ior";
39 my $server_iorfile = $server->LocalFile ($iorbase);
40 my $client_iorfile = $client->LocalFile ($iorbase);
41 $server->DeleteFile($iorbase);
42 $client->DeleteFile($iorbase);
44 $SV = $server->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/IFR_Service/tao_ifr_service",
45 " $nice " .
46 " -o $server_iorfile");
48 $CL = $client->CreateProcess ("client",
49 "-ORBInitRef InterfaceRepository=file://$client_iorfile " .
50 " $debug $history $iterations");
52 $server_status = $SV->Spawn ();
54 if ($server_status != 0) {
55 print STDERR "ERROR: server returned $server_status\n";
56 exit 1;
59 if ($server->WaitForFileTimed ($iorbase,
60 $server->ProcessStartWaitInterval()) == -1) {
61 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
62 $SV->Kill (); $SV->TimedWait (1);
63 exit 1;
66 if ($server->GetFile ($iorbase) == -1) {
67 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
68 $SV->Kill (); $SV->TimedWait (1);
69 exit 1;
71 if ($client->PutFile ($iorbase) == -1) {
72 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
73 $SV->Kill (); $SV->TimedWait (1);
74 exit 1;
77 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
79 if ($client_status != 0) {
80 print STDERR "ERROR: client returned $client_status\n";
81 $status = 1;
84 $server_status = $SV->TerminateWaitKill ($server->ProcessStopWaitInterval());
86 if ($server_status != 0) {
87 print STDERR "ERROR: server returned $server_status\n";
88 $status = 1;
91 $server->DeleteFile($iorbase);
92 $client->DeleteFile($iorbase);
94 exit $status;