Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Bug_2953_Regression / run_test.pl
blob00111078ad35e567277b29edf403880aaef74f4b
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 # used in server
23 $iorbaseA = "iorA.ior";
24 $iorbaseB = "iorB.ior";
26 my $server_iorfileA = $server->LocalFile ($iorbaseA);
27 my $server_iorfileB = $server->LocalFile ($iorbaseB);
28 my $client_iorfileA = $client->LocalFile ($iorbaseA);
29 my $client_iorfileB = $client->LocalFile ($iorbaseB);
30 $server->DeleteFile($iorbaseA);
31 $server->DeleteFile($iorbaseB);
32 $client->DeleteFile($iorbaseA);
33 $client->DeleteFile($iorbaseB);
35 $SV = $server->CreateProcess ("server", "-ORBDebuglevel $debug_level -a $server_iorfileA -b $server_iorfileB");
37 $CL = $client->CreateProcess ("client", "-a file://$client_iorfileA -b file://$client_iorfileB");
39 $server_status = $SV->Spawn ();
41 if ($server_status != 0) {
42 print STDERR "ERROR: server returned $server_status\n";
43 exit 1;
46 if ($server->WaitForFileTimed ($iorbaseA,
47 $server->ProcessStartWaitInterval ()) == -1) {
48 print STDERR "ERROR: cannot find file <$server_iorfileA>\n";
49 $SV->Kill (); $SV->TimedWait (1);
50 exit 1;
53 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval ());
55 if ($client_status != 0) {
56 print STDERR "ERROR: client returned $client_status\n";
57 $status = 1;
60 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval ());
62 if ($server_status != 0) {
63 print STDERR "ERROR: server returned $server_status\n";
64 $status = 1;
67 $server->DeleteFile($iorbaseA);
68 $server->DeleteFile($iorbaseB);
69 $client->DeleteFile($iorbaseA);
70 $client->DeleteFile($iorbaseB);
72 exit $status;