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

Side by Side Diff: third_party/WebKit/Tools/Scripts/print-json-test-results

Issue 2014063002: Run format-webkit on webkitpy code (without string conversion). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 6 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 #!/usr/bin/python 1 #!/usr/bin/python
2 import json 2 import json
3 import optparse 3 import optparse
4 import os 4 import os
5 import sys 5 import sys
6 6
7 from webkitpy.common.host import Host 7 from webkitpy.common.host import Host
8 from webkitpy.layout_tests.port import platform_options, configuration_options 8 from webkitpy.layout_tests.port import platform_options, configuration_options
9 9
10 10
(...skipping 17 matching lines...) Expand all
28 if args: 28 if args:
29 if args[0] == '-': 29 if args[0] == '-':
30 txt = sys.stdin.read() 30 txt = sys.stdin.read()
31 elif os.path.exists(args[0]): 31 elif os.path.exists(args[0]):
32 with open(args[0], 'r') as fp: 32 with open(args[0], 'r') as fp:
33 txt = fp.read() 33 txt = fp.read()
34 else: 34 else:
35 print >> sys.stderr, "file not found: %s" % args[0] 35 print >> sys.stderr, "file not found: %s" % args[0]
36 sys.exit(1) 36 sys.exit(1)
37 else: 37 else:
38 txt = host.filesystem.read_text_file(host.filesystem.join(host.port_fact ory.get(options=options).results_directory(), 'full_results.json')) 38 txt = host.filesystem.read_text_file(
39 host.filesystem.join(
40 host.port_factory.get(
41 options=options).results_directory(),
42 'full_results.json'))
39 43
40 if txt.startswith('ADD_RESULTS(') and txt.endswith(');'): 44 if txt.startswith('ADD_RESULTS(') and txt.endswith(');'):
41 txt = txt[12:-2] # ignore optional JSONP wrapper 45 txt = txt[12:-2] # ignore optional JSONP wrapper
42 results = json.loads(txt) 46 results = json.loads(txt)
43 47
44 passes, failures, flakes = decode_results(results, options.expected) 48 passes, failures, flakes = decode_results(results, options.expected)
45 49
46 tests_to_print = [] 50 tests_to_print = []
47 if options.passes: 51 if options.passes:
48 tests_to_print += passes.keys() 52 tests_to_print += passes.keys()
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 name = prefix + "/" + name 109 name = prefix + "/" + name
106 110
107 if len(data) and not "actual" in data and not "expected" in data: 111 if len(data) and not "actual" in data and not "expected" in data:
108 result.update(convert_trie_to_flat_paths(data, name)) 112 result.update(convert_trie_to_flat_paths(data, name))
109 else: 113 else:
110 result[name] = data 114 result[name] = data
111 115
112 return result 116 return result
113 117
114 118
115 if __name__ == '__main__': 119 if __name__ == '__main__':
116 sys.exit(main(sys.argv[1:])) 120 sys.exit(main(sys.argv[1:]))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698