Changeset 919

Show
Ignore:
Timestamp:
05/01/08 11:38:17 (3 months ago)
Author:
doubleface
Message:

ticket #406: added live output in command line mode. p=doubleface r=laurant

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/manifests/jelix-lib.mn

    r913 r919  
    5858  jResponseRedirectUrl.class.php 
    5959  jResponseText.class.php 
     60  jResponseCmdline.class.php 
    6061  jResponseXmlrpc.class.php 
    6162  jResponseXul.class.php 
  • trunk/build/manifests/jelix-lib.mn

    r913 r919  
    5858  jResponseRedirectUrl.class.php 
    5959  jResponseText.class.php 
     60  jResponseCmdline.class.php 
    6061  jResponseXmlrpc.class.php 
    6162  jResponseXul.class.php 
  • trunk/build/manifests/jelix-lib.mn

    r913 r919  
    5858  jResponseRedirectUrl.class.php 
    5959  jResponseText.class.php 
     60  jResponseCmdline.class.php 
    6061  jResponseXmlrpc.class.php 
    6162  jResponseXul.class.php 
  • trunk/build/manifests/jelix-lib.mn

    r913 r919  
    5858  jResponseRedirectUrl.class.php 
    5959  jResponseText.class.php 
     60  jResponseCmdline.class.php 
    6061  jResponseXmlrpc.class.php 
    6162  jResponseXul.class.php 
  • trunk/build/manifests/jelix-no-opt.mn

    r673 r919  
    44* jController.class.php 
    55* jCoordinator.class.php 
     6  jCmdlineCoordinator.class.php 
    67  jErrorHandler.lib.php 
    78  jException.lib.php 
  • trunk/build/manifests/jelix-no-opt.mn

    r673 r919  
    44* jController.class.php 
    55* jCoordinator.class.php 
     6  jCmdlineCoordinator.class.php 
    67  jErrorHandler.lib.php 
    78  jException.lib.php 
  • trunk/build/manifests/jelix-no-opt.mn

    r673 r919  
    44* jController.class.php 
    55* jCoordinator.class.php 
     6  jCmdlineCoordinator.class.php 
    67  jErrorHandler.lib.php 
    78  jException.lib.php 
  • trunk/build/manifests/jelix-no-opt.mn

    r673 r919  
    44* jController.class.php 
    55* jCoordinator.class.php 
     6  jCmdlineCoordinator.class.php 
    67  jErrorHandler.lib.php 
    78  jException.lib.php 
  • trunk/lib/jelix-modules/junittests/classes/jtextrespreporter.class.php

    r781 r919  
    33* @package     jelix 
    44* @subpackage  junittests 
    5 * @author     Jouanneau Laurent 
    6 * @contributor 
    7 * @copyright  2005-2008 Jouanneau laurent 
     5* @author      Jouanneau Laurent 
     6* @contributor Thiriot Christophe 
     7* @copyright   2005-2008 Jouanneau laurent 
     8* @copyright   2008 Thiriot Christophe 
    89* @link        http://www.jelix.org 
    9 * @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     10* @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
    1011*/ 
    1112 
     
    2223 
    2324   function paintHeader($test_name) { 
    24       $this->_response->content.="\n".$test_name."\n--------------------------------\n"
     25      $this->_response->addContent("\n".$test_name."\n--------------------------------\n")
    2526   } 
    2627 
    2728    function paintFooter($test_name) { 
    2829        if ($this->getFailCount() + $this->getExceptionCount() == 0) { 
    29             $this->_response->content.= "OK\n"
     30            $this->_response->addContent("OK\n")
    3031        } else { 
    31             $this->_response->content.= "FAILURES!!!\n"
     32            $this->_response->addContent("FAILURES!!!\n")
    3233        } 
    33         $this->_response->content.= "Test cases run: " . $this->getTestCaseProgress() . 
     34        $this->_response->addContent("Test cases run: " . $this->getTestCaseProgress() . 
    3435                "/" . $this->getTestCaseCount() . 
    3536                ", Passes: " . $this->getPassCount() . 
    3637                ", Failures: " . $this->getFailCount() . 
    37                 ", Exceptions: " . $this->getExceptionCount() . "\n"
     38                ", Exceptions: " . $this->getExceptionCount() . "\n")
    3839    } 
    3940 
    4041    function paintFail($message) { 
    4142        parent::paintFail($message); 
    42         $this->_response->content.= $this->getFailCount() . ") $message\n"
     43        $this->_response->addContent($this->getFailCount() . ") $message\n")
    4344        $breadcrumb = $this->getTestList(); 
    4445        array_shift($breadcrumb); 
    45         $this->_response->content.= "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); 
    46         $this->_response->content.= "\n"
     46        $this->_response->addContent("\tin " . implode("\n\tin ", array_reverse($breadcrumb))); 
     47        $this->_response->addContent("\n")
    4748    } 
    4849 
    4950    function paintException($message) { 
    5051        parent::paintException($message); 
    51         $this->_response->content.="Exception !!\n"
     52        $this->_response->addContent("Exception !!\n")
    5253 
    5354        $breadcrumb = $this->getTestList(); 
    5455        array_shift($breadcrumb); 
    55         $this->_response->content.= "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); 
    56         $this->_response->content.= "\n\t " .$message."\n"
     56        $this->_response->addContent("\tin " . implode("\n\tin ", array_reverse($breadcrumb))); 
     57        $this->_response->addContent("\n\t " .$message."\n")
    5758    } 
    5859 
    5960    function paintError($message) { 
    6061        parent::paintError($message); 
    61         $this->_response->content.="Error !!\n"
     62        $this->_response->addContent("Error !!\n")
    6263 
    6364        $breadcrumb = $this->getTestList(); 
    6465        array_shift($breadcrumb); 
    65         $this->_response->content.= "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); 
    66         $this->_response->content.= "\n\t " .$message."\n"
     66        $this->_response->addContent("\tin " . implode("\n\tin ", array_reverse($breadcrumb))); 
     67        $this->_response->addContent("\n\t " .$message."\n")
    6768    } 
    6869 
    6970    function paintMessage($message) { 
    70         $this->_response->content.=$message."\n"
     71        $this->_response->addContent($message."\n")
    7172    } 
    7273 
    7374    function paintFormattedMessage($message) { 
    74         $this->_response->content.=$message."\n"
     75        $this->_response->addContent($message."\n")
    7576    } 
    7677 
     
    7879        $diff = new Diff(explode("\n",$stringA),explode("\n",$stringB)); 
    7980        if($diff->isEmpty()) { 
    80             $this->_response->content.='<p>Erreur diff : bizarre, aucune différence d\'aprés la difflib...</p>'
     81            $this->_response->addContent('<p>Erreur diff : bizarre, aucune différence d\'aprés la difflib...</p>')
    8182        }else{ 
    8283            $fmt = new UnifiedDiffFormatter(); 
    83             $this->_response->content.=$fmt->format($diff); 
     84            $this->_response->addContent($fmt->format($diff)); 
    8485        } 
    8586    } 
  • trunk/lib/jelix-modules/junittests/classes/jtextrespreporter.class.php

    r781 r919  
    33* @package     jelix 
    44* @subpackage  junittests 
    5 * @author     Jouanneau Laurent 
    6 * @contributor 
    7 * @copyright  2005-2008 Jouanneau laurent 
     5* @author      Jouanneau Laurent 
     6* @contributor Thiriot Christophe 
     7* @copyright   2005-2008 Jouanneau laurent 
     8* @copyright   2008 Thiriot Christophe 
    89* @link        http://www.jelix.org 
    9 * @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     10* @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
    1011*/ 
    1112 
     
    2223 
    2324   function paintHeader($test_name) { 
    24       $this->_response->content.="\n".$test_name."\n--------------------------------\n"
     25      $this->_response->addContent("\n".$test_name."\n--------------------------------\n")
    2526   } 
    2627 
    2728    function paintFooter($test_name) { 
    2829        if ($this->getFailCount() + $this->getExceptionCount() == 0) { 
    29             $this->_response->content.= "OK\n"
     30            $this->_response->addContent("OK\n")
    3031        } else { 
    31             $this->_response->content.= "FAILURES!!!\n"
     32            $this->_response->addContent("FAILURES!!!\n")
    3233        } 
    33         $this->_response->content.= "Test cases run: " . $this->getTestCaseProgress() . 
     34        $this->_response->addContent("Test cases run: " . $this->getTestCaseProgress() . 
    3435                "/" . $this->getTestCaseCount() . 
    3536                ", Passes: " . $this->getPassCount() . 
    3637                ", Failures: " . $this->getFailCount() . 
    37                 ", Exceptions: " . $this->getExceptionCount() . "\n"
     38                ", Exceptions: " . $this->getExceptionCount() . "\n")
    3839    } 
    3940 
    4041    function paintFail($message) { 
    4142        parent::paintFail($message); 
    42         $this->_response->content.= $this->getFailCount() . ") $message\n"
     43        $this->_response->addContent($this->getFailCount() . ") $message\n")
    4344        $breadcrumb = $this->getTestList(); 
    4445        array_shift($breadcrumb); 
    45         $this->_response->content.= "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); 
    46         $this->_response->content.= "\n"
     46        $this->_response->addContent("\tin " . implode("\n\tin ", array_reverse($breadcrumb))); 
     47        $this->_response->addContent("\n")
    4748    } 
    4849 
    4950    function paintException($message) { 
    5051        parent::paintException($message); 
    51         $this->_response->content.="Exception !!\n"
     52        $this->_response->addContent("Exception !!\n")
    5253 
    5354        $breadcrumb = $this->getTestList(); 
    5455        array_shift($breadcrumb); 
    55         $this->_response->content.= "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); 
    56         $this->_response->content.= "\n\t " .$message."\n"
     56        $this->_response->addContent("\tin " . implode("\n\tin ", array_reverse($breadcrumb))); 
     57        $this->_response->addContent("\n\t " .$message."\n")
    5758    } 
    5859 
    5960    function paintError($message) { 
    6061        parent::paintError($message); 
    61         $this->_response->content.="Error !!\n"
     62        $this->_response->addContent("Error !!\n")
    6263 
    6364        $breadcrumb = $this->getTestList(); 
    6465        array_shift($breadcrumb); 
    65         $this->_response->content.= "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); 
    66         $this->_response->content.= "\n\t " .$message."\n"
     66        $this->_response->addContent("\tin " . implode("\n\tin ", array_reverse($breadcrumb))); 
     67        $this->_response->addContent("\n\t " .$message."\n")
    6768    } 
    6869 
    6970    function paintMessage($message) { 
    70         $this->_response->content.=$message."\n"
     71        $this->_response->addContent($message."\n")
    7172    } 
    7273 
    7374    function paintFormattedMessage($message) { 
    74         $this->_response->content.=$message."\n"
     75        $this->_response->addContent($message."\n")
    7576    } 
    7677 
     
    7879        $diff = new Diff(explode("\n",$stringA),explode("\n",$stringB)); 
    7980        if($diff->isEmpty()) { 
    80             $this->_response->content.='<p>Erreur diff : bizarre, aucune différence d\'aprés la difflib...</p>'
     81            $this->_response->addContent('<p>Erreur diff : bizarre, aucune différence d\'aprés la difflib...</p>')
    8182        }else{ 
    8283            $fmt = new UnifiedDiffFormatter(); 
    83             $this->_response->content.=$fmt->format($diff); 
     84            $this->_response->addContent($fmt->format($diff)); 
    8485        } 
    8586    } 
  • trunk/lib/jelix-modules/junittests/classes/jtextrespreporter.class.php

    r781 r919  
    33* @package     jelix 
    44* @subpackage  junittests 
    5 * @author     Jouanneau Laurent 
    6 * @contributor 
    7 * @copyright  2005-2008 Jouanneau laurent 
     5* @author      Jouanneau Laurent 
     6* @contributor Thiriot Christophe 
     7* @copyright   2005-2008 Jouanneau laurent 
     8* @copyright   2008 Thiriot Christophe 
    89* @link        http://www.jelix.org 
    9 * @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     10* @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
    1011*/ 
    1112 
     
    2223 
    2324   function paintHeader($test_name) { 
    24       $this->_response->content.="\n".$test_name."\n--------------------------------\n"
     25      $this->_response->addContent("\n".$test_name."\n--------------------------------\n")
    2526   } 
    2627 
    2728    function paintFooter($test_name) { 
    2829        if ($this->getFailCount() + $this->getExceptionCount() == 0) { 
    29             $this->_response->content.= "OK\n"
     30            $this->_response->addContent("OK\n")
    3031        } else { 
    31             $this->_response->content.= "FAILURES!!!\n"
     32            $this->_response->addContent("FAILURES!!!\n")
    3233        } 
    33         $this->_response->content.= "Test cases run: " . $this->getTestCaseProgress() . 
     34        $this->_response->addContent("Test cases run: " . $this->getTestCaseProgress() . 
    3435                "/" . $this->getTestCaseCount() . 
    3536                ", Passes: " . $this->getPassCount() . 
    3637                ", Failures: " . $this->getFailCount() . 
    37                 ", Exceptions: " . $this->getExceptionCount() . "\n"
     38                ", Exceptions: " . $this->getExceptionCount() . "\n")
    3839    } 
    3940 
    4041    function paintFail($message) { 
    4142        parent::paintFail($message); 
    42         $this->_response->content.= $this->getFailCount() . ") $message\n"
     43        $this->_response->addContent($this->getFailCount() . ") $message\n")
    4344        $breadcrumb = $this->getTestList(); 
    4445        array_shift($breadcrumb); 
    45         $this->_response->content.= "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); 
    46         $this->_response->content.= "\n"
     46        $this->_response->addContent("\tin " . implode("\n\tin ", array_reverse($breadcrumb))); 
     47        $this->_response->addContent("\n")
    4748    } 
    4849 
    4950    function paintException($message) { 
    5051        parent::paintException($message); 
    51         $this->_response->content.="Exception !!\n"
     52        $this->_response->addContent("Exception !!\n")
    5253 
    5354        $breadcrumb = $this->getTestList(); 
    5455        array_shift($breadcrumb); 
    55         $this->_response->content.= "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); 
    56         $this->_response->content.= "\n\t " .$message."\n"
     56        $this->_response->addContent("\tin " . implode("\n\tin ", array_reverse($breadcrumb))); 
     57        $this->_response->addContent("\n\t " .$message."\n")
    5758    } 
    5859 
    5960    function paintError($message) { 
    6061        parent::paintError($message); 
    61         $this->_response->content.="Error !!\n"
     62        $this->_response->addContent("Error !!\n")
    6263 
    6364        $breadcrumb = $this->getTestList(); 
    6465        array_shift($breadcrumb); 
    65         $this->_response->content.= "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); 
    66         $this->_response->content.= "\n\t " .$message."\n"
     66        $this->_response->addContent("\tin " . implode("\n\tin ", array_reverse($breadcrumb))); 
     67        $this->_response->addContent("\n\t " .$message."\n")
    6768    } 
    6869 
    6970    function paintMessage($message) { 
    70         $this->_response->content.=$message."\n"
     71        $this->_response->addContent($message."\n")
    7172    } 
    7273 
    7374    function paintFormattedMessage($message) { 
    74         $this->_response->content.=$message."\n"
     75        $this->_response->addContent($message."\n")
    7576    } 
    7677 
     
    7879        $diff = new Diff(explode("\n",$stringA),explode("\n",$stringB)); 
    7980        if($diff->isEmpty()) { 
    80             $this->_response->content.='<p>Erreur diff : bizarre, aucune différence d\'aprés la difflib...</p>'
     81            $this->_response->addContent('<p>Erreur diff : bizarre, aucune différence d\'aprés la difflib...</p>')
    8182        }else{ 
    8283            $fmt = new UnifiedDiffFormatter(); 
    83             $this->_response->content.=$fmt->format($diff); 
     84            $this->_response->addContent($fmt->format($diff)); 
    8485        } 
    8586    } 
  • trunk/lib/jelix-modules/junittests/classes/jtextrespreporter.class.php

    r781 r919  
    33* @package     jelix 
    44* @subpackage  junittests 
    5 * @author     Jouanneau Laurent 
    6 * @contributor 
    7 * @copyright  2005-2008 Jouanneau laurent 
     5* @author      Jouanneau Laurent 
     6* @contributor Thiriot Christophe 
     7* @copyright   2005-2008 Jouanneau laurent 
     8* @copyright   2008 Thiriot Christophe 
    89* @link        http://www.jelix.org 
    9 * @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     10* @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
    1011*/ 
    1112 
     
    2223 
    2324   function paintHeader($test_name) { 
    24       $this->_response->content.="\n".$test_name."\n--------------------------------\n"
     25      $this->_response->addContent("\n".$test_name."\n--------------------------------\n")
    2526   } 
    2627 
    2728    function paintFooter($test_name) { 
    2829        if ($this->getFailCount() + $this->getExceptionCount() == 0) { 
    29             $this->_response->content.= "OK\n"
     30            $this->_response->addContent("OK\n")
    3031        } else { 
    31             $this->_response->content.= "FAILURES!!!\n"
     32            $this->_response->addContent("FAILURES!!!\n")
    3233        } 
    33         $this->_response->content.= "Test cases run: " . $this->getTestCaseProgress() . 
     34        $this->_response->addContent("Test cases run: " . $this->getTestCaseProgress() . 
    3435                "/" . $this->getTestCaseCount() . 
    3536                ", Passes: " . $this->getPassCount() . 
    3637                ", Failures: " . $this->getFailCount() . 
    37                 ", Exceptions: " . $this->getExceptionCount() . "\n"
     38                ", Exceptions: " . $this->getExceptionCount() . "\n")
    3839    } 
    3940 
    4041    function paintFail($message) { 
    4142        parent::paintFail($message); 
    42         $this->_response->content.= $this->getFailCount() . ") $message\n"
     43        $this->_response->addContent($this->getFailCount() . ") $message\n")
    4344        $breadcrumb = $this->getTestList(); 
    4445        array_shift($breadcrumb); 
    45         $this->_response->content.= "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); 
    46         $this->_response->content.= "\n"
     46        $this->_response->addContent("\tin " . implode("\n\tin ", array_reverse($breadcrumb))); 
     47        $this->_response->addContent("\n")
    4748    } 
    4849 
    4950    function paintException($message) { 
    5051        parent::paintException($message); 
    51         $this->_response->content.="Exception !!\n"
     52        $this->_response->addContent("Exception !!\n")
    5253 
    5354        $breadcrumb = $this->getTestList(); 
    5455        array_shift($breadcrumb); 
    55         $this->_response->content.= "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); 
    56         $this->_response->content.= "\n\t " .$message."\n"
     56        $this->_response->addContent("\tin " . implode("\n\tin ", array_reverse($breadcrumb))); 
     57        $this->_response->addContent("\n\t " .$message."\n")
    5758    } 
    5859 
    5960    function paintError($message) { 
    6061        parent::paintError($message); 
    61         $this->_response->content.="Error !!\n"
     62        $this->_response->addContent("Error !!\n")
    6263 
    6364        $breadcrumb = $this->getTestList(); 
    6465        array_shift($breadcrumb); 
    65         $this->_response->content.= "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); 
    66         $this->_response->content.= "\n\t " .$message."\n"
     66        $this->_response->addContent("\tin " . implode("\n\tin ", array_reverse($breadcrumb))); 
     67        $this->_response->addContent("\n\t " .$message."\n")
    6768    } 
    6869 
    6970    function paintMessage($message) { 
    70         $this->_response->content.=$message."\n"
     71        $this->_response->addContent($message."\n")
    7172    } 
    7273 
    7374    function paintFormattedMessage($message) { 
    74         $this->_response->content.=$message."\n"
     75        $this->_response->addContent($message."\n")
    7576    } 
    7677 
     
    7879        $diff = new Diff(explode("\n",$stringA),explode("\n",$stringB)); 
    7980        if($diff->isEmpty()) { 
    80             $this->_response->content.='<p>Erreur diff : bizarre, aucune différence d\'aprés la difflib...</p>'
     81            $this->_response->addContent('<p>Erreur diff : bizarre, aucune différence d\'aprés la difflib...</p>')
    8182        }else{ 
    8283            $fmt = new UnifiedDiffFormatter(); 
    83             $this->_response->content.=$fmt->format($diff); 
     84            $this->_response->addContent($fmt->format($diff)); 
    8485        } 
    8586    } 
  • trunk/lib/jelix-modules/junittests/controllers/default.cmdline.php

    r852 r919  
    44* @subpackage  junittests 
    55* @author      Jouanneau Laurent 
    6 * @contributor  
     6* @contributor Thiriot Christophe 
    77* @copyright   2008 Jouanneau laurent 
     8* @copyright   2008 Thiriot Christophe 
    89* @link        http://www.jelix.org 
    910* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    3839        $rep = $this->getResponse(); 
    3940 
    40         $rep->content =
     41        $rep->addContent(
    4142Unit Tests        php version: '.phpversion().'   Jelix version: '.JELIX_VERSION.' 
    4243=========================================================================== 
    43 '
     44')
    4445 
    4546        foreach($GLOBALS['gJConfig']->_modulesPathList as $module=>$path){ 
     
    6465 
    6566    protected function _finishResponse($rep){ 
    66  
    6767        return $rep; 
    6868    } 
     
    7575        if(count($this->testsList)){ 
    7676            foreach($this->testsList as $module=>$tests) { 
    77                 $rep->content.= 'module "'.$module."\":\n"
     77                $rep->addContent('module "'.$module."\":\n", true)
    7878                foreach($tests as $test){ 
    79                     $rep->content.= "\t".$test[2]."\t(".$test[1].")\n"
     79                    $rep->addContent("\t".$test[2]."\t(".$test[1].")\n", true)
    8080                } 
    8181            } 
    8282        } 
    8383        else { 
    84             $rep->content.='No availabled tests'
     84            $rep->addContent('No availabled tests')
    8585        } 
    8686        return $this->_finishResponse($rep); 
     
    102102                $group->addTestFile($GLOBALS['gJConfig']->_modulesPathList[$module].'tests/'.$test[0]); 
    103103            } 
    104             $group->run($reporter); 
     104            $result = $group->run($reporter); 
     105            if (!$result) $rep->setExitCode(jResponseCmdline::EXIT_CODE_ERROR); 
    105106            jContext::pop(); 
    106107        } 
     
    125126            } 
    126127            jContext::push($module); 
    127             $group->run($reporter); 
     128            $result = $group->run($reporter); 
     129            if (!$result) $rep->setExitStatus(jResponseCmdline::EXIT_CODE_ERROR); 
    128130            jContext::pop(); 
    129131        } 
     
    149151                    $group->addTestFile($GLOBALS['gJConfig']->_modulesPathList[$module].'tests/'.$test[0]); 
    150152                    jContext::push($module); 
    151                     $group->run($reporter); 
     153                    $result = $group->run($reporter); 
     154                    if (!$result) $rep->setExitStatus(jResponseCmdline::EXIT_CODE_ERROR); 
    152155                    jContext::pop(); 
    153156                    break; 
     
    155158            } 
    156159        }else 
    157             $rep->content.= "\n" . 'no tests for "'.$module.'" module.' . "\n"
     160            $rep->addContent("\n" . 'no tests for "'.$module.'" module.' . "\n")
    158161        return $this->_finishResponse($rep); 
    159162    } 
  • trunk/lib/jelix-modules/junittests/controllers/default.cmdline.php

    r852 r919  
    44* @subpackage  junittests 
    55* @author      Jouanneau Laurent 
    6 * @contributor  
     6* @contributor Thiriot Christophe 
    77* @copyright   2008 Jouanneau laurent 
     8* @copyright   2008 Thiriot Christophe 
    89* @link        http://www.jelix.org 
    910* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    3839        $rep = $this->getResponse(); 
    3940 
    40         $rep->content =
     41        $rep->addContent(
    4142Unit Tests        php version: '.phpversion().'   Jelix version: '.JELIX_VERSION.' 
    4243=========================================================================== 
    43 '
     44')
    4445 
    4546        foreach($GLOBALS['gJConfig']->_modulesPathList as $module=>$path){ 
     
    6465 
    6566    protected function _finishResponse($rep){ 
    66  
    6767        return $rep; 
    6868    } 
     
    7575        if(count($this->testsList)){ 
    7676            foreach($this->testsList as $module=>$tests) { 
    77                 $rep->content.= 'module "'.$module."\":\n"
     77                $rep->addContent('module "'.$module."\":\n", true)
    7878                foreach($tests as $test){ 
    79                     $rep->content.= "\t".$test[2]."\t(".$test[1].")\n"
     79                    $rep->addContent("\t".$test[2]."\t(".$test[1].")\n", true)
    8080                } 
    8181            } 
    8282        } 
    8383        else { 
    84             $rep->content.='No availabled tests'
     84            $rep->addContent('No availabled tests')
    8585        } 
    8686        return $this->_finishResponse($rep); 
     
    102102                $group->addTestFile($GLOBALS['gJConfig']->_modulesPathList[$module].'tests/'.$test[0]); 
    103103            } 
    104             $group->run($reporter); 
     104            $result = $group->run($reporter); 
     105            if (!$result) $rep->setExitCode(jResponseCmdline::EXIT_CODE_ERROR); 
    105106            jContext::pop(); 
    106107        } 
     
    125126            } 
    126127            jContext::push($module); 
    127             $group->run($reporter); 
     128            $result = $group->run($reporter); 
     129            if (!$result) $rep->setExitStatus(jResponseCmdline::EXIT_CODE_ERROR); 
    128130            jContext::pop(); 
    129131        } 
     
    149151                    $group->addTestFile($GLOBALS['gJConfig']->_modulesPathList[$module].'tests/'.$test[0]); 
    150152                    jContext::push($module); 
    151                     $group->run($reporter); 
     153                    $result = $group->run($reporter); 
     154                    if (!$result) $rep->setExitStatus(jResponseCmdline::EXIT_CODE_ERROR); 
    152155                    jContext::pop(); 
    153156                    break; 
     
    155158            } 
    156159        }else 
    157             $rep->content.= "\n" . 'no tests for "'.$module.'" module.' . "\n"
     160            $rep->addContent("\n" . 'no tests for "'.$module.'" module.' . "\n")
    158161        return $this->_finishResponse($rep); 
    159162    } 
  • trunk/lib/jelix-modules/junittests/controllers/default.cmdline.php

    r852 r919  
    44* @subpackage  junittests 
    55* @author      Jouanneau Laurent 
    6 * @contributor  
     6* @contributor Thiriot Christophe 
    77* @copyright   2008 Jouanneau laurent 
     8* @copyright   2008 Thiriot Christophe 
    89* @link        http://www.jelix.org 
    910* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    3839        $rep = $this->getResponse(); 
    3940 
    40         $rep->content =
     41        $rep->addContent(
    4142Unit Tests        php version: '.phpversion().'   Jelix version: '.JELIX_VERSION.' 
    4243=========================================================================== 
    43 '
     44')
    4445 
    4546        foreach($GLOBALS['gJConfig']->_modulesPathList as $module=>$path){ 
     
    6465 
    6566    protected function _finishResponse($rep){ 
    66  
    6767        return $rep; 
    6868    } 
     
    7575        if(count($this->testsList)){ 
    7676            foreach($this->testsList as $module=>$tests) { 
    77                 $rep->content.= 'module "'.$module."\":\n"
     77                $rep->addContent('module "'.$module."\":\n", true)
    7878                foreach($tests as $test){ 
    79                     $rep->content.= "\t".$test[2]."\t(".$test[1].")\n"
     79                    $rep->addContent("\t".$test[2]."\t(".$test[1].")\n", true)
    8080                } 
    8181            } 
    8282        } 
    8383        else { 
    84             $rep->content.='No availabled tests'
     84            $rep->addContent('No availabled tests')
    8585        } 
    8686        return $this->_finishResponse($rep); 
     
    102102                $group->addTestFile($GLOBALS['gJConfig']->_modulesPathList[$module].'tests/'.$test[0]); 
    103103            } 
    104             $group->run($reporter); 
     104            $result = $group->run($reporter); 
     105            if (!$result) $rep->setExitCode(jResponseCmdline::EXIT_CODE_ERROR); 
    105106            jContext::pop(); 
    106107        } 
     
    125126            } 
    126127            jContext::push($module); 
    127             $group->run($reporter); 
     128            $result = $group->run($reporter); 
     129            if (!$result) $rep->setExitStatus(jResponseCmdline::EXIT_CODE_ERROR); 
    128130            jContext::pop(); 
    129131        } 
     
    149151                    $group->addTestFile($GLOBALS['gJConfig']->_modulesPathList[$module].'tests/'.$test[0]); 
    150152                    jContext::push($module); 
    151                     $group->run($reporter); 
     153                    $result = $group->run($reporter); 
     154                    if (!$result) $rep->setExitStatus(jResponseCmdline::EXIT_CODE_ERROR); 
    152155                    jContext::pop(); 
    153156                    break; 
     
    155158            } 
    156159        }else 
    157             $rep->content.= "\n" . 'no tests for "'.$module.'" module.' . "\n"
     160            $rep->addContent("\n" . 'no tests for "'.$module.'" module.' . "\n")
    158161        return $this->_finishResponse($rep); 
    159162    } 
  • trunk/lib/jelix-modules/junittests/controllers/default.cmdline.php

    r852 r919  
    44* @subpackage  junittests 
    55* @author      Jouanneau Laurent 
    6 * @contributor  
     6* @contributor Thiriot Christophe 
    77* @copyright   2008 Jouanneau laurent 
     8* @copyright   2008 Thiriot Christophe 
    89* @link        http://www.jelix.org 
    9