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 24 matching lines...) Expand all Loading... |
35 path_finder.add_bindings_scripts_dir_to_sys_path() | 35 path_finder.add_bindings_scripts_dir_to_sys_path() |
36 | 36 |
37 from code_generator_v8 import CodeGeneratorDictionaryImpl | 37 from code_generator_v8 import CodeGeneratorDictionaryImpl |
38 from code_generator_v8 import CodeGeneratorV8 | 38 from code_generator_v8 import CodeGeneratorV8 |
39 from code_generator_v8 import CodeGeneratorUnionType | 39 from code_generator_v8 import CodeGeneratorUnionType |
40 from code_generator_v8 import CodeGeneratorCallbackFunction | 40 from code_generator_v8 import CodeGeneratorCallbackFunction |
41 from code_generator_web_agent_api import CodeGeneratorWebAgentAPI | 41 from code_generator_web_agent_api import CodeGeneratorWebAgentAPI |
42 from compute_interfaces_info_individual import InterfaceInfoCollector | 42 from compute_interfaces_info_individual import InterfaceInfoCollector |
43 from compute_interfaces_info_overall import (compute_interfaces_info_overall, | 43 from compute_interfaces_info_overall import (compute_interfaces_info_overall, |
44 interfaces_info) | 44 interfaces_info) |
| 45 from generate_conditional_features import generate_conditional_features |
45 from idl_compiler import (generate_bindings, | 46 from idl_compiler import (generate_bindings, |
46 generate_union_type_containers, | 47 generate_union_type_containers, |
47 generate_dictionary_impl, | 48 generate_dictionary_impl, |
48 generate_callback_function_impl) | 49 generate_callback_function_impl) |
49 from utilities import ComponentInfoProviderCore | 50 from utilities import ComponentInfoProviderCore |
50 from utilities import ComponentInfoProviderModules | 51 from utilities import ComponentInfoProviderModules |
51 | 52 |
52 | 53 |
53 PASS_MESSAGE = 'All tests PASS!' | 54 PASS_MESSAGE = 'All tests PASS!' |
54 FAIL_MESSAGE = """Some tests FAIL! | 55 FAIL_MESSAGE = """Some tests FAIL! |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 generate_bindings( | 336 generate_bindings( |
336 CodeGeneratorV8, | 337 CodeGeneratorV8, |
337 partial_interface_info_provider, | 338 partial_interface_info_provider, |
338 partial_interface_options, | 339 partial_interface_options, |
339 partial_interface_filenames) | 340 partial_interface_filenames) |
340 generate_dictionary_impl( | 341 generate_dictionary_impl( |
341 CodeGeneratorDictionaryImpl, | 342 CodeGeneratorDictionaryImpl, |
342 info_provider, | 343 info_provider, |
343 options, | 344 options, |
344 dictionary_impl_filenames) | 345 dictionary_impl_filenames) |
| 346 generate_conditional_features( |
| 347 info_provider, |
| 348 options, |
| 349 [filename for filename in idl_filenames |
| 350 if filename not in dictionary_impl_filenames]) |
345 | 351 |
346 finally: | 352 finally: |
347 delete_cache_files() | 353 delete_cache_files() |
348 | 354 |
349 # Detect all changes | 355 # Detect all changes |
350 output_files = list_files(output_directory) | 356 output_files = list_files(output_directory) |
351 passed = identical_output_files(output_files) | 357 passed = identical_output_files(output_files) |
352 passed &= no_excess_files(output_files) | 358 passed &= no_excess_files(output_files) |
353 | 359 |
354 if passed: | 360 if passed: |
355 if verbose: | 361 if verbose: |
356 print | 362 print |
357 print PASS_MESSAGE | 363 print PASS_MESSAGE |
358 return 0 | 364 return 0 |
359 print | 365 print |
360 print FAIL_MESSAGE | 366 print FAIL_MESSAGE |
361 return 1 | 367 return 1 |
362 | 368 |
363 | 369 |
364 def run_bindings_tests(reset_results, verbose, suppress_diff): | 370 def run_bindings_tests(reset_results, verbose, suppress_diff): |
365 # Generate output into the reference directory if resetting results, or | 371 # Generate output into the reference directory if resetting results, or |
366 # a temp directory if not. | 372 # a temp directory if not. |
367 if reset_results: | 373 if reset_results: |
368 print 'Resetting results' | 374 print 'Resetting results' |
369 return bindings_tests(REFERENCE_DIRECTORY, verbose, suppress_diff) | 375 return bindings_tests(REFERENCE_DIRECTORY, verbose, suppress_diff) |
370 with TemporaryDirectory() as temp_dir: | 376 with TemporaryDirectory() as temp_dir: |
371 return bindings_tests(temp_dir, verbose, suppress_diff) | 377 return bindings_tests(temp_dir, verbose, suppress_diff) |
OLD | NEW |