Ticket #254: SimpleTestTask.php.patch

File SimpleTestTask.php.patch, 2.0 KB (added by tarjei@…, 3 years ago)
  • ext/simpletest/SimpleTestTask.php

    old new  
    11<?php 
    22/** 
    3  * $Id: SimpleTestTask.php 82 2006-07-07 18:15:35Z mrook $ 
     3 * $Id: SimpleTestTask.php 284 2007-11-03 08:57:48Z hans $ 
    44 * 
    55 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    66 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
     
    2828 * Runs SimpleTest tests. 
    2929 * 
    3030 * @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 $ 
    3232 * @package phing.tasks.ext.simpletest 
    3333 * @since 2.2.0 
    3434 */ 
     
    4141        private $errorproperty; 
    4242        private $printsummary = false; 
    4343        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    } 
    4453 
    4554        /** 
    4655         * Initialize Task. 
     
    5968                require_once 'simpletest/xml.php'; 
    6069                require_once 'simpletest/test_case.php'; 
    6170                require_once 'phing/tasks/ext/simpletest/SimpleTestCountResultFormatter.php'; 
     71                require_once 'phing/tasks/ext/simpletest/SimpleTestDebugResultFormatter.php'; 
    6272                require_once 'phing/tasks/ext/simpletest/SimpleTestFormatterElement.php'; 
    6373        } 
    6474         
     
    180190                } 
    181191                 
    182192                $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 
    184199                if ($this->testfailed) 
    185200                { 
    186201                        throw new BuildException("One or more tests failed"); 
     
    228243                                $this->testfailed = true; 
    229244                        } 
    230245                } 
    231         } 
     246        } 
    232247 
    233248        private function getDefaultOutput() 
    234249        { 
    235250                return new LogWriter($this); 
    236251        } 
    237252} 
    238 ?> 
    239  No newline at end of file 
     253?>