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
;
12 my $server = 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 $server->AddLibPath ('../Generic_Servant/.');
16 $client->AddLibPath ('../Generic_Servant/.');
24 for ($i = 0; $i <= $#ARGV; $i++) {
25 if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") {
26 print "run_test [-h] [-i iterations] [-o] [-f ior file]\n";
28 print "-h -- prints this information\n";
29 print "-f -- ior file\n";
30 print "-i iterations -- specifies iterations\n";
31 print "-o -- call issued are oneways\n";
34 elsif ($ARGV[$i] eq "-o") {
37 elsif ($ARGV[$i] eq "-i") {
38 $iterations = $ARGV[$i + 1];
41 elsif ($ARGV[$i] eq "-f") {
42 $iorbase = $ARGV[$i + 1];
46 $extra_args .= " " . $ARGV[$i];
50 $server_iorfile = $server->LocalFile ($iorbase);
51 $client_iorfile = $client->LocalFile ($iorbase);
52 $server->DeleteFile ($iorbase);
53 $client->DeleteFile ($iorbase);
55 $SV = $server->CreateProcess ("server", "-f $server_iorfile $extra_args");
56 $CL = $client->CreateProcess ("../Generic_Servant/client", "$extra_args $oneway -i $iterations -k file://$client_iorfile -x");
60 $server_status = $SV->Spawn ();
62 if ($server_status != 0) {
63 print STDERR
"ERROR: server returned $server_status\n";
67 if ($server->WaitForFileTimed ($iorbase,
68 $server->ProcessStartWaitInterval()) == -1) {
69 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
70 $SV->Kill (); $SV->TimedWait (1);
74 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
76 if ($client_status != 0) {
77 print STDERR
"ERROR: client returned $client_status\n";
81 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
83 if ($server_status != 0) {
84 print STDERR
"ERROR: server returned $server_status\n";
88 $server->DeleteFile ($iorbase);
89 $client->DeleteFile ($iorbase);