Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / MT_Client / run_test.pl
blob06b077d43f490ecf1a26cbe1698d2298909bc24e
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 $conf = $PerlACE::svcconf_ext;
15 $client_process = "client";
17 $client_conf = "client" . $conf;
18 $server_conf = "server" . $conf;
20 $threads = '4';
21 $iterations = '1000';
23 foreach $i (@ARGV) {
24 if ($i eq '-debug') {
25 $debug_level = '10';
26 } elsif ($i eq '-creation') {
27 $client_process = 'orb_creation';
32 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
33 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
35 my $iorbase = "server.ior";
36 my $server_iorfile = $server->LocalFile ($iorbase);
37 my $client_iorfile = $client->LocalFile ($iorbase);
38 $server->DeleteFile($iorbase);
39 $client->DeleteFile($iorbase);
41 $server_conf1 = $server->LocalFile ($server_conf);
43 if ($server->PutFile ($server_conf) == -1) {
44 print STDERR "ERROR: cannot set file <$server_conf1>\n";
45 exit 1;
48 $SV = $server->CreateProcess ("server",
49 "-ORBdebuglevel $debug_level " .
50 "-ORBsvcconf $server_conf1 " .
51 "-o $server_iorfile");
53 $CL = $client->CreateProcess ($client_process,
54 "-ORBdebuglevel $debug_level " .
55 "-k file://$client_iorfile " .
56 "-n $threads " .
57 "-i $iterations " .
58 "-x");
60 $server_status = $SV->Spawn ();
62 if ($server_status != 0) {
63 print STDERR "ERROR: server returned $server_status\n";
64 exit 1;
67 if ($server->WaitForFileTimed ($iorbase,
68 $server->ProcessStartWaitInterval()) == -1) {
69 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
70 $SV->Kill (); $SV->TimedWait (1);
71 exit 1;
74 if ($server->GetFile ($iorbase) == -1) {
75 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
76 $SV->Kill (); $SV->TimedWait (1);
77 exit 1;
80 if ($client->PutFile ($iorbase) == -1) {
81 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
82 $SV->Kill (); $SV->TimedWait (1);
83 exit 1;
86 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 200);
88 if ($client_status != 0) {
89 print STDERR "ERROR: client returned $client_status\n";
90 $status = 1;
93 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
95 if ($server_status != 0) {
96 print STDERR "ERROR: server returned $server_status\n";
97 $status = 1;
100 $server->DeleteFile($iorbase);
101 $client->DeleteFile($iorbase);
103 exit $status;