| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 # chain and inherited extended attributes), and some real interfaces | 102 # chain and inherited extended attributes), and some real interfaces |
| 103 # are special-cased, such as Node. | 103 # are special-cased, such as Node. |
| 104 # | 104 # |
| 105 # For example, when testing the behavior of interfaces that inherit | 105 # For example, when testing the behavior of interfaces that inherit |
| 106 # from Node, we also need to know that these inherit from EventTarget, | 106 # from Node, we also need to know that these inherit from EventTarget, |
| 107 # since this is also special-cased and Node inherits from EventTarget, | 107 # since this is also special-cased and Node inherits from EventTarget, |
| 108 # but this inheritance information requires computing dependencies for | 108 # but this inheritance information requires computing dependencies for |
| 109 # the real Node.idl file. | 109 # the real Node.idl file. |
| 110 | 110 |
| 111 # 2-stage computation: individual, then overall | 111 # 2-stage computation: individual, then overall |
| 112 # |
| 113 # Properly should compute separately by component (currently test |
| 114 # includes are invalid), but that's brittle (would need to update this file |
| 115 # for each new component) and doesn't test the code generator any better |
| 116 # than using a single component. |
| 112 for idl_filename in idl_paths_recursive(source_path): | 117 for idl_filename in idl_paths_recursive(source_path): |
| 113 compute_info_individual(idl_filename) | 118 compute_info_individual(idl_filename, 'tests') |
| 114 info_individuals = [info_individual()] | 119 info_individuals = [info_individual()] |
| 115 compute_interfaces_info_overall(info_individuals) | 120 compute_interfaces_info_overall(info_individuals) |
| 116 | 121 |
| 117 | 122 |
| 118 def bindings_tests(output_directory, verbose): | 123 def bindings_tests(output_directory, verbose): |
| 119 executive = Executive() | 124 executive = Executive() |
| 120 | 125 |
| 121 def diff(filename1, filename2): | 126 def diff(filename1, filename2): |
| 122 # Python's difflib module is too slow, especially on long output, so | 127 # Python's difflib module is too slow, especially on long output, so |
| 123 # run external diff(1) command | 128 # run external diff(1) command |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 223 |
| 219 | 224 |
| 220 def run_bindings_tests(reset_results, verbose): | 225 def run_bindings_tests(reset_results, verbose): |
| 221 # Generate output into the reference directory if resetting results, or | 226 # Generate output into the reference directory if resetting results, or |
| 222 # a temp directory if not. | 227 # a temp directory if not. |
| 223 if reset_results: | 228 if reset_results: |
| 224 print 'Resetting results' | 229 print 'Resetting results' |
| 225 return bindings_tests(reference_directory, verbose) | 230 return bindings_tests(reference_directory, verbose) |
| 226 with TemporaryDirectory() as temp_dir: | 231 with TemporaryDirectory() as temp_dir: |
| 227 return bindings_tests(temp_dir, verbose) | 232 return bindings_tests(temp_dir, verbose) |
| OLD | NEW |