Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / tests / DII_AMI_Forward / run_test.pl
blobbc184d4ae14596d7d9ba15403ce49bdfcbb6b168
3 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
4 & eval 'exec perl -S $0 $argv:q'
5 if 0;
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 $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
20 $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
22 $status = 0;
23 $iorbase = "server.ior";
24 $server_iorfile = $server->LocalFile($iorbase);
25 $client_iorfile = $client->LocalFile($iorbase);
27 $server->DeleteFile($iorbase);
28 $client->DeleteFile($iorbase);
30 $SV = $server->CreateProcess ("server", "-ORBDebuglevel $debug_level -ORBid AMI_Forward_server -o $server_iorfile");
31 $CL = $client->CreateProcess ("client", "-ORBdebuglevel $debug_level -ORBid AMI_Forward_client -k file://$client_iorfile");
33 $SV->Spawn ();
35 if ($server->WaitForFileTimed ($iorbase,
36 $server->ProcessStartWaitInterval()) == -1) {
37 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
38 $SV->Kill (); $SV->TimedWait (1);
39 exit 1;
42 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
43 $server_status = $SV->Kill ();
45 if ($client_status != 0) {
46 print STDERR "ERROR: client returned $client_status\n";
47 $status = 1;
50 if ($server_status != 0) {
51 print STDERR "ERROR: server returned $server_status\n";
52 $status = 1;
55 $server->DeleteFile($iorbase);
56 $client->DeleteFile($iorbase);
58 exit $status;