| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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:])) |
| OLD | NEW |