1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
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 $iorbase = "server.ior";
14 my $server_iorfile = $server->LocalFile ($iorbase);
15 my $client_iorfile = $client->LocalFile ($iorbase);
16 $server->DeleteFile($iorbase);
17 $client->DeleteFile($iorbase);
26 @types = ("ubstring", "ub_struct_seq");
29 for ($i = 0; $i <= $#ARGV; $i++) {
30 if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") {
31 print "Run_Test Perl script for TAO Param Test\n\n";
32 print "run_test [-n num] [-d] [-h] [-t type] [-i (dii|sii)]\n";
34 print "-n num -- runs the client num times\n";
35 print "-d -- runs each in debug mode\n";
36 print "-h -- prints this information\n";
37 print "-t type -- runs only one type of param test\n";
38 print "-i (dii|sii) -- Changes the type of invocation\n";
41 elsif ($ARGV[$i] eq "-n") {
45 elsif ($ARGV[$i] eq "-d") {
46 $debug = $debug." -d";
48 elsif ($ARGV[$i] eq "-t") {
49 @types = split (',', $ARGV[$i + 1]);
52 elsif ($ARGV[$i] eq "-i") {
53 $invocation = $ARGV[$i + 1];
58 $SV = $server->CreateProcess ("server", "$debug -o $server_iorfile");
59 $CL = $client->CreateProcess ("client");
61 foreach $type (@types) {
62 $server->DeleteFile($iorbase); # Ignore errors
63 $client->DeleteFile($iorbase);
65 print STDERR
"==== Testing $type === wait....\n";
67 $server_status = $SV->Spawn ();
69 if ($server_status != 0) {
70 print STDERR
"ERROR: server returned $server_status\n";
73 if ($server->WaitForFileTimed ($iorbase,
74 $server->ProcessStartWaitInterval()) == -1) {
75 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
80 if ($server->GetFile ($iorbase) == -1) {
81 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
82 $SV->Kill (); $SV->TimedWait (1);
85 if ($client->PutFile ($iorbase) == -1) {
86 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
87 $SV->Kill (); $SV->TimedWait (1);
91 $CL->Arguments ("$debug -f $client_iorfile -i $invocation -t $type -n $num -x");
92 $client_status = $CL->SpawnWaitKill ($server->ProcessStartWaitInterval() + 45);
94 if ($client_status != 0) {
95 print STDERR
"ERROR: client returned $client_status\n";
99 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
101 if ($server_status != 0) {
102 print STDERR
"ERROR: server returned $server_status\n";
106 $server->GetStderrLog();
109 $server->DeleteFile($iorbase);
110 $client->DeleteFile($iorbase);
112 print STDERR
"==== Test for $type finished ===\n";
115 $server->DeleteFile($iorbase);