Changeset View
Changeset View
Standalone View
Standalone View
src/unit/engine/PhutilUnitTestEngine.php
| Show All 13 Lines | final class PhutilUnitTestEngine extends ArcanistBaseUnitTestEngine { | ||||
| public function run() { | public function run() { | ||||
| if ($this->getRunAllTests()) { | if ($this->getRunAllTests()) { | ||||
| $run_tests = $this->getAllTests(); | $run_tests = $this->getAllTests(); | ||||
| } else { | } else { | ||||
| $run_tests = $this->getTestsForPaths(); | $run_tests = $this->getTestsForPaths(); | ||||
| } | } | ||||
| if (!$run_tests) { | if (!$run_tests) { | ||||
| throw new ArcanistNoEffectException("No tests to run."); | throw new ArcanistNoEffectException('No tests to run.'); | ||||
| } | } | ||||
| $enable_coverage = $this->getEnableCoverage(); | $enable_coverage = $this->getEnableCoverage(); | ||||
| if ($enable_coverage !== false) { | if ($enable_coverage !== false) { | ||||
| if (!function_exists('xdebug_start_code_coverage')) { | if (!function_exists('xdebug_start_code_coverage')) { | ||||
| if ($enable_coverage === true) { | if ($enable_coverage === true) { | ||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| "You specified --coverage but xdebug is not available, so ". | 'You specified --coverage but xdebug is not available, so '. | ||||
| "coverage can not be enabled for PhutilUnitTestEngine."); | 'coverage can not be enabled for PhutilUnitTestEngine.'); | ||||
| } | } | ||||
| } else { | } else { | ||||
| $enable_coverage = true; | $enable_coverage = true; | ||||
| } | } | ||||
| } | } | ||||
| $project_root = $this->getWorkingCopy()->getProjectRoot(); | $project_root = $this->getWorkingCopy()->getProjectRoot(); | ||||
| ▲ Show 20 Lines • Show All 154 Lines • Show Last 20 Lines | |||||