Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistUnitWorkflow.php
| Show All 36 Lines | |||||
| EOTEXT | EOTEXT | ||||
| ); | ); | ||||
| } | } | ||||
| public function getArguments() { | public function getArguments() { | ||||
| return array( | return array( | ||||
| 'rev' => array( | 'rev' => array( | ||||
| 'param' => 'revision', | 'param' => 'revision', | ||||
| 'help' => "Run unit tests covering changes since a specific revision.", | 'help' => 'Run unit tests covering changes since a specific revision.', | ||||
| 'supports' => array( | 'supports' => array( | ||||
| 'git', | 'git', | ||||
| 'hg', | 'hg', | ||||
| ), | ), | ||||
| 'nosupport' => array( | 'nosupport' => array( | ||||
| 'svn' => "Arc unit does not currently support --rev in SVN.", | 'svn' => 'Arc unit does not currently support --rev in SVN.', | ||||
| ), | ), | ||||
| ), | ), | ||||
| 'engine' => array( | 'engine' => array( | ||||
| 'param' => 'classname', | 'param' => 'classname', | ||||
| 'help' => | 'help' => | ||||
| "Override configured unit engine for this project." | 'Override configured unit engine for this project.' | ||||
| ), | ), | ||||
| 'coverage' => array( | 'coverage' => array( | ||||
| 'help' => 'Always enable coverage information.', | 'help' => 'Always enable coverage information.', | ||||
| 'conflicts' => array( | 'conflicts' => array( | ||||
| 'no-coverage' => null, | 'no-coverage' => null, | ||||
| ), | ), | ||||
| ), | ), | ||||
| 'no-coverage' => array( | 'no-coverage' => array( | ||||
| 'help' => 'Always disable coverage information.', | 'help' => 'Always disable coverage information.', | ||||
| ), | ), | ||||
| 'detailed-coverage' => array( | 'detailed-coverage' => array( | ||||
| 'help' => "Show a detailed coverage report on the CLI. Implies ". | 'help' => 'Show a detailed coverage report on the CLI. Implies '. | ||||
| "--coverage.", | '--coverage.', | ||||
| ), | ), | ||||
| 'json' => array( | 'json' => array( | ||||
| 'help' => 'Report results in JSON format.', | 'help' => 'Report results in JSON format.', | ||||
| ), | ), | ||||
| 'output' => array( | 'output' => array( | ||||
| 'param' => 'format', | 'param' => 'format', | ||||
| 'help' => | 'help' => | ||||
| "With 'full', show full pretty report (Default). ". | "With 'full', show full pretty report (Default). ". | ||||
| Show All 35 Lines | public function run() { | ||||
| $working_copy = $this->getWorkingCopy(); | $working_copy = $this->getWorkingCopy(); | ||||
| $engine_class = $this->getArgument( | $engine_class = $this->getArgument( | ||||
| 'engine', | 'engine', | ||||
| $this->getConfigurationManager()->getConfigFromAnySource('unit.engine')); | $this->getConfigurationManager()->getConfigFromAnySource('unit.engine')); | ||||
| if (!$engine_class) { | if (!$engine_class) { | ||||
| throw new ArcanistNoEngineException( | throw new ArcanistNoEngineException( | ||||
| "No unit test engine is configured for this project. Edit .arcconfig ". | 'No unit test engine is configured for this project. Edit .arcconfig '. | ||||
| "to specify a unit test engine."); | 'to specify a unit test engine.'); | ||||
| } | } | ||||
| $paths = $this->getArgument('paths'); | $paths = $this->getArgument('paths'); | ||||
| $rev = $this->getArgument('rev'); | $rev = $this->getArgument('rev'); | ||||
| $everything = $this->getArgument('everything'); | $everything = $this->getArgument('everything'); | ||||
| if ($everything && $paths) { | 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, 'ArcanistBaseUnitTestEngine')) { | ||||
| 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 ". | ||||
| ▲ Show 20 Lines • Show All 217 Lines • Show Last 20 Lines | |||||