Changeset 21814 for util

Show
Ignore:
Timestamp:
08/06/08 20:57:19 (4 months ago)
Author:
audreyt
Message:

* Solve the timeout problem at another direction by introducing PUGS_TIMEOUT

environment variable and have it set to 60 in yaml_harness.pl.

Location:
util
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • util/run-smoke.pl

    r21645 r21814  
    3131 
    3232my $failed = 0; 
    33 for (qw/YAML Test::TAP::Model Test::TAP::HTMLMatrix Best Time::Out/) { 
     33for (qw/YAML Test::TAP::Model Test::TAP::HTMLMatrix Best/) { 
    3434    check_prereq($_) or $failed++; 
    3535} 
     
    4343 
    4444  cpan Task::Smoke 
    45   cpan Time::Out 
    4645EOF 
    4746 
  • util/yaml_harness.pl

    r21808 r21814  
    278278    my @rest = @_; 
    279279    my $kid  = $self->{_child_num} ? "[$self->{_child_num}] " : ""; 
    280     warn "$kid$test\n"; 
    281     use Time::HiRes; 
    282     use Time::Out 'timeout'; 
    283     my $t = timeout(10, sub { timeit( 1, 
     280 
     281    local $ENV{PUGS_TIMEOUT} ||= 60; 
     282    my $t = timeit( 1, 
    284283        sub { $self->SUPER::run_test($test, @rest) } 
    285     ) }); 
    286     if ($Test::Harness::Straps::GLOBAL_FH) { 
    287         warn $Test::Harness::Straps::GLOBAL_FH; 
    288         die "We really want to kill ths FH child here... but how?"; 
    289         close $Test::Harness::Straps::GLOBAL_FH; 
    290     } 
     284    ); 
    291285    warn "    ".timestr($t)."\n"; 
    292286} 
    293287 
    294 use Test::Harness::Straps (); 
    295  
    296 package Test::Harness::Straps; 
    297 use vars '$GLOBAL_FH'; 
    298 no warnings 'redefine'; 
    299  
    300 sub analyze_fh { 
    301     my($self, $name, $fh) = @_; 
    302     $GLOBAL_FH = $fh; 
    303  
    304     my $it = Test::Harness::Iterator->new($fh); 
    305  
    306     my $results; 
    307     $results = $self->_analyze_iterator($name, $it); 
    308     undef $GLOBAL_FH; 
    309     return $results; 
    310 } 
    311288__END__ 
    312289# Simple YAML test harness written over Test::Harness::Straps.