diff --git a/lldb/test/dosep.py b/lldb/test/dosep.py index 0806074df5f8..1f73e3f0811b 100755 --- a/lldb/test/dosep.py +++ b/lldb/test/dosep.py @@ -233,7 +233,10 @@ Run lldb test suite using a separate process for each test file. 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 diff --git a/lldb/test/dotest.py b/lldb/test/dotest.py index e0d50b5a5f7d..49268951b860 100755 --- a/lldb/test/dotest.py +++ b/lldb/test/dotest.py @@ -491,7 +491,8 @@ def parseOptionsAndInitTestdirs(): 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: diff --git a/lldb/test/dotest_args.py b/lldb/test/dotest_args.py index 3aa7780959e3..2e632e16de2a 100644 --- a/lldb/test/dotest_args.py +++ b/lldb/test/dotest_args.py @@ -26,8 +26,7 @@ def parse_args(parser, argv): 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 @@ def getArguments(argv): 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