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 extends Phobject { | abstract class ArcanistUnitTestEngine extends Phobject { | ||||
private $workingCopy; | private $workingCopy; | ||||
private $paths = array(); | private $paths = array(); | ||||
private $enableCoverage; | private $enableCoverage; | ||||
private $runAllTests; | private $runAllTests; | ||||
private $configurationManager; | private $configurationManager; | ||||
private $options = array(); | |||||
protected $renderer; | protected $renderer; | ||||
final public function __construct() {} | final public function __construct() {} | ||||
public function getEngineConfigurationName() { | public function getEngineConfigurationName() { | ||||
return null; | return null; | ||||
} | } | ||||
/** | |||||
* Modify the return value of this function to accept configuration values | |||||
* from `.arcunit`. Must be in the form used by `PhutilTypeSpec`. | |||||
*/ | |||||
public function getEngineOptions() { | |||||
return array(); | |||||
} | |||||
final protected function getOption($key, $default = null) { | |||||
return idx($this->options, $key, $default); | |||||
} | |||||
final protected function setOption($key, $value) { | |||||
$this->options[$key] = $value; | |||||
return $this; | |||||
} | |||||
final 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')); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |