Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / POA / Adapter_Activator / run_test.pl
blob997b281ca8d45199eb8a5e48ef8fb4a60ea39482
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 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
11 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
13 $server->AddLibPath ('../Generic_Servant/.');
14 $client->AddLibPath ('../Generic_Servant/.');
16 $iorbase = "ior";
18 $status = 0;
19 $oneway = "";
20 $iterations = 100;
22 $extra_args = "";
24 # Parse the arguments
25 for ($i = 0; $i <= $#ARGV; $i++) {
26 if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") {
27 print "run_test [-h] [-i iterations] [-o] [-f ior file]\n";
28 print "\n";
29 print "-h -- prints this information\n";
30 print "-f -- ior file\n";
31 print "-i iterations -- specifies iterations\n";
32 print "-o -- call issued are oneways\n";
33 exit;
35 elsif ($ARGV[$i] eq "-o") {
36 $oneway = "-o";
38 elsif ($ARGV[$i] eq "-i") {
39 $iterations = $ARGV[$i + 1];
40 $i++;
42 elsif ($ARGV[$i] eq "-f") {
43 $iorbase = $ARGV[$i + 1];
44 $i++;
46 else {
47 $extra_args .= " " . $ARGV[$i];
51 $iorfile_1 = $iorbase."_1";
52 $iorfile_2 = $iorbase."_2";
53 $iorfile_3 = $iorbase."_3";
55 $server->DeleteFile($iorfile_1);
56 $server->DeleteFile($iorfile_2);
57 $server->DeleteFile($iorfile_3);
58 $client->DeleteFile($iorfile_1);
59 $client->DeleteFile($iorfile_2);
60 $client->DeleteFile($iorfile_3);
62 $iorfile_server = $server->LocalFile ("$iorbase");
64 $SV = $server->CreateProcess ("server", "-f $iorfile_server $extra_args");
65 $CL = $client->CreateProcess ("../Generic_Servant/client");
67 $server_status = $SV->Spawn ();
69 if ($server_status != 0) {
70 print STDERR "ERROR: server returned $server\n";
71 exit 1;
74 if ($server->WaitForFileTimed ($iorfile_1,
75 $server->ProcessStartWaitInterval()) == -1) {
76 print STDERR "ERROR: cannot find file <$iorfile_1>\n";
77 $SV->Kill ();
78 exit 1;
81 if ($server->WaitForFileTimed ($iorfile_2,
82 $server->ProcessStartWaitInterval()) == -1) {
83 print STDERR "ERROR: cannot find file <$iorfile_2>\n";
84 $SV->Kill ();
85 exit 1;
88 if ($server->WaitForFileTimed ($iorfile_3,
89 $server->ProcessStartWaitInterval()) == -1) {
90 print STDERR "ERROR: cannot find file <$iorfile_3>\n";
91 $SV->Kill ();
92 exit 1;
95 $iorfile_client1 = $client->LocalFile ("$iorfile_1");
96 $iorfile_client2 = $client->LocalFile ("$iorfile_2");
97 $iorfile_client3 = $client->LocalFile ("$iorfile_3");
99 $CL->Arguments ("$extra_args $oneway -i $iterations -k file://$iorfile_client1");
101 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
103 if ($client_status != 0) {
104 print STDERR "ERROR: client 1 returned $client_status\n";
105 $status = 1;
108 $CL->Arguments ("$extra_args $oneway -i $iterations -k file://$iorfile_client2");
110 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
112 if ($client_status != 0) {
113 print STDERR "ERROR: client 2 returned $client_status\n";
114 $status = 1;
117 $CL->Arguments ("$extra_args $oneway -i $iterations -k file://$iorfile_client3 -x");
119 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
121 if ($client_status != 0) {
122 print STDERR "ERROR: client 3 returned $client_status\n";
123 $status = 1;
126 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
128 if ($server_status != 0) {
129 print STDERR "ERROR: server returned $server_status\n";
130 $status = 1;
133 $server->GetStderrLog();
134 $client->GetStderrLog();
136 $server->DeleteFile($iorfile_1);
137 $server->DeleteFile($iorfile_2);
138 $server->DeleteFile($iorfile_3);
139 $client->DeleteFile($iorfile_1);
140 $client->DeleteFile($iorfile_2);
141 $client->DeleteFile($iorfile_3);
143 exit $status;