| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 def identical_output_files(output_files): | 249 def identical_output_files(output_files): |
| 250 reference_files = [os.path.join(REFERENCE_DIRECTORY, | 250 reference_files = [os.path.join(REFERENCE_DIRECTORY, |
| 251 os.path.relpath(path, output_directory)) | 251 os.path.relpath(path, output_directory)) |
| 252 for path in output_files] | 252 for path in output_files] |
| 253 return all([identical_file(reference_filename, output_filename) | 253 return all([identical_file(reference_filename, output_filename) |
| 254 for (reference_filename, output_filename) in zip(reference_f
iles, output_files)]) | 254 for (reference_filename, output_filename) in zip(reference_f
iles, output_files)]) |
| 255 | 255 |
| 256 def no_excess_files(output_files): | 256 def no_excess_files(output_files): |
| 257 generated_files = set([os.path.relpath(path, output_directory) | 257 generated_files = set([os.path.relpath(path, output_directory) |
| 258 for path in output_files]) | 258 for path in output_files]) |
| 259 # Add subversion working copy directories in core and modules. | |
| 260 for component in COMPONENT_DIRECTORY: | |
| 261 generated_files.add(os.path.join(component, '.svn')) | |
| 262 | |
| 263 excess_files = [] | 259 excess_files = [] |
| 264 for path in list_files(REFERENCE_DIRECTORY): | 260 for path in list_files(REFERENCE_DIRECTORY): |
| 265 relpath = os.path.relpath(path, REFERENCE_DIRECTORY) | 261 relpath = os.path.relpath(path, REFERENCE_DIRECTORY) |
| 266 if relpath not in generated_files: | 262 if relpath not in generated_files: |
| 267 excess_files.append(relpath) | 263 excess_files.append(relpath) |
| 268 if excess_files: | 264 if excess_files: |
| 269 print ('Excess reference files! ' | 265 print ('Excess reference files! ' |
| 270 '(probably cruft from renaming or deleting):\n' + | 266 '(probably cruft from renaming or deleting):\n' + |
| 271 '\n'.join(excess_files)) | 267 '\n'.join(excess_files)) |
| 272 return False | 268 return False |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 | 361 |
| 366 | 362 |
| 367 def run_bindings_tests(reset_results, verbose): | 363 def run_bindings_tests(reset_results, verbose): |
| 368 # Generate output into the reference directory if resetting results, or | 364 # Generate output into the reference directory if resetting results, or |
| 369 # a temp directory if not. | 365 # a temp directory if not. |
| 370 if reset_results: | 366 if reset_results: |
| 371 print 'Resetting results' | 367 print 'Resetting results' |
| 372 return bindings_tests(REFERENCE_DIRECTORY, verbose) | 368 return bindings_tests(REFERENCE_DIRECTORY, verbose) |
| 373 with TemporaryDirectory() as temp_dir: | 369 with TemporaryDirectory() as temp_dir: |
| 374 return bindings_tests(temp_dir, verbose) | 370 return bindings_tests(temp_dir, verbose) |
| OLD | NEW |