Changeset 316

Show
Ignore:
Timestamp:
12/10/07 08:51:27 (1 year ago)
Author:
mrook
Message:

#192, #194 - Add haltonincomplete and haltonskipped properties

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.3/classes/phing/tasks/ext/phpunit/PHPUnitTask.php

    r305 r316  
    4040        private $haltonerror = false; 
    4141        private $haltonfailure = false; 
     42        private $haltonincomplete = false; 
     43        private $haltonskipped = false; 
     44        private $errorproperty; 
    4245        private $failureproperty; 
    43         private $errorproperty; 
     46        private $incompleteproperty; 
     47        private $skippedproperty; 
    4448        private $printsummary = false; 
    4549        private $testfailed = false; 
     
    132136        } 
    133137         
     138        function setErrorproperty($value) 
     139        { 
     140                $this->errorproperty = $value; 
     141        } 
     142         
    134143        function setFailureproperty($value) 
    135144        { 
     
    137146        } 
    138147         
    139         function setErrorproperty($value) 
    140         { 
    141                 $this->errorproperty = $value; 
     148        function setIncompleteproperty($value) 
     149        { 
     150                $this->incompleteproperty = $value; 
     151        } 
     152         
     153        function setSkippedproperty($value) 
     154        { 
     155                $this->skippedproperty = $value; 
    142156        } 
    143157         
     
    150164        { 
    151165                $this->haltonfailure = $value; 
     166        } 
     167 
     168        function setHaltonincomplete($value) 
     169        { 
     170                $this->haltonincomplete = $value; 
     171        } 
     172 
     173        function setHaltonskipped($value) 
     174        { 
     175                $this->haltonskipped = $value; 
    152176        } 
    153177 
     
    324348                                $this->testfailed = true; 
    325349                        } 
    326                 } 
    327                  
     350                } elseif ($retcode == PHPUnitTestRunner::INCOMPLETES) { 
     351                        if ($this->incompleteproperty) { 
     352                                $this->project->setNewProperty($this->incompleteproperty, true); 
     353                        } 
     354                         
     355                        if ($this->haltonincomplete) { 
     356                                $this->testfailed = true; 
     357                        } 
     358                } elseif ($retcode == PHPUnitTestRunner::SKIPPED) { 
     359                        if ($this->skippedproperty) { 
     360                                $this->project->setNewProperty($this->skippedproperty, true); 
     361                        } 
     362                         
     363                        if ($this->haltonskipped) { 
     364                                $this->testfailed = true; 
     365                        } 
     366                } 
    328367        } 
    329368 
  • branches/2.3/classes/phing/tasks/ext/phpunit/PHPUnitTestRunner.php

    r276 r316  
    3737        const FAILURES = 1; 
    3838        const ERRORS = 2; 
     39        const INCOMPLETES = 3; 
     40        const SKIPPED = 4; 
    3941 
    4042        private $test = NULL; 
     
    117119                        $this->retCode = self::ERRORS; 
    118120                } 
    119  
    120                 else if ($res->failureCount() != 0 || $res->notImplementedCount() != 0 || $res->skippedCount() != 0) 
     121                else if ($res->failureCount() != 0) 
    121122                { 
    122123                        $this->retCode = self::FAILURES; 
     124                } 
     125                else if ($res->notImplementedCount() != 0) 
     126                { 
     127                        $this->retCode = self::INCOMPLETES; 
     128                } 
     129                else if ($res->skippedCount() != 0) 
     130                { 
     131                        $this->retCode = self::SKIPPED; 
    123132                } 
    124133        }