| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 self.dir_paths.append(dir_path) | 90 self.dir_paths.append(dir_path) |
| 91 return dir_path | 91 return dir_path |
| 92 | 92 |
| 93 | 93 |
| 94 class BindingsTests(object): | 94 class BindingsTests(object): |
| 95 def __init__(self, reset_results, verbose, provider): | 95 def __init__(self, reset_results, verbose, provider): |
| 96 self.reset_results = reset_results | 96 self.reset_results = reset_results |
| 97 self.verbose = verbose | 97 self.verbose = verbose |
| 98 self.executive = executive.Executive() | 98 self.executive = executive.Executive() |
| 99 self.provider = provider | 99 self.provider = provider |
| 100 _, self.interface_dependencies_filename = provider.new_temp_file() | |
| 101 _, self.interfaces_info_filename = provider.new_temp_file() | 100 _, self.interfaces_info_filename = provider.new_temp_file() |
| 102 # Generate output into the reference directory if resetting results, or | 101 # Generate output into the reference directory if resetting results, or |
| 103 # a temp directory if not. | 102 # a temp directory if not. |
| 104 if reset_results: | 103 if reset_results: |
| 105 self.output_directory = reference_directory | 104 self.output_directory = reference_directory |
| 106 else: | 105 else: |
| 107 self.output_directory = provider.new_temp_dir() | 106 self.output_directory = provider.new_temp_dir() |
| 108 self.event_names_filename = os.path.join(self.output_directory, 'EventIn
terfaces.in') | 107 self.event_names_filename = os.path.join(self.output_directory, 'EventIn
terfaces.in') |
| 109 | 108 |
| 110 def run_command(self, cmd): | 109 def run_command(self, cmd): |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 list_contents = ''.join(idl_path + '\n' | 144 list_contents = ''.join(idl_path + '\n' |
| 146 for idl_path in idl_paths) | 145 for idl_path in idl_paths) |
| 147 os.write(list_file, list_contents) | 146 os.write(list_file, list_contents) |
| 148 return list_filename | 147 return list_filename |
| 149 | 148 |
| 150 def compute_interfaces_info(idl_files_list_filename, | 149 def compute_interfaces_info(idl_files_list_filename, |
| 151 event_names_filename): | 150 event_names_filename): |
| 152 cmd = ['python', | 151 cmd = ['python', |
| 153 'bindings/scripts/compute_interfaces_info.py', | 152 'bindings/scripts/compute_interfaces_info.py', |
| 154 '--idl-files-list', idl_files_list_filename, | 153 '--idl-files-list', idl_files_list_filename, |
| 155 '--interface-dependencies-file', self.interface_dependencies_
filename, | |
| 156 '--interfaces-info-file', self.interfaces_info_filename, | 154 '--interfaces-info-file', self.interfaces_info_filename, |
| 157 '--event-names-file', event_names_filename, | 155 '--event-names-file', event_names_filename, |
| 158 '--write-file-only-if-changed', '0'] | 156 '--write-file-only-if-changed', '0'] |
| 159 self.run_command(cmd) | 157 self.run_command(cmd) |
| 160 | 158 |
| 161 test_idl_files_list_filename = write_list_file(idl_paths(test_input_dire
ctory)) | 159 test_idl_files_list_filename = write_list_file(idl_paths(test_input_dire
ctory)) |
| 162 all_idl_files_list_filename = write_list_file(idl_paths_recursive(all_in
put_directory)) | 160 all_idl_files_list_filename = write_list_file(idl_paths_recursive(all_in
put_directory)) |
| 163 | 161 |
| 164 if self.reset_results and self.verbose: | 162 if self.reset_results and self.verbose: |
| 165 print 'Reset results: EventInterfaces.in' | 163 print 'Reset results: EventInterfaces.in' |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 print PASS_MESSAGE | 268 print PASS_MESSAGE |
| 271 return 0 | 269 return 0 |
| 272 print | 270 print |
| 273 print FAIL_MESSAGE | 271 print FAIL_MESSAGE |
| 274 return -1 | 272 return -1 |
| 275 | 273 |
| 276 | 274 |
| 277 def run_bindings_tests(reset_results, verbose): | 275 def run_bindings_tests(reset_results, verbose): |
| 278 with ScopedTempFileProvider() as provider: | 276 with ScopedTempFileProvider() as provider: |
| 279 return BindingsTests(reset_results, verbose, provider).main() | 277 return BindingsTests(reset_results, verbose, provider).main() |
| OLD | NEW |