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

Unified Diff: tools/perf/generate_perf_json.py

Issue 2519803002: Make generate_perf_json.py work regardless of starting working directory (Closed)
Patch Set: Simplify Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/generate_perf_json.py
diff --git a/tools/perf/generate_perf_json.py b/tools/perf/generate_perf_json.py
index 23cf59a2a2cd9c44cf7869c9ada0b7c66f52a548..3f1e6e847d47094b4927e0625fb2c1e56d3830ce 100755
--- a/tools/perf/generate_perf_json.py
+++ b/tools/perf/generate_perf_json.py
@@ -527,8 +527,7 @@ BENCHMARK_NAME_BLACKLIST = [
def current_benchmarks(use_whitelist):
- current_dir = os.path.dirname(__file__)
- benchmarks_dir = os.path.join(current_dir, 'benchmarks')
+ benchmarks_dir = os.path.join(os.getcwd(), 'benchmarks')
top_level_dir = os.path.dirname(benchmarks_dir)
all_benchmarks = discover.DiscoverClasses(
@@ -649,15 +648,19 @@ def generate_all_tests(waterfall):
tests['AAAAA2 See //tools/perf/generate_perf_json.py to make changes'] = {}
filename = '%s.json' % waterfall['name']
- current_dir = os.path.dirname(os.path.abspath(__file__))
- src_dir = os.path.dirname(os.path.dirname(current_dir))
+ src_dir = os.path.dirname(os.path.dirname(os.getcwd()))
with open(os.path.join(src_dir, 'testing', 'buildbot', filename), 'w') as fp:
json.dump(tests, fp, indent=2, separators=(',', ': '), sort_keys=True)
fp.write('\n')
+def chdir_to_parent_directory():
+ parent_directory = os.path.dirname(os.path.abspath(__file__))
+ os.chdir(parent_directory)
def main():
+ chdir_to_parent_directory()
+
waterfall = get_waterfall_config()
waterfall['name'] = 'chromium.perf'
fyi_waterfall = get_fyi_waterfall_config()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698