v8/tools/unittests/testdata/results_processor.py
Michael Achenbach b593f1a56e [test] Implement results processor for perf runner.
This adds the possibility to specify a python script for post-processing stdout.

This also adds some system tests for testing the new feature.

NOTRY=true

Change-Id: I0383afb3e23513629508feeb639ed2dfce56b54a
Reviewed-on: https://chromium-review.googlesource.com/443449
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43257}
2017-02-16 15:43:19 +00:00

26 lines
618 B
Python

#!/usr/bin/env python
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Fake results processor for testing that just sums some things up.
"""
import fileinput
import re
richards = 0.0
deltablue = 0.0
for line in fileinput.input():
match = re.match(r'^Richards\d: (.*)$', line)
if match:
richards += float(match.group(1))
match = re.match(r'^DeltaBlue\d: (.*)$', line)
if match:
deltablue += float(match.group(1))
print 'Richards: %f' % richards
print 'DeltaBlue: %f' % deltablue