Skip to content

Commit

Permalink
add checks for Proc::ProcessTable
Browse files Browse the repository at this point in the history
  • Loading branch information
xdg committed Jul 5, 2008
1 parent 0cd6aa0 commit 53d1cf7
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 16 deletions.
9 changes: 6 additions & 3 deletions Changes
@@ -1,13 +1,16 @@
Revision history for Perl module CPAN::Reporter

1.1601
1.1601 Sat Jul 5 09:37:14 EDT 2008

- Fixed: reverted 1.15_56 PERL5OPT changes; Devel::Autoflush INC path
no longer added with "-I" as it causes old modules to be found during
testing. Testers will have to live with authors complaining about
Devel::Autoflush missing when calling 'perl' instead of $^X

Devel::Autoflush missing when authors call 'perl' instead of $^X

- Fixed: timeout support on *nix checks for *both* Proc::Killfam and
Proc::ProcessTable to protect against unauthorized copies of only
Proc::Killfam bundled in distributions like Tk-ExecuteCommand

1.16 Fri Jul 4 09:14:52 EDT 2008

- No changes since 1.15_56
Expand Down
11 changes: 8 additions & 3 deletions lib/CPAN/Reporter.pm
Expand Up @@ -1140,11 +1140,16 @@ sub _temp_filename {
sub _timeout_wrapper {
my ($cmd, $timeout) = @_;

eval "use Proc::Killfam ()";
# Check Proc::ProcessTable also in case an unauthorized Proc::Killfam is
# present, as from Tk-ExecuteCommand
{
local $SIG{__WARN__} = sub {}; # protect against v-string warning
eval "require Proc::ProcessTable; require Proc::Killfam";
}
if ($@) {
$CPAN::Frontend->mywarn( << 'HERE' );
CPAN::Reporter: you need Proc::Killfam for inactivity_timeout support.
Continuing without timeout...
CPAN::Reporter: you need Proc::ProcessTable and Proc::Killfam for
inactivity_timeout support. Continuing without timeout...
HERE
return;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/CPAN/Reporter/Config.pm
Expand Up @@ -673,7 +673,7 @@ to stop after some amount of time; generally, this should be large --
900 seconds or more -- as some distributions' tests take quite a long time to
run. On MSWin32, [Win32::Job] is a needed and trying to kill a processes may
actually deadlock in some situations -- so use at your own risk. On other
platforms, [Proc::Killfam] is required.
platforms, [Proc::ProcessTable] and [Proc::Killfam] are required.
* {editor = <editor>} -- editor to use to edit the test report; if not set,
Test::Reporter will use environment variables {VISUAL}, {EDITOR} or {EDIT}
(in that order) to find an editor
Expand Down
9 changes: 6 additions & 3 deletions t/13_record_command.t
Expand Up @@ -109,9 +109,12 @@ require_ok( "CPAN::Reporter" );
for my $c ( @cases ) {
SKIP: {
if ( $^O ne 'MSWin32' && $c->{timeout} ) {
eval "use Proc::Killfam ()";
skip "Proc::Killfam needed for timeout testing", $tests_per_case
if $@;
{
local $SIG{__WARN__} = sub {}; # suppress v-string warnings
eval "require Proc::ProcessTable; require Proc::Killfam";
}
skip "requires Proc::ProcessTable and Proc::Killfam", $tests_per_case
if $@;
}
if ( $^O eq 'MSWin32' && $c->{timeout} ) {
skip "\$ENV{PERL_AUTHOR_TESTING} required for Win32 timeout testing",
Expand Down
9 changes: 6 additions & 3 deletions t/14_command_timeout.t
Expand Up @@ -17,9 +17,12 @@ use Probe::Perl ();
#--------------------------------------------------------------------------#

if ( $^O ne 'MSWin32' ) {
eval "use Proc::Killfam ()";
plan skip_all => "Can't interrupt hung processes without Proc::Killfam"
if $@;
{
local $SIG{__WARN__} = sub {}; # suppress v-string warnings
eval "require Proc::ProcessTable; require Proc::Killfam";
}
plan skip_all => "requires Proc::ProcessTable and Proc::Killfam"
if $@;
}
if ( $^O eq "MSWin32" ) {
plan skip_all => "\$ENV{PERL_AUTHOR_TESTING} required for Win32 timeout testing",
Expand Down
9 changes: 6 additions & 3 deletions t/57_hang_interrupt.t
Expand Up @@ -14,9 +14,12 @@ use File::Temp;
#--------------------------------------------------------------------------#

if ( $^O ne 'MSWin32' ) {
eval "use Proc::Killfam ()";
plan skip_all => "Can't interrupt hung processes without Proc::Killfam"
if $@;
{
local $SIG{__WARN__} = sub {}; # suppress v-string warnings
eval "require Proc::ProcessTable; require Proc::Killfam";
}
plan skip_all => "requires Proc::ProcessTable and Proc::Killfam"
if $@;
}
if ( $^O eq "MSWin32" ) {
plan skip_all => "\$ENV{PERL_AUTHOR_TESTING} required for Win32 timeout testing",
Expand Down

0 comments on commit 53d1cf7

Please sign in to comment.