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

Unified Diff: third_party/WebKit/Tools/Scripts/run-bindings-tests

Issue 2568863003: Split out argument parser construction in run-binding-tests. (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/run-bindings-tests
diff --git a/third_party/WebKit/Tools/Scripts/run-bindings-tests b/third_party/WebKit/Tools/Scripts/run-bindings-tests
index ea6a6adc5c1b17d87092f57de647cab4a9b1b003..249e5e41a4a0da665d99f28ab9a8dd01aac4da93 100755
--- a/third_party/WebKit/Tools/Scripts/run-bindings-tests
+++ b/third_party/WebKit/Tools/Scripts/run-bindings-tests
@@ -31,15 +31,7 @@ webkit_finder.add_typ_dir_to_sys_path()
import typ
-def main(argv):
- """Runs Blink bindings IDL compiler on test IDL files and compares the
- results with reference files.
-
- Please execute the script whenever changes are made to the compiler
- (this is automatically done as a presubmit script),
- and submit changes to the test results in the same patch.
- This makes it easier to track and review changes in generated code.
- """
+def create_argument_parser():
argument_parser = typ.ArgumentParser()
argument_parser.add_argument('--reset-results',
default=False,
@@ -53,23 +45,38 @@ def main(argv):
default=False,
action='store_true',
help='Skip running reference tests (only run unit tests).')
+ return argument_parser
+
+
+def main(argv):
+ """Runs Blink bindings IDL compiler on test IDL files and compares the
+ results with reference files.
+
+ Please execute the script whenever changes are made to the compiler
+ (this is automatically done as a presubmit script),
+ and submit changes to the test results in the same patch.
+ This makes it easier to track and review changes in generated code.
+ """
+
+ argument_parser = create_argument_parser()
# First, run bindings unit tests.
runner = typ.Runner()
runner.parse_args(argument_parser, argv[1:])
- args = runner.args
if argument_parser.exit_status is not None:
return argument_parser.exit_status
- runner.args.top_level_dir = webkit_finder.get_bindings_scripts_dir()
+
+ args = runner.args
+ args.top_level_dir = webkit_finder.get_bindings_scripts_dir()
if not args.skip_unit_tests:
return_code, _, _ = runner.run()
if return_code != 0:
return return_code
+ # Now run the bindings end-to-end tests.
if args.skip_reference_tests:
return 0
- # Now run the bindings end-to-end tests.
return run_bindings_tests(args.reset_results, args.verbose)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698