Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(744)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/bindings/bindings_tests.py

Issue 2970003002: Add code generation for ConditionalFeatures bindings code (Closed)
Patch Set: Make code generation testable, add to bindings tests Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 if filename not in dicti onary_impl_filenames])
Yuki 2017/07/15 12:09:19 nit: 80 columns?
iclelland 2017/07/16 04:23:06 Done.
345 350
346 finally: 351 finally:
347 delete_cache_files() 352 delete_cache_files()
348 353
349 # Detect all changes 354 # Detect all changes
350 output_files = list_files(output_directory) 355 output_files = list_files(output_directory)
351 passed = identical_output_files(output_files) 356 passed = identical_output_files(output_files)
352 passed &= no_excess_files(output_files) 357 passed &= no_excess_files(output_files)
353 358
354 if passed: 359 if passed:
355 if verbose: 360 if verbose:
356 print 361 print
357 print PASS_MESSAGE 362 print PASS_MESSAGE
358 return 0 363 return 0
359 print 364 print
360 print FAIL_MESSAGE 365 print FAIL_MESSAGE
361 return 1 366 return 1
362 367
363 368
364 def run_bindings_tests(reset_results, verbose, suppress_diff): 369 def run_bindings_tests(reset_results, verbose, suppress_diff):
365 # Generate output into the reference directory if resetting results, or 370 # Generate output into the reference directory if resetting results, or
366 # a temp directory if not. 371 # a temp directory if not.
367 if reset_results: 372 if reset_results:
368 print 'Resetting results' 373 print 'Resetting results'
369 return bindings_tests(REFERENCE_DIRECTORY, verbose, suppress_diff) 374 return bindings_tests(REFERENCE_DIRECTORY, verbose, suppress_diff)
370 with TemporaryDirectory() as temp_dir: 375 with TemporaryDirectory() as temp_dir:
371 return bindings_tests(temp_dir, verbose, suppress_diff) 376 return bindings_tests(temp_dir, verbose, suppress_diff)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698