[benchmark] Fix parsing formatted text

The test number column in the space justified column format emmited by the Benchmark_Driver to stdout  while logging to file is right aligned, so it must handle leading whitespace.
This commit is contained in:
Pavol Vaskovic
2018-08-21 16:58:56 +02:00
parent 0d64386b53
commit 049ffb34b0
2 changed files with 4 additions and 4 deletions

View File

@@ -345,9 +345,9 @@ Totals,269
def test_parse_results_formatted_text(self):
"""Parse format that Benchmark_Driver prints to console"""
log = ("""
# TEST SAMPLES MIN(μs) MAX(μs) MEAN(μs) SD(μs) MEDIAN(μs) MAX_RSS(B)
3 Array2D 20 2060 2188 2099 0 2099 20915200
Totals 281""")
# TEST SAMPLES MIN(μs) MAX(μs) MEAN(μs) SD(μs) MEDIAN(μs) MAX_RSS(B)
3 Array2D 20 2060 2188 2099 0 2099 20915200
Totals 281""")
parser = LogParser()
results = parser.parse_results(log.splitlines()[1:]) # without 1st \n
self.assertTrue(isinstance(results[0], PerformanceTestResult))