| OLD | NEW |
| (Empty) | |
| 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 """Run the Skia benchmarking executable.""" |
| 7 |
| 8 import os |
| 9 import sys |
| 10 |
| 11 from build_step import BuildStep |
| 12 from utils import gclient_utils |
| 13 |
| 14 class RunNanobench(BuildStep): |
| 15 """A BuildStep that runs nanobench.""" |
| 16 |
| 17 def __init__(self, timeout=9600, no_output_timeout=9600, **kwargs): |
| 18 super(RunNanobench, self).__init__(timeout=timeout, |
| 19 no_output_timeout=no_output_timeout, |
| 20 **kwargs) |
| 21 |
| 22 def _JSONPath(self): |
| 23 git_timestamp = gclient_utils.GetGitRepoPOSIXTimestamp() |
| 24 return os.path.join( |
| 25 self._device_dirs.PerfDir(), |
| 26 'nanobench_%s_%s.json' % ( self._got_revision, git_timestamp)) |
| 27 |
| 28 def _Run(self): |
| 29 args = ['-i', self._device_dirs.ResourceDir()] |
| 30 if self._perf_data_dir: |
| 31 args.extend(['--outResultsFile', self._JSONPath()]) |
| 32 self._flavor_utils.RunFlavoredCmd('nanobench', args) |
| 33 |
| 34 |
| 35 if '__main__' == __name__: |
| 36 sys.exit(BuildStep.RunBuildStep(RunNanobench)) |
| OLD | NEW |