Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / POA / Forwarding / run_test.pl
blobead358b6b280388df316dad14fe86e24358b38b6
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 # Make pretty look thing
11 print STDERR "\n";
12 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 3 failed\n";
13 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 4 failed\n";
15 my $iorbase1 = "server.ior";
16 my $iorbase2 = "server2.ior";
17 my $iorbase3 = "server3.ior";
19 my $server1_iorfile = $server->LocalFile ($iorbase1);
20 my $server2_iorfile = $server->LocalFile ($iorbase2);
21 my $server3_iorfile = $server->LocalFile ($iorbase3);
22 my $client_iorfile = $client->LocalFile ($iorbase3);
24 $server->DeleteFile ($iorbase1);
25 $server->DeleteFile ($iorbase2);
26 $server->DeleteFile ($iorbase3);
27 $client->DeleteFile ($iorbase3);
29 $SV1 = $server->CreateProcess ("server", "-o $server1_iorfile");
30 $SV2 = $server->CreateProcess ("server", "-o $server2_iorfile -f file://$server1_iorfile");
31 $SV3 = $server->CreateProcess ("server", "-o $server3_iorfile -f file://$server2_iorfile");
32 $CL = $client->CreateProcess ("client", "-s 3 -k file://$client_iorfile");
34 $status = 0;
36 $server1_status = $SV1->Spawn ();
38 if ($server1_status != 0) {
39 print STDERR "ERROR: server returned $server1_status\n";
40 exit 1;
43 if ($server->WaitForFileTimed ($iorbase1,
44 $server->ProcessStartWaitInterval()) == -1) {
45 print STDERR "ERROR: cannot find file <$server1_iorfile>\n";
46 $SV1->Kill (); $SV1->TimedWait (1);
47 exit 1;
50 $SV2->Spawn ();
52 if ($server->WaitForFileTimed ($iorbase2,
53 $server->ProcessStartWaitInterval()) == -1) {
54 print STDERR "ERROR: cannot find file <$server2_iorfile>\n";
55 $SV1->Kill (); $SV1->TimedWait (1);
56 $SV2->Kill (); $SV2->TimedWait (1);
57 exit 1;
60 $SV3->Spawn ();
62 if ($server->WaitForFileTimed ($iorbase3,
63 $server->ProcessStartWaitInterval()) == -1) {
64 print STDERR "ERROR: cannot find file <$server3_iorfile>\n";
65 $SV1->Kill (); $SV1->TimedWait (1);
66 $SV2->Kill (); $SV2->TimedWait (1);
67 $SV3->Kill (); $SV3->TimedWait (1);
68 exit 1;
71 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
72 $server1_status = $SV1->WaitKill ($server->ProcessStopWaitInterval());
73 $server2_status = $SV2->WaitKill ($server->ProcessStopWaitInterval());
74 $server3_status = $SV3->WaitKill ($server->ProcessStopWaitInterval());
76 $server->DeleteFile ($iorbase1);
77 $server->DeleteFile ($iorbase2);
78 $server->DeleteFile ($iorbase3);
79 $client->DeleteFile ($iorbase3);
81 if ($client_status != 0) {
82 print STDERR "ERROR: client returned $client_status\n";
83 $status = 1;
86 if ($server1_status != 0) {
87 print STDERR "ERROR: server 1 returned $server1_status\n";
88 $status = 1;
91 if ($server2_status != 0) {
92 print STDERR "ERROR: server 2 returned $server2_status\n";
93 $status = 1;
96 if ($server3_status != 0) {
97 print STDERR "ERROR: server 3 returned $server3_status\n";
98 $status = 1;
101 exit $status;