| 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. |
| 11 # | 11 # |
| 12 # THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 12 # THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
| 13 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 13 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 14 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 14 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 15 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 15 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 16 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 16 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 17 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 17 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 18 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 18 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 19 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 19 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 20 # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 20 # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 21 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 21 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 22 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 # | 23 # |
| 24 | 24 |
| 25 from contextlib import contextmanager | 25 from contextlib import contextmanager |
| 26 import filecmp | 26 import filecmp |
| 27 import fnmatch | 27 import fnmatch |
| 28 import os | 28 import os |
| 29 import re | |
| 30 import shutil | 29 import shutil |
| 31 import sys | 30 import sys |
| 32 import tempfile | 31 import tempfile |
| 33 | 32 |
| 34 from webkitpy.common.system.executive import Executive | 33 from webkitpy.common.system.executive import Executive |
| 35 | 34 |
| 36 # Source/ path is needed both to find input IDL files, and to import other | 35 # Source/ path is needed both to find input IDL files, and to import other |
| 37 # Python modules. | 36 # Python modules. |
| 38 module_path = os.path.dirname(__file__) | 37 module_path = os.path.dirname(__file__) |
| 39 source_path = os.path.normpath(os.path.join(module_path, os.pardir, os.pardir, | 38 source_path = os.path.normpath(os.path.join(module_path, os.pardir, os.pardir, |
| 40 os.pardir, os.pardir, 'Source')) | 39 os.pardir, os.pardir, 'Source')) |
| 41 sys.path.append(source_path) # for Source/bindings imports | 40 sys.path.append(source_path) # for Source/bindings imports |
| 42 | 41 |
| 43 from bindings.scripts.code_generator_v8 import CodeGeneratorUnionType | 42 from bindings.scripts.code_generator_v8 import CodeGeneratorUnionType |
| 44 import bindings.scripts.compute_interfaces_info_individual | 43 import bindings.scripts.compute_interfaces_info_individual |
| 45 from bindings.scripts.compute_interfaces_info_individual import InterfaceInfoCol
lector | 44 from bindings.scripts.compute_interfaces_info_individual import InterfaceInfoCol
lector |
| 46 import bindings.scripts.compute_interfaces_info_overall | 45 import bindings.scripts.compute_interfaces_info_overall |
| 47 from bindings.scripts.compute_interfaces_info_overall import compute_interfaces_
info_overall, interfaces_info | 46 from bindings.scripts.compute_interfaces_info_overall import compute_interfaces_
info_overall, interfaces_info |
| 48 from bindings.scripts.idl_compiler import IdlCompilerDictionaryImpl, IdlCompiler
V8 | 47 from bindings.scripts.idl_compiler import IdlCompilerDictionaryImpl, IdlCompiler
V8 |
| 49 from bindings.scripts.idl_reader import IdlReader | 48 from bindings.scripts.idl_reader import IdlReader |
| 50 from bindings.scripts.utilities import ComponentInfoProviderCore, ComponentInfoP
roviderModules, idl_filename_to_component, write_file | 49 from bindings.scripts.utilities import ComponentInfoProviderCore |
| 50 from bindings.scripts.utilities import ComponentInfoProviderModules |
| 51 from bindings.scripts.utilities import idl_filename_to_component |
| 52 from bindings.scripts.utilities import write_file |
| 51 | 53 |
| 52 | 54 |
| 53 PASS_MESSAGE = 'All tests PASS!' | 55 PASS_MESSAGE = 'All tests PASS!' |
| 54 FAIL_MESSAGE = """Some tests FAIL! | 56 FAIL_MESSAGE = """Some tests FAIL! |
| 55 To update the reference files, execute: | 57 To update the reference files, execute: |
| 56 run-bindings-tests --reset-results | 58 run-bindings-tests --reset-results |
| 57 | 59 |
| 58 If the failures are not due to your changes, test results may be out of sync; | 60 If the failures are not due to your changes, test results may be out of sync; |
| 59 please rebaseline them in a separate CL, after checking that tests fail in ToT. | 61 please rebaseline them in a separate CL, after checking that tests fail in ToT. |
| 60 In CL, please set: | 62 In CL, please set: |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 | 348 |
| 347 | 349 |
| 348 def run_bindings_tests(reset_results, verbose): | 350 def run_bindings_tests(reset_results, verbose): |
| 349 # Generate output into the reference directory if resetting results, or | 351 # Generate output into the reference directory if resetting results, or |
| 350 # a temp directory if not. | 352 # a temp directory if not. |
| 351 if reset_results: | 353 if reset_results: |
| 352 print 'Resetting results' | 354 print 'Resetting results' |
| 353 return bindings_tests(reference_directory, verbose) | 355 return bindings_tests(reference_directory, verbose) |
| 354 with TemporaryDirectory() as temp_dir: | 356 with TemporaryDirectory() as temp_dir: |
| 355 return bindings_tests(temp_dir, verbose) | 357 return bindings_tests(temp_dir, verbose) |
| OLD | NEW |