OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import os | 6 import os |
7 import sys | 7 import sys |
8 | 8 |
9 | 9 |
10 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, 'telemetry')) | 10 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, 'telemetry')) |
11 | 11 |
12 from telemetry.core import environment | 12 from telemetry.core import environment |
13 from telemetry.core import util | 13 from telemetry.core import util |
14 from telemetry.page import page_measurement_runner | 14 from telemetry.page import page_measurement_runner |
15 from telemetry.util import bootstrap | 15 from telemetry.util import bootstrap |
16 | 16 |
17 | 17 |
18 BASE_DIR = os.path.dirname(os.path.realpath(__file__)) | 18 BASE_DIR = os.path.dirname(os.path.realpath(__file__)) |
19 CROS_BOOSTRAP_DEPS_PATH = os.path.join( | 19 CROS_BOOSTRAP_DEPS_PATH = os.path.join( |
20 util.GetChromiumSrcDir(), 'tools', 'cros', 'bootstrap_deps') | 20 util.GetChromiumSrcDir(), 'tools', 'cros', 'bootstrap_deps') |
21 | 21 |
22 | 22 |
23 def main(): | 23 def main(): |
24 if '--print-bootstrap-deps-cros' in sys.argv: | 24 if '--print-bootstrap-deps-cros' in sys.argv: |
25 print bootstrap.ListAllDepsPaths(CROS_BOOSTRAP_DEPS_PATH) | 25 print bootstrap.ListAllDepsPaths(CROS_BOOSTRAP_DEPS_PATH) |
26 return 0 | 26 return 0 |
27 | 27 |
28 old_benchmark_names = { | 28 runner = page_measurement_runner.PageMeasurementRunner() |
29 } | |
30 | |
31 # There are bots that are hard-coded to run some specific named tests. | |
32 # Convert these to the current naming conventions by overriding them | |
33 # in the runner. | |
34 class MeasurementRunner(page_measurement_runner.PageMeasurementRunner): | |
35 def GetModernizedTestName(self, arg): | |
36 if arg not in old_benchmark_names: | |
37 return arg | |
38 sys.stderr.write( | |
39 'An old name %s was given. Please use %s in the future.\n' % ( | |
40 arg, | |
41 old_benchmark_names.get(arg))) | |
42 return old_benchmark_names[arg] | |
43 | |
44 runner = MeasurementRunner() | |
45 env = environment.Environment([BASE_DIR]) | 29 env = environment.Environment([BASE_DIR]) |
46 return runner.Run(env) | 30 return runner.Run(env) |
47 | 31 |
48 | 32 |
49 if __name__ == '__main__': | 33 if __name__ == '__main__': |
50 sys.exit(main()) | 34 sys.exit(main()) |
OLD | NEW |