Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / RTCORBA / Persistent_IOR / run_test.pl
blobf1dbb327896696d326b48264d380c9e14b9a9d89
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 $iiop_port = 27532;
16 $tp_iiop_port = 27533;
18 $extra_server_args = "-d 1 -ORBEndpoint iiop://1.2\@:$iiop_port -ORBLaneEndpoint 2:0 iiop://1.2\@:$tp_iiop_port";
20 @iorfiles =
22 "not_used_ior_1",
23 "not_used_ior_2",
24 "persistent_ior",
25 "transient_ior",
26 "tp_persistent_ior",
29 @configurations =
31 iorfiles => [ "persistent_ior", "tp_persistent_ior", "transient_ior" ],
32 server => "-a ". $server->LocalFile ("tp_persistent_ior") ." -p ".
33 $server->LocalFile ("persistent_ior") ." -t ".
34 $server->LocalFile ("transient_ior") ." $extra_server_args",
35 clients => [ "-k file://".$client->LocalFile("tp_persistent_ior"),
36 "-k file://".$client->LocalFile("persistent_ior"),
37 "-k file://".$client->LocalFile("transient_ior")." -x" ],
38 }, {
39 iorfiles => [ "not_used_ior_1", "not_used_ior_2", "transient_ior" ],
40 server => "-a ". $server->LocalFile ("not_used_ior_1") ." -p ".
41 $server->LocalFile ("not_used_ior_2") ." -t ".
42 $server->LocalFile ("transient_ior") ." $extra_server_args",
43 clients => [ "-k file://".$client->LocalFile("tp_persistent_ior"),
44 "-k file://".$client->LocalFile("persistent_ior"),
45 "-k file://".$client->LocalFile("transient_ior")." -x" ],
49 sub run_client
51 print "\nRunning client with the following args: @_\n\n";
53 $CL = $client->CreateProcess ("client", @_);
55 $CL->Spawn ();
57 $client_status = $CL->WaitKill ($client->ProcessStartWaitInterval ());
59 if ($client_status != 0) {
60 print STDERR "ERROR: client returned $client_status\n";
61 $status = 1;
62 zap_server (1);
66 sub run_server
68 my @parms = @_;
69 my $args = $parms[0];
70 my $iorfiles = $parms[1];
72 print "\nRunning server with the following args: $args\n\n";
74 $SV = $server->CreateProcess ("server", $args);
75 $SV->Spawn ();
77 for $file (@$iorfiles) {
78 if ($server->WaitForFileTimed ($file,
79 $server->ProcessStartWaitInterval ()) == -1) {
80 print STDERR "ERROR: cannot find ior file: $file\n";
81 $status = 1;
82 zap_server (1);
87 sub zap_server
89 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval ());
91 if ($server_status != 0) {
92 print STDERR "ERROR: server returned $server_status\n";
93 $status = 1;
96 if ($_[0]) {
97 for $file (@iorfiles) {
98 $server->DeleteFile ($file);
101 exit $status;
105 for $file (@iorfiles) {
106 $server->DeleteFile ($file);
107 $client->DeleteFile ($file);
110 for $test (@configurations) {
111 print STDERR "\n******************************************************\n";
113 run_server ($test->{server}, $test->{iorfiles});
115 my $clients = $test->{clients};
116 for $args (@$clients) {
117 run_client ($args);
120 zap_server (0);
123 for $file (@iorfiles) {
124 $server->DeleteFile ($file);
125 $client->DeleteFile ($file);
128 exit $status;