Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15448855
D14037.id33936.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D14037.id33936.diff
View Options
diff --git a/src/unit/engine/ArcanistConfigurationDrivenUnitTestEngine.php b/src/unit/engine/ArcanistConfigurationDrivenUnitTestEngine.php
--- a/src/unit/engine/ArcanistConfigurationDrivenUnitTestEngine.php
+++ b/src/unit/engine/ArcanistConfigurationDrivenUnitTestEngine.php
@@ -115,6 +115,9 @@
}
public function run() {
+ $renderer = $this->renderer;
+ $this->setRenderer(null);
+
$paths = $this->getPaths();
// If we are running with `--everything` then `$paths` will be `null`.
@@ -129,7 +132,8 @@
foreach ($engines as $engine) {
$engine
->setWorkingCopy($this->getWorkingCopy())
- ->setEnableCoverage($this->getEnableCoverage());
+ ->setEnableCoverage($this->getEnableCoverage())
+ ->setRenderer($renderer);
// TODO: At some point, maybe we should emit a warning here if an engine
// doesn't support `--everything`, to reduce surprise when `--everything`
@@ -141,6 +145,12 @@
try {
// TODO: Type check the results.
$results[] = $engine->run();
+
+ foreach (last($results) as $result) {
+ if ($engine->shouldEchoTestResults()) {
+ echo $renderer->renderUnitResult($result);
+ }
+ }
} catch (ArcanistNoEffectException $ex) {
$exceptions[] = $ex;
}
@@ -155,6 +165,10 @@
return array_mergev($results);
}
+ public function shouldEchoTestResults() {
+ return false;
+ }
+
private function loadAvailableTestEngines() {
return id(new PhutilClassMapQuery())
->setAncestorClass('ArcanistUnitTestEngine')
diff --git a/src/unit/engine/ArcanistUnitTestEngine.php b/src/unit/engine/ArcanistUnitTestEngine.php
--- a/src/unit/engine/ArcanistUnitTestEngine.php
+++ b/src/unit/engine/ArcanistUnitTestEngine.php
@@ -98,7 +98,7 @@
return $this->enableCoverage;
}
- final public function setRenderer(ArcanistUnitRenderer $renderer) {
+ final public function setRenderer(ArcanistUnitRenderer $renderer = null) {
$this->renderer = $renderer;
return $this;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 29, 7:12 AM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7224601
Default Alt Text
D14037.id33936.diff (2 KB)
Attached To
Mode
D14037: Allow unit test engines to render their own results
Attached
Detach File
Event Timeline
Log In to Comment