Summary:
We changed our Facebook implementation to echo test results while the
tests are running. We do not want to echo the test results twice.
Test Plan:
Tested that implementing the function in PhutilUnitTestEngine and
returning true showed the results and returning false didn't show the
results.
Reviewed By: epriestley
Reviewers: jungejason, epriestley, grglr, slawekbiel
Commenters: slawekbiel, aran
CC: sgrimm, slawekbiel, aran, tuomaspelkonen, epriestley
Differential Revision: 400
public function setDifferentialDiffID($id) {
$this->diffID = $id;
}
+
+ /**
+ * 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;
+ }
}
if ($result_code == ArcanistUnitTestResult::RESULT_POSTPONED) {
$postponed_count++;
} else {
- echo ' '.$status_codes[$result_code].' '.$result->getName()."\n";
+ if ($this->engine->shouldEchoTestResults()) {
+ echo ' '.$status_codes[$result_code].' '.$result->getName()."\n";
+ }
if ($result_code != ArcanistUnitTestResult::RESULT_PASS) {
- echo $result->getUserData()."\n";
+ if ($this->engine->shouldEchoTestResults()) {
+ echo $result->getUserData()."\n";
+ }
$unresolved[] = $result;
}
}