Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / DSI_Gateway / run_test.pl
blob807c293b1e1a3e8379eed29236b897b07de52150
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;
11 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
12 my $gateway = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
13 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
15 my $iorbase = "server.ior";
16 my $gwbase = "gateway.ior";
18 my $server_iorfile = $server->LocalFile ($iorbase);
19 my $server_gwfile = $server->LocalFile ($gwbase);
20 my $gateway_iorfile = $server->LocalFile ($iorbase);
21 my $gateway_gwfile = $server->LocalFile ($gwbase);
22 my $client_gwfile = $client->LocalFile ($gwbase);
24 $server->DeleteFile ($iorbase);
25 $server->DeleteFile ($gwbase);
26 $gateway->DeleteFile ($iorbase);
27 $gateway->DeleteFile ($gwbase);
28 $client->DeleteFile ($gwbase);
30 $status = 0;
32 $SV = $server->CreateProcess ("server", "-o $server_iorfile");
33 $GW = $gateway->CreateProcess ("gateway", "-k file://$gateway_iorfile -o $gateway_gwfile");
34 $CL = $client->CreateProcess ("client", "-k file://$client_gwfile -x -i 100");
36 $server_status = $SV->Spawn ();
38 if ($server_status != 0) {
39 print STDERR "ERROR: server returned $server_status\n";
40 exit 1;
43 if ($server->WaitForFileTimed ($iorbase,
44 $server->ProcessStartWaitInterval()) == -1) {
45 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
46 $SV->Kill (); $SV->TimedWait (1);
47 exit 1;
50 $GW->Spawn ();
52 if ($gateway->WaitForFileTimed ($gwbase,
53 $gateway->ProcessStartWaitInterval()) == -1) {
54 print STDERR "ERROR: cannot find file <$gateway_gwfile>\n";
55 $SV->Kill (); $SV->TimedWait (1);
56 $GW->Kill (); $GW->TimedWait (1);
57 exit 1;
60 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
62 if ($client_status != 0) {
63 print STDERR "ERROR: client returned $client_status\n";
64 $status = 1;
67 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
69 if ($server_status != 0) {
70 print STDERR "ERROR: server returned $server_status\n";
71 $status = 1;
74 $gateway_status = $GW->WaitKill ($gateway->ProcessStopWaitInterval());
76 if ($gateway_status != 0) {
77 print STDERR "ERROR: gateway returned $gateway_status\n";
78 $status = 1;
81 $server->DeleteFile ($iorbase);
82 $server->DeleteFile ($gwbase);
83 $gateway->DeleteFile ($iorbase);
84 $gateway->DeleteFile ($gwbase);
85 $client->DeleteFile ($gwbase);
87 exit $status;