Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / Bug_3558_Regression / run_test.pl
bloba68b2bdc72d160674653df84cb7f968dcf9c2293
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;
11 $debug_level = '0';
13 foreach $i (@ARGV) {
14 if ($i eq '-debug') {
15 $debug_level = '10';
19 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
20 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
22 my $iorbase1 = "server1.ior";
23 my $iorbase2 = "server2.ior";
24 my $server1_iorfile = $server->LocalFile ($iorbase1);
25 my $server2_iorfile = $server->LocalFile ($iorbase2);
26 my $client1_iorfile = $client->LocalFile ($iorbase1);
27 my $client2_iorfile = $client->LocalFile ($iorbase2);
29 $server->DeleteFile($iorbase1);
30 $server->DeleteFile($iorbase2);
31 $client->DeleteFile($iorbase1);
32 $client->DeleteFile($iorbase2);
34 $SV1 = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server1_iorfile");
35 $SV2 = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server2_iorfile");
36 $CL = $client->CreateProcess ("client", "-k file://$server1_iorfile -l file://$server2_iorfile -d $debug_level");
38 $server1_status = $SV1->Spawn ();
40 if ($server1_status != 0) {
41 print STDERR "ERROR: server returned $server1_status\n";
42 exit 1;
45 if ($server->WaitForFileTimed ($iorbase1,
46 $server->ProcessStartWaitInterval()) == -1) {
47 print STDERR "ERROR: cannot find file <$server1_iorfile>\n";
48 $SV1->Kill (); $SV1->TimedWait (1);
49 exit 1;
52 $server2_status = $SV2->Spawn ();
54 if ($server2_status != 0) {
55 print STDERR "ERROR: server returned $server2_status\n";
56 exit 1;
59 if ($server->WaitForFileTimed ($iorbase2,
60 $server->ProcessStartWaitInterval()) == -1) {
61 print STDERR "ERROR: cannot find file <$server2_iorfile>\n";
62 $SV1->Kill (); $SV1->TimedWait (1);
63 $SV2->Kill (); $SV2->TimedWait (1);
64 exit 1;
67 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
69 if ($client_status != 0) {
70 print STDERR "ERROR: client returned $client_status\n";
71 $status = 1;
74 $server1_status = $SV1->WaitKill ($server->ProcessStopWaitInterval());
76 if ($server1_status != 0) {
77 print STDERR "ERROR: server returned $server1_status\n";
78 $status = 1;
81 $server2_status = $SV2->WaitKill ($server->ProcessStopWaitInterval());
83 if ($server2_status != 0) {
84 print STDERR "ERROR: server returned $server2_status\n";
85 $status = 1;
88 $server->DeleteFile($iorbase1);
89 $server->DeleteFile($iorbase2);
90 $client->DeleteFile($iorbase1);
91 $client->DeleteFile($iorbase2);
93 exit $status;