[Lldb-commits] [PATCH] dotest.py - fixed a bug displaying usage
Zachary Turner
zturner at google.com
Fri May 22 10:34:40 PDT 2015
Looks fine, in the future it seems like a good cleanup would be to move all
the argument validation into dotest_args, but this seems fine for now.
On Fri, May 22, 2015 at 7:54 AM Vince Harron <vince at nethacker.com> wrote:
> Hi clayborg, zturner,
>
> http://reviews.llvm.org/D9937
>
> Files:
> test/dosep.py
> test/dotest.py
> test/dotest_args.py
>
> Index: test/dosep.py
> ===================================================================
> --- test/dosep.py
> +++ test/dosep.py
> @@ -233,7 +233,10 @@
>
> is_posix = (os.name == "posix")
> dotest_argv = shlex.split(dotest_option_string, posix=is_posix) if
> dotest_option_string else []
> - dotest_options = dotest_args.getArguments(dotest_argv)
> +
> + parser = dotest_args.create_parser()
> + dotest_options = dotest_args.parse_args(parser, dotest_argv)
> +
> if not dotest_options.s:
> # no session log directory, we need to add this to prevent
> # every dotest invocation from creating its own directory
> Index: test/dotest.py
> ===================================================================
> --- test/dotest.py
> +++ test/dotest.py
> @@ -491,7 +491,8 @@
> platform_system = platform.system()
> platform_machine = platform.machine()
>
> - args = dotest_args.getArguments(sys.argv[1:])
> + parser = dotest_args.create_parser()
> + args = dotest_args.parse_args(parser, sys.argv[1:])
>
> if args.unset_env_varnames:
> for env_var in args.unset_env_varnames:
> Index: test/dotest_args.py
> ===================================================================
> --- test/dotest_args.py
> +++ test/dotest_args.py
> @@ -26,8 +26,7 @@
> else:
> return parser.parse_args(args=argv)
>
> -def getArguments(argv):
> -
> +def create_parser():
> parser = argparse.ArgumentParser(description='description',
> prefix_chars='+-', add_help=False)
> group = None
>
> @@ -114,4 +113,4 @@
> group = parser.add_argument_group('Test directories')
> group.add_argument('args', metavar='test-dir', nargs='*',
> help='Specify a list of directory names to search for test modules named
> after Test*.py (test discovery). If empty, search from the current working
> directory instead.')
>
> - return parse_args(parser, argv)
> + return parser
>
> EMAIL PREFERENCES
> http://reviews.llvm.org/settings/panel/emailpreferences/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150522/f7dc17fc/attachment.html>
More information about the lldb-commits
mailing list