diff --git a/src/unit/engine/base/ArcanistBaseUnitTestEngine.php b/src/unit/engine/base/ArcanistBaseUnitTestEngine.php index c3dee67d..b6358274 100644 --- a/src/unit/engine/base/ArcanistBaseUnitTestEngine.php +++ b/src/unit/engine/base/ArcanistBaseUnitTestEngine.php @@ -71,4 +71,14 @@ abstract class ArcanistBaseUnitTestEngine { 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; + } } diff --git a/src/workflow/unit/ArcanistUnitWorkflow.php b/src/workflow/unit/ArcanistUnitWorkflow.php index f9716b96..46c6511b 100644 --- a/src/workflow/unit/ArcanistUnitWorkflow.php +++ b/src/workflow/unit/ArcanistUnitWorkflow.php @@ -122,9 +122,13 @@ EOTEXT 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; } }