Example #1
0
File: cli.php Project: extend/wee
<?php

isset($_GET['t']) or die('Argument missing.');
define('DEBUG', 1);
define('ALLOW_INCLUSION', 1);
define('ROOT_PATH', '../../');
require ROOT_PATH . 'wee/wee.php';
$o = new weeTestSuite('../tests/');
$aTests = $o->toArray();
unset($aTests[getcwd() . '/../tests/maketests.php']);
$aTests = array_keys($aTests);
try {
    $oTest = new weeUnitTestCase($aTests[$_GET['t']]);
    $oTest->run();
    echo 'success';
} catch (SkipTestException $o) {
    echo 'skip';
} catch (Exception $o) {
    echo $o;
}
Example #2
0
 /**
 	Run the test suite.
 */
 public function run()
 {
     foreach ($this->aResults as $sPath => $mResult) {
         try {
             $oTest = new weeUnitTestCase($sPath);
             $fBefore = microtime(true);
             $iMemoryUsed = $oTest->run();
             $this->addResult($sPath, 'success', microtime(true) - $fBefore, $iMemoryUsed);
             if ($oTest->hasExtData()) {
                 $this->aExtData[$sPath] = $oTest->getExtData();
             }
         } catch (SkipTestException $o) {
             $this->addResult($sPath, 'skip');
         } catch (Exception $o) {
             $this->addResult($sPath, $o);
         }
     }
 }