OLD | NEW |
---|---|
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 import imp | 4 import imp |
5 import inspect | 5 import inspect |
6 import os | 6 import os |
7 import sys | 7 import sys |
8 | 8 |
9 from core import path_util | 9 from core import path_util |
10 from core import perf_benchmark | 10 from core import perf_benchmark |
(...skipping 27 matching lines...) Expand all Loading... | |
38 if (inspect.isclass(obj) and issubclass(obj, perf_benchmark.PerfBenchmark) | 38 if (inspect.isclass(obj) and issubclass(obj, perf_benchmark.PerfBenchmark) |
39 and GetClassFilePath(obj) == benchmark_file_dir): | 39 and GetClassFilePath(obj) == benchmark_file_dir): |
40 benchmark_names.append(obj.Name()) | 40 benchmark_names.append(obj.Name()) |
41 return sorted(benchmark_names) | 41 return sorted(benchmark_names) |
42 finally: | 42 finally: |
43 sys.path = original_sys_path | 43 sys.path = original_sys_path |
44 | 44 |
45 | 45 |
46 def GetAllPerfBenchmarks(): | 46 def GetAllPerfBenchmarks(): |
47 benchmarks_dir = path_util.GetPerfBenchmarksDir() | 47 benchmarks_dir = path_util.GetPerfBenchmarksDir() |
48 top_level_dir = os.path.join(benchmarks_dir, '..') | 48 top_level_dir = os.path.join(path_util.GetPerfDir()) |
shatch
2017/04/26 14:37:30
nit: is this join necessary now
nednguyen
2017/04/26 14:42:51
Oh right, silly me :P
| |
49 return discover.DiscoverClasses( | 49 return discover.DiscoverClasses( |
50 benchmarks_dir, top_level_dir, benchmark_module.Benchmark, | 50 benchmarks_dir, top_level_dir, benchmark_module.Benchmark, |
51 index_by_class_name=True).values() | 51 index_by_class_name=True).values() |
52 | |
53 | |
54 def GetAllContribBenchmarks(): | |
55 benchmarks_dir = path_util.GetPerfContribDir() | |
56 top_level_dir = os.path.join(path_util.GetPerfDir()) | |
57 return discover.DiscoverClasses( | |
58 benchmarks_dir, top_level_dir, benchmark_module.Benchmark, | |
59 index_by_class_name=True).values() | |
OLD | NEW |