Changeset 213097 in webkit
- Timestamp:
- Feb 27, 2017 3:07:25 PM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r213091 r213097 1 2017-02-27 Srinivasan Vijayaraghavan <svijayaraghavan@apple.com> 2 3 Add machine-readable results for bindings tests 4 https://bugs.webkit.org/show_bug.cgi?id=168626 5 6 Reviewed by Alexey Proskuryakov. 7 8 * Scripts/run-bindings-tests: 9 (main): Add optional --json-output command-line parameter. 10 * Scripts/webkitpy/bindings/main.py: 11 (BindingsTests.__init__): Add variables to store machine-readable results. 12 (BindingsTests.detect_changes): Store results in machine-readable form if applicable. 13 (BindingsTests.main): Write data to JSON file if applicable. 14 1 15 2017-02-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 16 -
trunk/Tools/Scripts/run-bindings-tests
r210676 r213097 30 30 31 31 import optparse 32 import os 32 33 import sys 33 34 from webkitpy.common.system import executive … … 44 45 option_parser.add_option('--reset-results', action='store_true', default=False, 45 46 help='Overwrites the reference files with the generated results') 47 option_parser.add_option('--json-output', action='store', type='string', dest='json_file_name', 48 help='Create a file at specified path, listing test results in JSON format.') 46 49 options, args = option_parser.parse_args() 47 50 48 51 from webkitpy.bindings.main import BindingsTests 49 52 50 return BindingsTests(options.reset_results, [ 'JS' ], executive.Executive(), not options.no_verbose, args).main() 53 if options.json_file_name: 54 options.json_file_name = os.path.abspath(options.json_file_name) 55 56 return BindingsTests(options.reset_results, [ 'JS' ], executive.Executive(), not options.no_verbose, args, options.json_file_name).main() 51 57 52 58 -
trunk/Tools/Scripts/webkitpy/bindings/main.py
r210676 r213097 24 24 25 25 import fnmatch 26 import json 26 27 import os 27 28 import os.path … … 36 37 class BindingsTests: 37 38 38 def __init__(self, reset_results, generators, executive, verbose, patterns ):39 def __init__(self, reset_results, generators, executive, verbose, patterns, json_file_name): 39 40 self.reset_results = reset_results 40 41 self.generators = generators … … 42 43 self.verbose = verbose 43 44 self.patterns = patterns 45 self.json_file_name = json_file_name 46 47 if self.json_file_name: 48 self.failures = [] 49 self.errors = [] 44 50 45 51 def generate_from_idl(self, generator, idl_file, output_directory, supplemental_dependency_file): … … 110 116 output = e.output 111 117 exit_code = e.exit_code 118 if self.json_file_name: 119 self.errors.append("(%s) %s" % (generator, output_file)) 112 120 113 121 if exit_code or output: … … 115 123 print output 116 124 changes_found = True 125 if self.json_file_name: 126 self.failures.append("(%s) %s" % (generator, output_file)) 117 127 elif self.verbose: 118 128 print 'PASS: (%s) %s' % (generator, output_file) … … 190 200 os.remove(workerglobalscope_constructors_file) 191 201 os.remove(dedicatedworkerglobalscope_constructors_file) 202 203 if self.json_file_name: 204 json_data = { 205 'failures': self.failures, 206 'errors': self.errors, 207 } 208 209 with open(self.json_file_name, 'w') as json_file: 210 json.dump(json_data, json_file) 211 192 212 print '' 193 213 if all_tests_passed:
Note: See TracChangeset
for help on using the changeset viewer.