1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42:41 +01:00

Allow Phutil tests setting link

Summary: Also delete some copy pasta.

Test Plan: Next diff.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3455
This commit is contained in:
vrana 2012-09-07 14:18:55 -07:00
parent af31ee4ed0
commit cdb161a19a

View file

@ -349,15 +349,7 @@ abstract class ArcanistPhutilTestCase {
* @task internal
*/
final private function failTest($reason) {
$coverage = $this->endCoverage();
$result = new ArcanistUnitTestResult();
$result->setCoverage($coverage);
$result->setName($this->runningTest);
$result->setResult(ArcanistUnitTestResult::RESULT_FAIL);
$result->setDuration(microtime(true) - $this->testStartTime);
$result->setUserData($reason);
$this->results[] = $result;
$this->resultTest(ArcanistUnitTestResult::RESULT_FAIL, $reason);
}
@ -370,15 +362,7 @@ abstract class ArcanistPhutilTestCase {
* @task internal
*/
final private function passTest($reason) {
$coverage = $this->endCoverage();
$result = new ArcanistUnitTestResult();
$result->setCoverage($coverage);
$result->setName($this->runningTest);
$result->setResult(ArcanistUnitTestResult::RESULT_PASS);
$result->setDuration(microtime(true) - $this->testStartTime);
$result->setUserData($reason);
$this->results[] = $result;
$this->resultTest(ArcanistUnitTestResult::RESULT_PASS, $reason);
}
@ -390,12 +374,18 @@ abstract class ArcanistPhutilTestCase {
* @task internal
*/
final private function skipTest($reason) {
$this->resultTest(ArcanistUnitTestResult::RESULT_SKIP, $reason);
}
final private function resultTest($test_result, $reason) {
$coverage = $this->endCoverage();
$result = new ArcanistUnitTestResult();
$result->setCoverage($coverage);
$result->setName($this->runningTest);
$result->setResult(ArcanistUnitTestResult::RESULT_SKIP);
$result->setLink($this->getLink($this->runningTest));
$result->setResult($test_result);
$result->setDuration(microtime(true) - $this->testStartTime);
$result->setUserData($reason);
$this->results[] = $result;
@ -542,4 +532,8 @@ abstract class ArcanistPhutilTestCase {
return $this;
}
protected function getLink($method) {
return null;
}
}