Changeset 7219
- Timestamp:
- 04/19/10 17:23:01 (2 years ago)
- File:
-
- 1 edited
-
trunk/UnitTestContrib/lib/Unit/TestRunner.pm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/UnitTestContrib/lib/Unit/TestRunner.pm
r7180 r7219 102 102 $action = runOne($tester, $suite, $testToRun); 103 103 } 104 ($action) = $action =~ m/^(.*)$/ms; 104 # untaint action for the case where the test is run in another process 105 ($action) = $action =~ m/^(.*)$/ms; 106 105 107 eval $action; 106 108 die $@ if $@; 107 109 die "Test suite $suite aborted\n" unless $completed; 108 110 } 109 }111 } 110 112 111 113 if ( $this->{unexpected_failures} || $this->{unexpected_passes} ) { 114 $this->{unexpected_failures} ||= 0; 115 $this->{unexpected_passes} ||= 0; 112 116 if ($this->{unexpected_failures}) { 113 print $this->{unexpected_failures} . " failure".117 print $this->{unexpected_failures} . " failure". 114 118 ($this->{unexpected_failures}>1?'s':''). 115 119 "\n"; 116 }120 } 117 121 if ($this->{unexpected_passes}) { 118 print $this->{unexpected_passes} . " unexpected pass".122 print $this->{unexpected_passes} . " unexpected pass". 119 123 ($this->{unexpected_passes}>1?'es':''). 120 124 "\n"; 121 }125 } 122 126 if (($passes + $this->{unexpected_failures}) > 1) { 123 127 #don't print the failure a second time if there is only one test run - its really annoying. … … 125 129 "\n"; 126 130 } 127 $this->{unexpected_failures} ||= 0;128 131 print "$passes of ", $passes + $this->{unexpected_failures}, 129 132 " test cases passed\n"; … … 280 283 } 281 284 foreach my $test (@tests) { 282 #Devel::Leak::Object::checkpoint();285 #Devel::Leak::Object::checkpoint(); 283 286 print "\t$test\n"; 287 $action .= "\n# $test\n "; 284 288 $tester->set_up(); 285 289 try { 286 290 $tester->$test(); 287 291 $action .= '$passes++;'; 292 if ( $tester->{expect_failure} ) { 293 $action .= '$this->{unexpected_passes}++;'; 294 } 288 295 } 289 296 catch Error with { … … 297 304 } 298 305 $action .= 'push( @{ $this->{failures} }, "' 299 . $test300 . '\ n'306 . quotemeta( $test ) 307 . '\\n' 301 308 . quotemeta( $e->stringify() ) 302 309 . '" );'; 303 }304 otherwise {305 if ( $tester->{expect_failure} ) {306 $action .= '$this->{unexpected_passes}++;';307 }308 310 }; 309 311 $tester->tear_down();
Note: See TracChangeset
for help on using the changeset viewer.
