Changeset View
Changeset View
Standalone View
Standalone View
src/unit/engine/ArcanistUnitTestEngine.php
| <?php | <?php | ||||
| /** | /** | ||||
| * Manages unit test execution. | * Manages unit test execution. | ||||
| */ | */ | ||||
| abstract class ArcanistUnitTestEngine { | abstract class ArcanistUnitTestEngine { | ||||
| private $workingCopy; | private $workingCopy; | ||||
| private $paths; | private $paths; | ||||
| private $arguments = array(); | private $arguments = array(); | ||||
| protected $diffID; | |||||
| private $enableAsyncTests; | private $enableAsyncTests; | ||||
| private $enableCoverage; | private $enableCoverage; | ||||
| private $runAllTests; | private $runAllTests; | ||||
| protected $renderer; | protected $renderer; | ||||
| final public function __construct() {} | |||||
| public function setRunAllTests($run_all_tests) { | final public function setRunAllTests($run_all_tests) { | ||||
| if (!$this->supportsRunAllTests() && $run_all_tests) { | if (!$this->supportsRunAllTests() && $run_all_tests) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| "Engine '%s' does not support %s.", | "Engine '%s' does not support %s.", | ||||
| get_class($this), | get_class($this), | ||||
| '--everything')); | '--everything')); | ||||
| } | } | ||||
| $this->runAllTests = $run_all_tests; | $this->runAllTests = $run_all_tests; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getRunAllTests() { | final public function getRunAllTests() { | ||||
| return $this->runAllTests; | return $this->runAllTests; | ||||
| } | } | ||||
| protected function supportsRunAllTests() { | protected function supportsRunAllTests() { | ||||
| return false; | return false; | ||||
| } | } | ||||
| final public function __construct() {} | final public function setConfigurationManager( | ||||
| public function setConfigurationManager( | |||||
| ArcanistConfigurationManager $configuration_manager) { | ArcanistConfigurationManager $configuration_manager) { | ||||
| $this->configurationManager = $configuration_manager; | $this->configurationManager = $configuration_manager; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getConfigurationManager() { | final public function getConfigurationManager() { | ||||
| return $this->configurationManager; | return $this->configurationManager; | ||||
| } | } | ||||
| final public function setWorkingCopy( | final public function setWorkingCopy( | ||||
| ArcanistWorkingCopyIdentity $working_copy) { | ArcanistWorkingCopyIdentity $working_copy) { | ||||
| $this->workingCopy = $working_copy; | $this->workingCopy = $working_copy; | ||||
| return $this; | return $this; | ||||
| Show All 34 Lines | final public function setEnableCoverage($enable_coverage) { | ||||
| $this->enableCoverage = $enable_coverage; | $this->enableCoverage = $enable_coverage; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| final public function getEnableCoverage() { | final public function getEnableCoverage() { | ||||
| return $this->enableCoverage; | return $this->enableCoverage; | ||||
| } | } | ||||
| public function setRenderer(ArcanistUnitRenderer $renderer) { | final public function setRenderer(ArcanistUnitRenderer $renderer) { | ||||
| $this->renderer = $renderer; | $this->renderer = $renderer; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| abstract public function run(); | abstract public function run(); | ||||
| /** | /** | ||||
| * Modify the return value of this function in the child class, if you do | * Modify the return value of this function in the child class, if you do | ||||
| Show All 9 Lines | |||||