Page MenuHomePhorge

ArcanistUnitTestEngine.php
No OneTemporary

ArcanistUnitTestEngine.php

<?php
/**
* Manages unit test execution.
*/
abstract class ArcanistUnitTestEngine {
private $workingCopy;
private $paths;
private $arguments = array();
private $enableAsyncTests;
private $enableCoverage;
private $runAllTests;
protected $renderer;
final public function __construct() {}
final public function setRunAllTests($run_all_tests) {
if (!$this->supportsRunAllTests() && $run_all_tests) {
throw new Exception(
pht(
"Engine '%s' does not support %s.",
get_class($this),
'--everything'));
}
$this->runAllTests = $run_all_tests;
return $this;
}
final public function getRunAllTests() {
return $this->runAllTests;
}
protected function supportsRunAllTests() {
return false;
}
final public function setConfigurationManager(
ArcanistConfigurationManager $configuration_manager) {
$this->configurationManager = $configuration_manager;
return $this;
}
final public function getConfigurationManager() {
return $this->configurationManager;
}
final public function setWorkingCopy(
ArcanistWorkingCopyIdentity $working_copy) {
$this->workingCopy = $working_copy;
return $this;
}
final public function getWorkingCopy() {
return $this->workingCopy;
}
final public function setPaths(array $paths) {
$this->paths = $paths;
return $this;
}
final public function getPaths() {
return $this->paths;
}
final public function setArguments(array $arguments) {
$this->arguments = $arguments;
return $this;
}
final public function getArgument($key, $default = null) {
return idx($this->arguments, $key, $default);
}
final public function setEnableAsyncTests($enable_async_tests) {
$this->enableAsyncTests = $enable_async_tests;
return $this;
}
final public function getEnableAsyncTests() {
return $this->enableAsyncTests;
}
final public function setEnableCoverage($enable_coverage) {
$this->enableCoverage = $enable_coverage;
return $this;
}
final public function getEnableCoverage() {
return $this->enableCoverage;
}
final public function setRenderer(ArcanistUnitRenderer $renderer) {
$this->renderer = $renderer;
return $this;
}
abstract public function run();
/**
* Modify the return value of this function in the child class, if you do
* not need to echo the test results after all the tests have been run. This
* is the case for example when the child class prints the tests results
* while the tests are running.
*/
public function shouldEchoTestResults() {
return true;
}
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Mar 26, 22:25 (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1228631
Default Alt Text
ArcanistUnitTestEngine.php (2 KB)

Event Timeline