OLD | NEW |
1 # Copyright (C) 2011 Google Inc. All rights reserved. | 1 # Copyright (C) 2011 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions | 4 # modification, are permitted provided that the following conditions |
5 # are met: | 5 # are met: |
6 # 1. Redistributions of source code must retain the above copyright | 6 # 1. Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # 2. Redistributions in binary form must reproduce the above copyright | 8 # 2. Redistributions in binary form must reproduce the above copyright |
9 # notice, this list of conditions and the following disclaimer in the | 9 # notice, this list of conditions and the following disclaimer in the |
10 # documentation and/or other materials provided with the distribution. | 10 # documentation and/or other materials provided with the distribution. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 exit_code = 0 | 53 exit_code = 0 |
54 try: | 54 try: |
55 output = self.executive.run_command(cmd) | 55 output = self.executive.run_command(cmd) |
56 if output: | 56 if output: |
57 print output | 57 print output |
58 except ScriptError, e: | 58 except ScriptError, e: |
59 print e.output | 59 print e.output |
60 exit_code = e.exit_code | 60 exit_code = e.exit_code |
61 return exit_code | 61 return exit_code |
62 | 62 |
63 def generate_supplemental_dependency(self, input_directory, supplemental_dep
endency_file): | 63 def generate_supplemental_dependency(self, input_directory, supplemental_dep
endency_file, window_constructors_file): |
64 idl_files_list = tempfile.mkstemp() | 64 idl_files_list = tempfile.mkstemp() |
65 for input_file in os.listdir(input_directory): | 65 for input_file in os.listdir(input_directory): |
66 (name, extension) = os.path.splitext(input_file) | 66 (name, extension) = os.path.splitext(input_file) |
67 if extension != '.idl': | 67 if extension != '.idl': |
68 continue | 68 continue |
69 os.write(idl_files_list[0], os.path.join(input_directory, input_file
) + "\n") | 69 os.write(idl_files_list[0], os.path.join(input_directory, input_file
) + "\n") |
70 os.close(idl_files_list[0]) | 70 os.close(idl_files_list[0]) |
71 | 71 |
72 cmd = ['perl', '-w', | 72 cmd = ['perl', '-w', |
73 '-Ibindings/scripts', | 73 '-Ibindings/scripts', |
74 'bindings/scripts/preprocess-idls.pl', | 74 'bindings/scripts/preprocess-idls.pl', |
75 '--idlFilesList', idl_files_list[1], | 75 '--idlFilesList', idl_files_list[1], |
76 '--supplementalDependencyFile', supplemental_dependency_file] | 76 '--supplementalDependencyFile', supplemental_dependency_file, |
| 77 '--windowConstructorsFile', window_constructors_file] |
77 | 78 |
78 exit_code = 0 | 79 exit_code = 0 |
79 try: | 80 try: |
80 output = self.executive.run_command(cmd) | 81 output = self.executive.run_command(cmd) |
81 if output: | 82 if output: |
82 print output | 83 print output |
83 except ScriptError, e: | 84 except ScriptError, e: |
84 print e.output | 85 print e.output |
85 exit_code = e.exit_code | 86 exit_code = e.exit_code |
86 os.remove(idl_files_list[1]) | 87 os.remove(idl_files_list[1]) |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 return passed | 141 return passed |
141 | 142 |
142 def main(self): | 143 def main(self): |
143 current_scm = detect_scm_system(os.curdir) | 144 current_scm = detect_scm_system(os.curdir) |
144 os.chdir(os.path.join(current_scm.checkout_root, 'Source')) | 145 os.chdir(os.path.join(current_scm.checkout_root, 'Source')) |
145 | 146 |
146 all_tests_passed = True | 147 all_tests_passed = True |
147 | 148 |
148 input_directory = os.path.join('bindings', 'tests', 'idls') | 149 input_directory = os.path.join('bindings', 'tests', 'idls') |
149 supplemental_dependency_file = tempfile.mkstemp()[1] | 150 supplemental_dependency_file = tempfile.mkstemp()[1] |
150 if self.generate_supplemental_dependency(input_directory, supplemental_d
ependency_file): | 151 window_constructors_file = tempfile.mkstemp()[1] |
| 152 if self.generate_supplemental_dependency(input_directory, supplemental_d
ependency_file, window_constructors_file): |
151 print 'Failed to generate a supplemental dependency file.' | 153 print 'Failed to generate a supplemental dependency file.' |
152 os.remove(supplemental_dependency_file) | 154 os.remove(supplemental_dependency_file) |
153 return -1 | 155 return -1 |
154 | 156 |
155 input_directory = os.path.join('bindings', 'tests', 'idls') | 157 input_directory = os.path.join('bindings', 'tests', 'idls') |
156 reference_directory = os.path.join('bindings', 'tests', 'results') | 158 reference_directory = os.path.join('bindings', 'tests', 'results') |
157 if not self.run_tests(input_directory, reference_directory, supplemental
_dependency_file): | 159 if not self.run_tests(input_directory, reference_directory, supplemental
_dependency_file): |
158 all_tests_passed = False | 160 all_tests_passed = False |
159 | 161 |
160 os.remove(supplemental_dependency_file) | 162 os.remove(supplemental_dependency_file) |
161 print '' | 163 print '' |
162 if all_tests_passed: | 164 if all_tests_passed: |
163 print 'All tests PASS!' | 165 print 'All tests PASS!' |
164 return 0 | 166 return 0 |
165 else: | 167 else: |
166 print 'Some tests FAIL! (To update the reference files, execute "run
-bindings-tests --reset-results")' | 168 print 'Some tests FAIL! (To update the reference files, execute "run
-bindings-tests --reset-results")' |
167 return -1 | 169 return -1 |
OLD | NEW |