Commit d8ac77d5 authored by meus's avatar meus

fixing test runner to allow running custom groups

parent 92e52488
...@@ -423,13 +423,28 @@ if (PHP_SAPI === "cli") { ...@@ -423,13 +423,28 @@ if (PHP_SAPI === "cli") {
} }
$argv = $_SERVER["argv"]; $argv = $_SERVER["argv"];
if (isset($argv[1]) && $argv[1] == "coverage") { $coverage = false;
array_shift($argv);
if(isset($argv[1]) && $argv[1] == "coverage"){
array_shift($argv);
$coverage = true;
}
if( ! empty($argv)){
$testGroup = new GroupTest("Custom");
foreach($argv as $group){
$testGroup->addTestCase($$group);
}
} else {
$testGroup = $test;
}
if ($coverage) {
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
$test->run($reporter); $testGroup->run($reporter);
$result["path"] = Doctrine::getPath() . DIRECTORY_SEPARATOR; $result["path"] = Doctrine::getPath() . DIRECTORY_SEPARATOR;
$result["coverage"] = xdebug_get_code_coverage(); $result["coverage"] = xdebug_get_code_coverage();
xdebug_stop_code_coverage(); xdebug_stop_code_coverage();
file_put_contents("coverage.txt", serialize($result)); file_put_contents("coverage.txt", serialize($result));
} else { } else {
$test->run($reporter); $testGroup->run($reporter);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment