Changeset 8249
- Timestamp:
- 07/20/10 03:29:41 (3 years ago)
- File:
-
- 1 edited
-
trunk/UnitTestContrib/lib/Unit/TestCase.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/UnitTestContrib/lib/Unit/TestCase.pm
r8112 r8249 544 544 my $result; 545 545 546 { 546 undef $this->{stdout}; 547 undef $this->{stderr}; 548 try { 547 549 local *STDOUT; 548 550 local *STDERR; … … 551 553 open STDERR, ">", $stderrfile 552 554 or die "Can't open temporary STDERR file $stderrfile: $!"; 555 553 556 $result = &$proc(@params); 554 } 555 556 my $f; 557 open($f, '<', $stdoutfile) || die "Capture failed to reopen $stdoutfile"; 558 local $/; 559 my $stdout = <$f>; 560 close($f); 561 open($f, '<', $stderrfile) || die "Capture failed to reopen $stderrfile"; 562 local $/; 563 my $stderr = <$f>; 564 close($f); 565 566 return ( $stdout, $stderr, $result ); 557 } finally { 558 my $f; 559 open($f, '<', $stdoutfile) || die "Capture failed to reopen $stdoutfile"; 560 local $/; 561 $this->{stdout} = <$f>; 562 close($f); 563 open($f, '<', $stderrfile) || die "Capture failed to reopen $stderrfile"; 564 local $/; 565 $this->{stderr} = <$f>; 566 close($f); 567 }; 568 return ( $this->{stdout}, $this->{stderr}, $result ); 567 569 } 568 570
Note: See TracChangeset
for help on using the changeset viewer.
