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 $iorbase = "server.ior";
15 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
16 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
18 $server_iorfile = $server->LocalFile ($iorbase);
19 $client_iorfile = $client->LocalFile ($iorbase);
20 $server->LocalFile ($testbase);
21 $server->DeleteFile($iorbase);
22 $server->DeleteFile($testbase);
23 $client->DeleteFile($iorbase);
25 $SV = $server->CreateProcess ("server", "-o $server_iorfile");
26 $CL = $client->CreateProcess ("client", "-k $client_iorfile");
28 $server_status = $SV->Spawn ();
30 if ($server_status != 0) {
31 print STDERR
"ERROR: server returned $server_status\n";
35 if ($server->WaitForFileTimed ($iorbase,
36 $server->ProcessStartWaitInterval()) == -1) {
37 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
38 $SV->Kill (); $SV->TimedWait (1);
42 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
43 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
45 $server->DeleteFile($iorbase);
46 $client->DeleteFile($iorbase);
47 $server->DeleteFile($testbase); # created by the program
49 if ($client_status != 0) {
50 print STDERR
"ERROR: client returned $client_status\n";
54 if ($server_status != 0) {
55 print STDERR
"ERROR: server returned $server_status\n";