Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / Bug_3068_Regression / run_test.pl
blobc3d38451373ae6c1993a5f9228317ea903b34108
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 $iorbase = "test.ior";
23 my $server_iorfile = $server->LocalFile ($iorbase);
24 my $client_iorfile = $client->LocalFile ($iorbase);
25 $server->DeleteFile($iorbase);
26 $client->DeleteFile($iorbase);
28 my $server_conf_base = "server.conf";
29 my $client_conf_base = "client.conf";
30 my $server_conf = $server->LocalFile ($server_conf_base);
31 my $client_conf = $client->LocalFile ($client_conf_base);
33 if ($server->PutFile ($server_conf_base) == -1) {
34 print STDERR "ERROR: cannot set file <$server_conf>\n";
35 $SV->Kill (); $SV->TimedWait (1);
36 exit 1;
38 if ($client->PutFile ($client_conf_base) == -1) {
39 print STDERR "ERROR: cannot set file <$client_conf>\n";
40 $SV->Kill (); $SV->TimedWait (1);
41 exit 1;
44 $SV = $server->CreateProcess ("server",
45 "-ORBdebuglevel $debug_level " .
46 "-ORBSvcConf $server_conf " .
47 "-ORBListenendpoints iiop://:/reuse_addr=0 " .
48 "-o $server_iorfile");
50 $CL = $client->CreateProcess ("client",
51 "-ORBSvcConf $client_conf " .
52 "-k file://$client_iorfile");
54 $server_status = $SV->Spawn ();
56 if ($server_status != 0) {
57 print STDERR "ERROR: server returned $server_status\n";
58 exit 1;
61 if ($server->WaitForFileTimed ($iorbase,
62 $server->ProcessStartWaitInterval()) == -1) {
63 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
64 $SV->Kill (); $SV->TimedWait (1);
65 exit 1;
68 if ($server->GetFile ($iorbase) == -1) {
69 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
70 $SV->Kill (); $SV->TimedWait (1);
71 exit 1;
73 if ($client->PutFile ($iorbase) == -1) {
74 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
75 $SV->Kill (); $SV->TimedWait (1);
76 exit 1;
79 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 105);
81 if ($client_status != 0) {
82 print STDERR "ERROR: client returned $client_status\n";
83 $status = 1;
86 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
88 if ($server_status != 0) {
89 print STDERR "ERROR: server returned $server_status\n";
90 $status = 1;
93 $server->DeleteFile($iorbase);
94 $client->DeleteFile($iorbase);
96 if ($status != 0) {
97 print STDERR "Test failed\n";
99 else {
100 print STDERR "Test succeded\n";
103 exit $status;