Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistUnitWorkflow.php
| <?php | <?php | ||||
| /** | /** | ||||
| * Runs unit tests which cover your changes. | * Runs unit tests which cover your changes. | ||||
| */ | */ | ||||
| final class ArcanistUnitWorkflow extends ArcanistBaseWorkflow { | final class ArcanistUnitWorkflow extends ArcanistWorkflow { | ||||
| const RESULT_OKAY = 0; | const RESULT_OKAY = 0; | ||||
| const RESULT_UNSOUND = 1; | const RESULT_UNSOUND = 1; | ||||
| const RESULT_FAIL = 2; | const RESULT_FAIL = 2; | ||||
| const RESULT_SKIP = 3; | const RESULT_SKIP = 3; | ||||
| const RESULT_POSTPONED = 4; | const RESULT_POSTPONED = 4; | ||||
| private $unresolvedTests; | private $unresolvedTests; | ||||
| ▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | if ($everything && $paths) { | ||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| 'You can not specify paths with --everything. The --everything '. | 'You can not specify paths with --everything. The --everything '. | ||||
| 'flag runs every test.'); | 'flag runs every test.'); | ||||
| } | } | ||||
| $paths = $this->selectPathsForWorkflow($paths, $rev); | $paths = $this->selectPathsForWorkflow($paths, $rev); | ||||
| if (!class_exists($engine_class) || | if (!class_exists($engine_class) || | ||||
| !is_subclass_of($engine_class, 'ArcanistBaseUnitTestEngine')) { | !is_subclass_of($engine_class, 'ArcanistUnitTestEngine')) { | ||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| "Configured unit test engine '{$engine_class}' is not a subclass of ". | "Configured unit test engine '{$engine_class}' is not a subclass of ". | ||||
| "'ArcanistBaseUnitTestEngine'."); | "'ArcanistUnitTestEngine'."); | ||||
| } | } | ||||
| $this->engine = newv($engine_class, array()); | $this->engine = newv($engine_class, array()); | ||||
| $this->engine->setWorkingCopy($working_copy); | $this->engine->setWorkingCopy($working_copy); | ||||
| $this->engine->setConfigurationManager($this->getConfigurationManager()); | $this->engine->setConfigurationManager($this->getConfigurationManager()); | ||||
| if ($everything) { | if ($everything) { | ||||
| $this->engine->setRunAllTests(true); | $this->engine->setRunAllTests(true); | ||||
| } else { | } else { | ||||
| ▲ Show 20 Lines • Show All 209 Lines • Show Last 20 Lines | |||||