- Timestamp:
- 08/06/08 14:24:17 (4 months ago)
- Files:
-
- 1 modified
-
util/yaml_harness.pl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
util/yaml_harness.pl
r21805 r21808 279 279 my $kid = $self->{_child_num} ? "[$self->{_child_num}] " : ""; 280 280 warn "$kid$test\n"; 281 my $t = timeit( 1, sub { $self->SUPER::run_test($test, @rest) } ); 281 use Time::HiRes; 282 use Time::Out 'timeout'; 283 my $t = timeout(10, sub { timeit( 1, 284 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 } 282 291 warn " ".timestr($t)."\n"; 283 292 } 293 294 use Test::Harness::Straps (); 295 296 package Test::Harness::Straps; 297 use vars '$GLOBAL_FH'; 298 no warnings 'redefine'; 284 299 285 300 sub analyze_fh { 286 301 my($self, $name, $fh) = @_; 302 $GLOBAL_FH = $fh; 287 303 288 304 my $it = Test::Harness::Iterator->new($fh); 289 305 290 use Time::HiRes; 291 use Time::Out 'timeout'; 292 my $results = Test::Harness::Results->new; 293 timeout 60 => sub { $results = $self->_analyze_iterator($name, $it) }; 306 my $results; 307 $results = $self->_analyze_iterator($name, $it); 308 undef $GLOBAL_FH; 294 309 return $results; 295 310 } 296 297 311 __END__ 298 312 # Simple YAML test harness written over Test::Harness::Straps.
