Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / Bug_3333_Regression / run_test.pl
blobd987f06204681c544a1d0695db835c4aad4430f6
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 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
13 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
15 my $iorbase = "server.ior";
16 my $forward_forever = "forward_forever.ior";
17 my $server_iorfile = $server->LocalFile ($iorbase);
18 my $server_forever = $server->LocalFile ($forward_forever);
19 my $client_iorfile = $client->LocalFile ($iorbase);
20 my $client_forever = $client->LocalFile ($forward_forever);
21 $server->DeleteFile($iorbase);
22 $server->DeleteFile($forward_forever);
23 $client->DeleteFile($iorbase);
24 $client->DeleteFile($forward_forever);
26 $SV = $server->CreateProcess ("Bug3333_Server", "-o $server_iorfile -p $server_forever -ORBObjRefStyle URL -ORBCollocation NO");
27 $CL = $client->CreateProcess ("Bug3333_Client", "-ORBDebugLevel0 -k file://$client_iorfile -l file://$client_forever");
29 print "Spawn server\n";
30 $server_status = $SV->Spawn ();
31 if ($server_status != 0) {
32 print STDERR "ERROR: server returned $server_status\n";
33 exit 1;
35 print "Wait for server ior file\n";
36 if ($server->WaitForFileTimed ($iorbase,
37 $server->ProcessStartWaitInterval()+10) == -1) {
38 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
39 $SV->Kill (); $SV->TimedWait (1);
40 exit 1;
42 if ($server->GetFile ($iorbase) == -1) {
43 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
44 $SV->Kill (); $SV->TimedWait (1);
45 exit 1;
47 if ($server->PutFile ($iorbase) == -1) {
48 print STDERR "ERROR: cannot set file <$server_iorfile>\n";
49 $SV->Kill (); $SV->TimedWait (1);
50 exit 1;
52 if ($server->WaitForFileTimed ($forward_forever,
53 $server->ProcessStartWaitInterval()) == -1) {
54 print STDERR "ERROR: cannot find file <$client_iorfile>\n";
55 $SV->Kill (); $SV->TimedWait (1);
56 exit 1;
58 if ($server->GetFile ($forward_forever) == -1) {
59 print STDERR "ERROR: cannot retrieve file <$client_iorfile>\n";
60 $SV->Kill (); $SV->TimedWait (1);
61 exit 1;
63 if ($server->PutFile ($forward_forever) == -1) {
64 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
65 $SV->Kill (); $SV->TimedWait (1);
66 exit 1;
69 print "Spawn client\n";
70 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45); # 60= 20x the actual roundtrip timeout policy value of 3sec, just to be sure.
71 if ($client_status != 0) {
72 print STDERR "ERROR: client returned $client_status\n";
73 $SHUTDOWN = $client->CreateProcess ("Bug3333_Client", " -k file://$server_iorfile -s");
74 $SHUTDOWN->SpawnWaitKill ($client->ProcessStartWaitInterval() + 25);
75 $status = 1;
78 print "Wait for server to finish\n";
79 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval() + 10);
80 if ($server_status != 0) {
81 print STDERR "ERROR: server returned $server_status\n";
82 $status = 1;
85 $server->DeleteFile($iorbase);
86 $server->DeleteFile($forward_forever);
87 $client->DeleteFile($iorbase);
88 $client->DeleteFile($forward_forever);
90 exit $status;