Commit 81d37159 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[tools] Add streaming test runner

This adds a simple test runner that prints a line for every test with
the appropriate status prefix: PASS, FAIL, CRASH or TIMEOUT

Change-Id: Ic1ba78667c38cd4392af027bb6cb671b274680b7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2264098Reviewed-by: 's avatarLiviu Rau <liviurau@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68570}
parent a5f902af
......@@ -168,6 +168,7 @@ PROGRESS_INDICATORS = {
'dots': progress.DotsProgressIndicator,
'color': progress.ColorProgressIndicator,
'mono': progress.MonochromeProgressIndicator,
'stream': progress.StreamProgressIndicator,
}
class TestRunnerError(Exception):
......
......@@ -113,6 +113,28 @@ class SimpleProgressIndicator(ProgressIndicator):
print("===")
class StreamProgressIndicator(ProgressIndicator):
def __init__(self):
super(StreamProgressIndicator, self).__init__()
self._requirement = base.DROP_PASS_OUTPUT
def _on_result_for(self, test, result):
if not result.has_unexpected_output:
self.print('PASS', test)
elif result.output.HasCrashed():
self.print("CRASH", test)
elif result.output.HasTimedOut():
self.print("TIMEOUT", test)
else:
if test.is_fail:
self.print("UNEXPECTED PASS", test)
else:
self.print("FAIL", test)
def print(self, prefix, test):
print('%s: %ss' % (prefix, test))
sys.stdout.flush()
class VerboseProgressIndicator(SimpleProgressIndicator):
def __init__(self):
super(VerboseProgressIndicator, self).__init__()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment