diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-12-10 19:33:02 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-12-10 19:33:02 +0000 |
commit | 69c236cba07b4204abb6badd3729c5598660c818 (patch) | |
tree | 40e88541710790f949e4ec0eaef2401bdf5f053d /bin | |
parent | cc500af984eb50553479de563baa58c8834069d2 (diff) | |
download | ATCD-69c236cba07b4204abb6badd3729c5598660c818.tar.gz |
ChangeLogTag:Tue Dec 10 13:23:37 2002 Nanbor Wang <nanbor@cs.wustl.edu>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/PerlACE/Process.pm | 4 | ||||
-rw-r--r-- | bin/PerlACE/Process_Unix.pm | 11 | ||||
-rw-r--r-- | bin/PerlACE/Process_Win32.pm | 38 | ||||
-rw-r--r-- | bin/PerlACE/Run_Test.pm | 2 |
4 files changed, 37 insertions, 18 deletions
diff --git a/bin/PerlACE/Process.pm b/bin/PerlACE/Process.pm index 52df7aa6c8f..62c0565cb2c 100644 --- a/bin/PerlACE/Process.pm +++ b/bin/PerlACE/Process.pm @@ -11,7 +11,7 @@ $PerlACE::Process::ExeSubDir = './'; my @new_argv = (); for(my $i = 0; $i <= $#ARGV; ++$i) { - if ($ARGV[$i] eq '-ExeSubDir') { + if ($ARGV[$i] eq '-ExeSubDir') { if (defined $ARGV[$i + 1]) { $PerlACE::Process::ExeSubDir = $ARGV[++$i].'/'; } @@ -26,6 +26,8 @@ for(my $i = 0; $i <= $#ARGV; ++$i) { } @ARGV = @new_argv; +$PerlACE::Process::WAIT_DELAY_FACTOR = $ENV{"ACE_RUNTEST_DELAY"}; + if ($OSNAME eq "MSWin32") { require PerlACE::Process_Win32; } diff --git a/bin/PerlACE/Process_Unix.pm b/bin/PerlACE/Process_Unix.pm index b6ae698d3f5..4b8966cb2c0 100644 --- a/bin/PerlACE/Process_Unix.pm +++ b/bin/PerlACE/Process_Unix.pm @@ -71,6 +71,15 @@ sub new $self->{EXECUTABLE} = shift; $self->{ARGUMENTS} = shift; + if (!defined $PerlACE::Process::WAIT_DELAY_FACTOR) { +# if (defined $self->{PURIFY_CMD}) { +# $self->{WAIT_DELAY_FACTOR} = 10; +# } +# else { + $PerlACE::Process::WAIT_DELAY_FACTOR = 1; +# } + } + bless ($self, $class); return $self; } @@ -324,6 +333,8 @@ sub TimedWait ($) my $self = shift; my $timeout = shift; + $timeout *= $PerlACE::Process::WAIT_DELAY_FACTOR; + while ($timeout-- != 0) { my $pid = waitpid ($self->{PROCESS}, &WNOHANG); if ($pid != 0 && $? != -1) { diff --git a/bin/PerlACE/Process_Win32.pm b/bin/PerlACE/Process_Win32.pm index 5b2bb1913ab..18912185c0b 100644 --- a/bin/PerlACE/Process_Win32.pm +++ b/bin/PerlACE/Process_Win32.pm @@ -36,14 +36,13 @@ sub new $self->{EXECUTABLE} = shift; $self->{ARGUMENTS} = shift; $self->{PURIFY_CMD} = $ENV{"ACE_RUN_PURIFY_CMD"}; - $self->{WAIT_DELAY_FACTOR} = $ENV{"ACE_RUNTEST_DELAY"}; - - if (!defined $self->{WAIT_DELAY_FACTOR}) { + $self->{PURIFY_OPT} = $ENV{"ACE_RUN_PURIFY_OPT"}; + if (!defined $PerlACE::Process::WAIT_DELAY_FACTOR) { if (defined $self->{PURIFY_CMD}) { - $self->{WAIT_DELAY_FACTOR} = 10; + $PerlACE::Process::WAIT_DELAY_FACTOR = 10; } else { - $self->{WAIT_DELAY_FACTOR} = 1; + $PerlACE::Process::WAIT_DELAY_FACTOR = 1; } } @@ -168,19 +167,24 @@ sub Spawn () my $orig_cmdline = $self->CommandLine (); $executable = $self->{PURIFY_CMD}; my $basename = basename ($self->{EXECUTABLE}); + + my $PurifyOptions = $self->{PURIFY_OPT}; + if (!defined $PurifyOptions) { + $PurifyOptions = + "/run ". +# "/save-data=$basename.pfy ". + "/save-text-data=$basename.pfytxt ". + "/AllocCallStackLength=20 ". + "/ErrorCallStackLength=20 ". + "/HandlesInUseAtExit ". + "/InUseAtExit ". + "/LeaksAtExit "; + } + my $basename = basename ($self->{EXECUTABLE}); $cmdline = "purify " . - "/run ". - "/save-data=$basename.pfy ". - "/save-text-data=$basename.txt ". - "/AllocCallStackLength=20 ". - "/ErrorCallStackLength=20 ". - "/HandlesInUseAtExit ". - "/InUseAtExit ". - "/LeaksAtExit ". - "$orig_cmdline" - - ; + "$PurifyOptions ". + "$orig_cmdline" ; } else { $executable = $self->Executable (); @@ -296,7 +300,7 @@ sub TimedWait ($) } if (Win32::Process::Wait ($self->{PROCESS}, - $timeout * 1000 * $self->{WAIT_DELAY_FACTOR}) == 0) { + $timeout * 1000 * $PerlACE::Process::WAIT_DELAY_FACTOR) == 0) { return -1; } diff --git a/bin/PerlACE/Run_Test.pm b/bin/PerlACE/Run_Test.pm index 3dbf541653f..d56899d5ae6 100644 --- a/bin/PerlACE/Run_Test.pm +++ b/bin/PerlACE/Run_Test.pm @@ -70,6 +70,8 @@ sub waitforfile_timed { my $file = shift; my $maxtime = shift; + $maxtime *= $PerlACE::Process::WAIT_DELAY_FACTOR; + while ($maxtime-- != 0) { if (-e $file && -s $file) { return 0; |