Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / CORBA_is_nil / run_test.pl
blobaee70bcec964cbeb0675b84b90f9cca3367ebe6f
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 = "server.ior";
23 my $server_iorfile = $server->LocalFile ($iorbase);
24 my $client_iorfile = $client->LocalFile ($iorbase);
25 $server->DeleteFile($iorbase);
26 $client->DeleteFile($iorbase);
28 $conf_file = "svc$PerlACE::svcconf_ext";
29 $client_conf = $client->LocalFile ($conf_file);
31 $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile");
33 # copy the configruation file.
34 if ($client->PutFile ($conf_file) == -1) {
35 print STDERR "ERROR: cannot set file <$client_conf>\n";
36 $SV->Kill (); $SV->TimedWait (1);
37 exit 1;
40 $CL = $client->CreateProcess ("client", "-ORBSvcConf $client_conf -ORBdebuglevel $debug_level -f file://$client_iorfile");
42 $server_status = $SV->Spawn ();
44 if ($server_status != 0) {
45 print STDERR "ERROR: server returned $server_status\n";
46 exit 1;
49 if ($server->WaitForFileTimed ($iorbase,
50 $server->ProcessStartWaitInterval()) == -1) {
51 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
52 $SV->Kill (); $SV->TimedWait (1);
53 exit 1;
56 if ($server->GetFile ($iorbase) == -1) {
57 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
58 $SV->Kill (); $SV->TimedWait (1);
59 exit 1;
61 if ($client->PutFile ($iorbase) == -1) {
62 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
63 $SV->Kill (); $SV->TimedWait (1);
64 exit 1;
67 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
69 if ($client_status != 0) {
70 print STDERR "ERROR: client returned $client_status\n";
71 $status = 1;
74 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
76 if ($server_status != 0) {
77 print STDERR "ERROR: server returned $server_status\n";
78 $status = 1;
81 $server->GetStderrLog();
82 $client->GetStderrLog();
84 $server->DeleteFile($server_iorfile);
85 $client->DeleteFile($client_iorfile);
87 exit $status;