Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / RTCORBA / Client_Protocol / run_test.pl
blobe8f56722d9ff6f17b532c78c9d0306fd8c4ec8e3
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 $status = 0;
15 my $iorbase1 = "test1.ior";
16 my $iorbase2 = "test2.ior";
18 my $server_iorfile1 = $server->LocalFile ($iorbase1);
19 my $server_iorfile2 = $server->LocalFile ($iorbase2);
21 my $client_iorfile1 = $client->LocalFile ($iorbase1);
22 my $client_iorfile2 = $client->LocalFile ($iorbase2);
24 $server->DeleteFile ($iorbase1);
25 $server->DeleteFile ($iorbase2);
27 $client->DeleteFile ($iorbase1);
28 $client->DeleteFile ($iorbase2);
30 print STDERR "\n********** RTCORBA Client Protocol Policy Unit Test\n\n";
32 # Arguments are platform-dependent (UIOP not available on Windows).
33 $server_args =
35 (($^O eq "MSWin32") ? "-p 1413566210 " : "-p 1413566208 ")
36 ."-ORBendpoint iiop:// -ORBendpoint shmiop:// "
37 .(($^O eq "MSWin32" || $^O eq "VMS") ? "" : "-ORBEndpoint uiop:// ");
40 $client_args =
41 "-s file://$client_iorfile1 -c file://$client_iorfile2 "
42 .(($^O eq "MSWin32" || $^O eq "VMS") ? "" : "-p 1413566210 ")
43 ."-ORBdebuglevel 1 ";
45 # Start server.
46 $SV = $server->CreateProcess ("server", "-s $server_iorfile1 -c $server_iorfile2 $server_args");
48 $CL = $client->CreateProcess ("client", $client_args);
50 $SV->Spawn ();
52 if ($server->WaitForFileTimed ($iorbase2,
53 $server->ProcessStartWaitInterval()) == -1) {
54 print STDERR "ERROR: cannot find file <$server_iorfile2>\n";
55 $SV->Kill (); $SV->TimedWait (1);
56 exit 1;
59 # Start client.
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 $server->DeleteFile ($iorbase1);
75 $server->DeleteFile ($iorbase2);
77 $client->DeleteFile ($iorbase1);
78 $client->DeleteFile ($iorbase2);
80 # Clean up SHMIOP files
81 PerlACE::check_n_cleanup_files ("server_shmiop_*");
83 exit $status;