Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / AMI / run_test.pl
blob884119168eb12d7e85485803f5e13e2537c553b3
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";
14 $server_debug_level = '0';
15 $client_debug_level = '0';
16 $iterations = '1';
18 $conf_file = "muxed$PerlACE::svcconf_ext";
20 foreach $i (@ARGV) {
21 if ($i eq '-mux') {
22 $conf_file = "muxed$PerlACE::svcconf_ext";
24 elsif ($i eq '-debug') {
25 $server_debug_level = '1';
26 $client_debug_level = '1';
28 elsif ($i eq '-exclusive') {
29 $conf_file = "exclusive$PerlACE::svcconf_ext";
33 $client_conf = $client->LocalFile ($conf_file);
35 my $iorbase = "server.ior";
36 my $server_iorfile = $server->LocalFile ($iorbase);
37 my $client_iorfile = $client->LocalFile ($iorbase);
38 $server->DeleteFile($iorbase);
39 $client->DeleteFile($iorbase);
41 $SV = $server->CreateProcess ("server", "-ORBdebuglevel $server_debug_level -o $server_iorfile");
43 $server_status = $SV->Spawn ();
45 if ($server_status != 0) {
46 print STDERR "ERROR: server returned $server_status\n";
47 exit 1;
50 if ($server->WaitForFileTimed ($iorbase,
51 $server->ProcessStartWaitInterval()) == -1) {
52 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
53 $SV->Kill (); $SV->TimedWait (1);
54 exit 1;
56 if ($server->GetFile ($iorbase) == -1) {
57 print STDERR "ERROR: cannot get file <$server_iorfile>\n";
58 $SV->Kill (); $SV->TimedWait (1);
59 exit 1;
61 if ($client->PutFile ($iorbase) == -1) {
62 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
63 $SV->Kill (); $SV->TimedWait (1);
64 exit 1;
66 # copy the configuration file.
67 if ($client->PutFile ($conf_file) == -1) {
68 print STDERR "ERROR: cannot set file <$client_conf>\n";
69 $SV->Kill (); $SV->TimedWait (1);
70 exit 1;
73 $CL = $client->CreateProcess ("simple_client",
74 "-ORBsvcconf $client_conf "
75 . "-ORBdebuglevel $client_debug_level"
76 . " -k file://$client_iorfile "
77 . " -i $iterations -d");
79 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
81 if ($client_status != 0) {
82 print STDERR "ERROR: client returned $client_status\n";
83 $status = 1;
87 $CL2 = $client->CreateProcess ("simple_client",
88 "-ORBsvcconf $client_conf"
89 . " -ORBCollocation no"
90 . " -ORBdebuglevel $client_debug_level"
91 . " -k file://$client_iorfile "
92 . " -i $iterations -x -d");
94 $client_status = $CL2->SpawnWaitKill ($client->ProcessStartWaitInterval());
96 if ($client_status != 0) {
97 print STDERR "ERROR: client returned $client_status\n";
98 $status = 1;
101 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
103 if ($server_status != 0) {
104 print STDERR "ERROR: server returned $server_status\n";
105 $status = 1;
108 $server->DeleteFile($iorbase);
109 $client->DeleteFile($iorbase);
111 exit $status;