From 1753aa918824401785ffa55ad328d2690ee25107 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Fri, 30 Nov 2018 12:44:30 +0100 Subject: [PATCH 1/2] build: fix line length off by one error While running the test suite the progress bar shows former line endings if the new line is shorter than the former line. The length was calculated without the line ending. It is now an empty string to prevent the off by one error instead of using extra whitespace. --- tools/test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/test.py b/tools/test.py index 640206f95cb420..2366d490e248eb 100755 --- a/tools/test.py +++ b/tools/test.py @@ -423,7 +423,7 @@ def PrintProgress(self, name): } status = self.Truncate(status, 78) self.last_status_length = len(status) - print(status, end=' ') + print(status, end='') sys.stdout.flush() @@ -438,7 +438,7 @@ def __init__(self, cases, flaky_tests_mode): super(ColorProgressIndicator, self).__init__(cases, flaky_tests_mode, templates) def ClearLine(self, last_line_length): - print("\033[1K\r", end=' ') + print("\033[1K\r", end='') class MonochromeProgressIndicator(CompactProgressIndicator): @@ -454,7 +454,7 @@ def __init__(self, cases, flaky_tests_mode): super(MonochromeProgressIndicator, self).__init__(cases, flaky_tests_mode, templates) def ClearLine(self, last_line_length): - print(("\r" + (" " * last_line_length) + "\r"), end=' ') + print(("\r" + (" " * last_line_length) + "\r"), end='') PROGRESS_INDICATORS = { From 0b56ab09e54e9b926fef49e9c97a7b0bba48e4b0 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Fri, 30 Nov 2018 16:19:33 +0100 Subject: [PATCH 2/2] build: add line break as soon as the tests are done --- tools/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test.py b/tools/test.py index 2366d490e248eb..46235ab05aec92 100755 --- a/tools/test.py +++ b/tools/test.py @@ -383,7 +383,7 @@ def Starting(self): pass def Done(self): - self.PrintProgress('Done') + self.PrintProgress('Done\n') def AboutToRun(self, case): self.PrintProgress(case.GetLabel())