Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / POA / On_Demand_Loading / run_test.pl
blob99fefb3b3e71c9257051588803f5d44f251aac07
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 $iorbase0 = "ior";
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 $server->AddLibPath ('../Generic_Servant/.');
16 $client->AddLibPath ('../Generic_Servant/.');
18 $oneway = "";
19 $iterations = 100;
21 $extra_args = "";
23 $status = 0;
25 # Parse the arguments
26 for ($i = 0; $i <= $#ARGV; $i++) {
27 if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") {
28 print "run_test [-h] [-i iterations] [-o] [-f ior file]\n";
29 print "\n";
30 print "-h -- prints this information\n";
31 print "-f -- ior file\n";
32 print "-i iterations -- specifies iterations\n";
33 print "-o -- call issued are oneways\n";
34 exit;
36 elsif ($ARGV[$i] eq "-o") {
37 $oneway = "-o";
39 elsif ($ARGV[$i] eq "-i") {
40 $iterations = $ARGV[$i + 1];
41 $i++;
43 elsif ($ARGV[$i] eq "-f") {
44 $iorbase0 = $ARGV[$i + 1];
45 $i++;
47 else {
48 $extra_args .= " " . $ARGV[$i];
52 $iorbase1 = $iorbase0."_1";
53 $iorbase2 = $iorbase0."_2";
55 $iorfile0 = $server->LocalFile ($iorbase0);
56 $iorfile1 = $server->LocalFile ($iorbase1);
57 $iorfile2 = $server->LocalFile ($iorbase2);
59 $client_iorfile1 = $client->LocalFile ($iorbase1);
60 $client_iorfile2 = $client->LocalFile ($iorbase2);
62 $server->DeleteFile($iorbase0);
63 $server->DeleteFile($iorbase1);
64 $server->DeleteFile($iorbase2);
65 $client->DeleteFile ($iorbase1);
66 $client->DeleteFile ($iorbase2);
68 $SV = $server->CreateProcess ("server", "-f $iorfile0 $extra_args");
69 $CL = $client->CreateProcess ("../Generic_Servant/client");
71 $server_status = $SV->Spawn ();
73 if ($server_status != 0) {
74 print STDERR "ERROR: server returned $server_status\n";
75 exit 1;
78 if ($server->WaitForFileTimed ($iorbase1,
79 $server->ProcessStartWaitInterval()) == -1) {
80 print STDERR "ERROR: cannot find file <$iorfile1>\n";
81 $SV->Kill (); $SV->TimedWait (1);
82 exit 1;
85 if ($server->WaitForFileTimed ($iorbase2,
86 $server->ProcessStartWaitInterval()) == -1) {
87 print STDERR "ERROR: cannot find file <$iorfile2>\n";
88 $SV->Kill (); $SV->TimedWait (1);
89 exit 1;
92 $CL->Arguments ("$extra_args $oneway -i $iterations -k file://$client_iorfile1");
94 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
96 if ($client_status != 0) {
97 print STDERR "ERROR: client 1 returned $client_status\n";
98 $status = 1;
101 $CL->Arguments ("$extra_args $oneway -i $iterations -k file://$client_iorfile2 -x");
103 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
105 if ($client_status != 0) {
106 print STDERR "ERROR: client 2 returned $client_status\n";
107 $status = 1;
110 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
112 if ($server_status != 0) {
113 print STDERR "ERROR: server returned $server_status\n";
114 $SV->Kill ();
115 $status = 1;
118 $server->DeleteFile($iorbase0);
119 $server->DeleteFile($iorbase1);
120 $server->DeleteFile($iorbase2);
121 $client->DeleteFile ($iorbase1);
122 $client->DeleteFile ($iorbase2);
124 exit $status;