Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / tests / Bug_3801_Regression / run_test.pl
blobc192f8f8c7e16b506740b2de77b74901da6e7a62
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 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
11 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
13 $client_conf = $client->LocalFile ("muxed$PerlACE::svcconf_ext");
15 $debug_level = '0';
17 foreach $i (@ARGV) {
18 if ($i eq '-mux') {
19 $client_conf = $client->LocalFile ("muxed$PerlACE::svcconf_ext");
21 elsif ($i eq '-debug') {
22 $debug_level = '10';
24 elsif ($i eq '-exclusive') {
25 $client_conf = $client->LocalFile ("exclusive$PerlACE::svcconf_ext");
29 my $iorbase = "server.ior";
30 my $server_iorfile = $server->LocalFile ($iorbase);
31 my $client_iorfile = $client->LocalFile ($iorbase);
32 $server->DeleteFile($iorbase);
33 $client->DeleteFile($iorbase);
35 $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile");
37 $server_status = $SV->Spawn ();
39 if ($server_status != 0) {
40 print STDERR "ERROR: server returned $server_status\n";
41 exit 1;
44 if ($server->WaitForFileTimed ($iorbase,
45 $server->ProcessStartWaitInterval()) == -1) {
46 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
47 $SV->Kill (); $SV->TimedWait (1);
48 exit 1;
50 if ($server->GetFile ($iorbase) == -1) {
51 print STDERR "ERROR: cannot get file <$server_iorfile>\n";
52 $SV->Kill (); $SV->TimedWait (1);
53 exit 1;
55 if ($client->PutFile ($iorbase) == -1) {
56 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
57 $SV->Kill (); $SV->TimedWait (1);
58 exit 1;
61 $CL = $client->CreateProcess ("simple_client",
62 "-ORBsvcconf $client_conf "
63 . "-ORBdebuglevel $debug_level"
64 . " -k file://$client_iorfile "
65 . " -d");
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 $CL2 = $client->CreateProcess ("simple_client",
75 "-ORBsvcconf $client_conf"
76 . " -ORBCollocation no"
77 . " -ORBdebuglevel $debug_level"
78 . " -k file://$client_iorfile "
79 . " -x -d");
81 $client_status = $CL2->SpawnWaitKill ($client->ProcessStartWaitInterval());
83 if ($client_status != 0) {
84 print STDERR "ERROR: client returned $client_status\n";
85 $status = 1;
88 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
90 if ($server_status != 0) {
91 print STDERR "ERROR: server returned $server_status\n";
92 $status = 1;
95 $server->DeleteFile($iorbase);
96 $client->DeleteFile($iorbase);
98 exit $status;