Ticket #254: SimpleTestTask.php.patch
| File SimpleTestTask.php.patch, 2.0 KB (added by tarjei@…, 3 years ago) |
|---|
-
ext/simpletest/SimpleTestTask.php
old new 1 1 <?php 2 2 /** 3 * $Id: SimpleTestTask.php 82 2006-07-07 18:15:35Z mrook$3 * $Id: SimpleTestTask.php 284 2007-11-03 08:57:48Z hans $ 4 4 * 5 5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 6 6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 28 28 * Runs SimpleTest tests. 29 29 * 30 30 * @author Michiel Rook <michiel.rook@gmail.com> 31 * @version $Id: SimpleTestTask.php 82 2006-07-07 18:15:35Z mrook$31 * @version $Id: SimpleTestTask.php 284 2007-11-03 08:57:48Z hans $ 32 32 * @package phing.tasks.ext.simpletest 33 33 * @since 2.2.0 34 34 */ … … 41 41 private $errorproperty; 42 42 private $printsummary = false; 43 43 private $testfailed = false; 44 private $debug = false; 45 46 public function setDebug($debug) { 47 $this->debug = $debug; 48 } 49 50 public function getDebug() { 51 return $this->debug; 52 } 44 53 45 54 /** 46 55 * Initialize Task. … … 59 68 require_once 'simpletest/xml.php'; 60 69 require_once 'simpletest/test_case.php'; 61 70 require_once 'phing/tasks/ext/simpletest/SimpleTestCountResultFormatter.php'; 71 require_once 'phing/tasks/ext/simpletest/SimpleTestDebugResultFormatter.php'; 62 72 require_once 'phing/tasks/ext/simpletest/SimpleTestFormatterElement.php'; 63 73 } 64 74 … … 180 190 } 181 191 182 192 $this->execute($group); 183 193 194 if ($this->testfailed && $this->formatters[0]->getFormatter() instanceof SimpleTestDebugResultFormatter ) { 195 $this->getDefaultOutput()->write("Failed tests: "); 196 $this->formatters[0]->getFormatter()->printFailingTests(); 197 } 198 184 199 if ($this->testfailed) 185 200 { 186 201 throw new BuildException("One or more tests failed"); … … 228 243 $this->testfailed = true; 229 244 } 230 245 } 231 }246 } 232 247 233 248 private function getDefaultOutput() 234 249 { 235 250 return new LogWriter($this); 236 251 } 237 252 } 238 ?> 239 No newline at end of file 253 ?>
