|
Lines 23-28
a/Tools/Scripts/webkitpy/bindings/main.py_sec1
|
| 23 |
# |
23 |
# |
| 24 |
|
24 |
|
| 25 |
import fnmatch |
25 |
import fnmatch |
|
|
26 |
import json |
| 26 |
import os |
27 |
import os |
| 27 |
import os.path |
28 |
import os.path |
| 28 |
import shutil |
29 |
import shutil |
|
Lines 35-46
from webkitpy.common.system.executive import ScriptError
a/Tools/Scripts/webkitpy/bindings/main.py_sec2
|
| 35 |
|
36 |
|
| 36 |
class BindingsTests: |
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 |
self.reset_results = reset_results |
40 |
self.reset_results = reset_results |
| 40 |
self.generators = generators |
41 |
self.generators = generators |
| 41 |
self.executive = executive |
42 |
self.executive = executive |
| 42 |
self.verbose = verbose |
43 |
self.verbose = verbose |
| 43 |
self.patterns = patterns |
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 |
def generate_from_idl(self, generator, idl_file, output_directory, supplemental_dependency_file): |
51 |
def generate_from_idl(self, generator, idl_file, output_directory, supplemental_dependency_file): |
| 46 |
cmd = ['perl', '-w', |
52 |
cmd = ['perl', '-w', |
|
Lines 109-119
class BindingsTests:
a/Tools/Scripts/webkitpy/bindings/main.py_sec3
|
| 109 |
except ScriptError, e: |
115 |
except ScriptError, e: |
| 110 |
output = e.output |
116 |
output = e.output |
| 111 |
exit_code = e.exit_code |
117 |
exit_code = e.exit_code |
|
|
118 |
if self.json_file_name: |
| 119 |
self.errors.append("(%s) %s" % (generator, output_file)) |
| 112 |
|
120 |
|
| 113 |
if exit_code or output: |
121 |
if exit_code or output: |
| 114 |
print 'FAIL: (%s) %s' % (generator, output_file) |
122 |
print 'FAIL: (%s) %s' % (generator, output_file) |
| 115 |
print output |
123 |
print output |
| 116 |
changes_found = True |
124 |
changes_found = True |
|
|
125 |
if self.json_file_name: |
| 126 |
self.failures.append("(%s) %s" % (generator, output_file)) |
| 117 |
elif self.verbose: |
127 |
elif self.verbose: |
| 118 |
print 'PASS: (%s) %s' % (generator, output_file) |
128 |
print 'PASS: (%s) %s' % (generator, output_file) |
| 119 |
return changes_found |
129 |
return changes_found |
|
Lines 189-194
class BindingsTests:
a/Tools/Scripts/webkitpy/bindings/main.py_sec4
|
| 189 |
os.remove(window_constructors_file) |
199 |
os.remove(window_constructors_file) |
| 190 |
os.remove(workerglobalscope_constructors_file) |
200 |
os.remove(workerglobalscope_constructors_file) |
| 191 |
os.remove(dedicatedworkerglobalscope_constructors_file) |
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 |
print '' |
212 |
print '' |
| 193 |
if all_tests_passed: |
213 |
if all_tests_passed: |
| 194 |
print 'All tests PASS!' |
214 |
print 'All tests PASS!' |