Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Side by Side Diff: tools/perf/core/benchmark_finders.py

Issue 2840213003: Move blink_perf.xml_http_request benchmark to tools/perf/contrib/ directory (Closed)
Patch Set: Simplify benchmark_finders code Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 26 matching lines...) Expand all
37 for _, obj in inspect.getmembers(module): 37 for _, obj in inspect.getmembers(module):
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()
48 top_level_dir = os.path.join(benchmarks_dir, '..')
49 return discover.DiscoverClasses( 47 return discover.DiscoverClasses(
50 benchmarks_dir, top_level_dir, benchmark_module.Benchmark, 48 start_dir=path_util.GetPerfBenchmarksDir(),
49 top_level_dir=path_util.GetPerfDir(),
50 base_class=benchmark_module.Benchmark,
51 index_by_class_name=True).values() 51 index_by_class_name=True).values()
52
53
54 def GetAllContribBenchmarks():
55 return discover.DiscoverClasses(
56 start_dir=path_util.GetPerfContribDir(),
57 top_level_dir=path_util.GetPerfDir(),
58 base_class=benchmark_module.Benchmark,
59 index_by_class_name=True).values()
OLDNEW
« no previous file with comments | « tools/perf/contrib/blink_perf_xml_http_request/blink_perf_xml_http_request.py ('k') | tools/perf/core/path_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698