Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / tests / Client_Leaks / run_test.pl
blob759f6766be94d8c4e6238588ae9cf7ff6761d788
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 $target = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
12 $iorfile = $target->LocalFile ("server.ior");
13 $target->DeleteFile ($iorfile);
14 $status = 0;
16 $SV = $target->CreateProcess ("server", " -o $iorfile");
17 $CL = $target->CreateProcess ("client", " -k file://$iorfile");
19 $SV->Spawn ();
21 if ($target->WaitForFileTimed($iorfile, $target->ProcessStartWaitInterval ()) == -1) {
22 print STDERR "ERROR: cannot find file <$iorfile>\n";
23 $SV->Kill (); $SV->TimedWait (1);
24 exit 1;
27 $client = $CL->SpawnWaitKill ($target->ProcessStartWaitInterval () + 585);
29 if ($client != 0) {
30 print STDERR "ERROR: client returned $client\n";
31 $status = 1;
34 $server = $SV->WaitKill ($target->ProcessStopWaitInterval ());
36 if ($server != 0) {
37 print STDERR "ERROR: server returned $server\n";
38 $status = 1;
41 $target->GetStderrLog();
42 $target->DeleteFile ($iorfile);
44 exit $status;