8 from . import configuration
12 parser
= argparse
.ArgumentParser(
13 description
="description", prefix_chars
="+-", add_help
=False
17 # Helper function for boolean options (group will point to the current
18 # group when executing X)
19 X
= lambda optstr
, helpstr
, **kwargs
: group
.add_argument(
20 optstr
, help=helpstr
, action
="store_true", **kwargs
23 group
= parser
.add_argument_group("Help")
29 help="Print this help message and exit. Add '-v' for more detailed help.",
32 # C and Python toolchain options
33 group
= parser
.add_argument_group("Toolchain options")
40 """Specify the architecture(s) to test. This option can be specified more than once"""
49 """Specify the compiler(s) used to build the inferior executables. The compiler path can be an executable basename or a full path to a compiler executable. This option can be specified multiple times."""
52 if sys
.platform
== "darwin":
59 """Specify the name of the Apple SDK (macosx, macosx.internal, iphoneos, iphoneos.internal, or path to SDK) and use the appropriate tools from that SDK's toolchain."""
63 "--libcxx-include-dir",
65 "Specify the path to a custom libc++ include directory. Must be used in conjunction with --libcxx-library-dir."
69 "--libcxx-include-target-dir",
71 "Specify the path to a custom libc++ include target directory to use in addition to --libcxx-include-dir. Optional."
75 "--libcxx-library-dir",
77 "Specify the path to a custom libc++ library directory. Must be used in conjunction with --libcxx-include-dir."
80 # FIXME? This won't work for different extra flags according to each arch.
83 metavar
="extra-flags",
85 """Specify the extra flags to be passed to the toolchain when building the inferior programs to be debugged
86 suggestions: do not lump the "-A arch1 -A arch2" together such that the -E option applies to only one of the architectures"""
94 help=textwrap
.dedent("Specify which dsymutil to use."),
99 dest
="llvm_tools_dir",
100 help=textwrap
.dedent(
101 "The location of llvm tools used for testing (yaml2obj, FileCheck, etc.)."
105 # Test filtering options
106 group
= parser
.add_argument_group("Test filtering options")
109 metavar
="filterspec",
112 'Specify a filter, which looks like "TestModule.TestClass.test_name". '
113 + "You may also use shortened filters, such as "
114 + '"TestModule.TestClass", "TestClass.test_name", or just "test_name".'
120 help="Specify a regexp filename pattern for inclusion in the test suite",
124 metavar
="exclusion-file",
126 help=textwrap
.dedent(
127 """Specify a file for tests to exclude. File should contain lists of regular expressions for test files or methods,
128 with each list under a matching header (xfail files, xfail methods, skip files, skip methods)"""
136 dest
="categories_list",
137 help=textwrap
.dedent(
138 """Specify categories of test cases of interest. Can be specified more than once."""
145 dest
="skip_categories",
146 help=textwrap
.dedent(
147 """Specify categories of test cases to skip. Takes precedence over -G. Can be specified more than once."""
154 dest
="xfail_categories",
155 help=textwrap
.dedent(
156 """Specify categories of test cases that are expected to fail. Can be specified more than once."""
160 # Configuration options
161 group
= parser
.add_argument_group("Configuration options")
163 "--framework", metavar
="framework-path", help="The path to LLDB.framework"
167 metavar
="executable-path",
168 help="The path to the lldb executable",
171 "--out-of-tree-debugserver",
172 dest
="out_of_tree_debugserver",
174 help="A flag to indicate an out-of-tree debug server is being used",
178 metavar
="dwarf_version",
179 dest
="dwarf_version",
181 help="Override the DWARF version.",
185 metavar
="SETTING=VALUE",
190 help='Run "setting set SETTING VALUE" before executing any test.',
196 help="Specify the iteration count used to collect our benchmarks. An example is the number of times to do 'thread step-over' to measure stepping speed.",
203 help="Repeat the test suite for a specified number of times",
210 help=textwrap
.dedent(
211 "Specify the log channels (and optional categories) e.g. 'lldb all' or 'gdb-remote packets' if no categories are specified, 'default' is used"
218 help="Leave logs/traces even for successful test runs (useful for creating reference log files during debugging.)",
221 "--codesign-identity",
222 metavar
="Codesigning identity",
223 default
="lldb_codesign",
224 help="The codesigning identity to use",
228 dest
="test_build_dir",
229 metavar
="Test build directory",
230 default
="lldb-test-build.noindex",
231 help="The root build directory for the tests. It will be removed before running.",
234 "--lldb-module-cache-dir",
235 dest
="lldb_module_cache_dir",
236 metavar
="The clang module cache directory used by LLDB",
237 help="The clang module cache directory used by LLDB. Defaults to <test build directory>/module-cache-lldb.",
240 "--clang-module-cache-dir",
241 dest
="clang_module_cache_dir",
242 metavar
="The clang module cache directory used by Clang",
243 help="The clang module cache directory used in the Make files by Clang while building tests. Defaults to <test build directory>/module-cache-clang.",
247 dest
="lldb_libs_dir",
249 help="The path to LLDB library directory (containing liblldb)",
253 dest
="enabled_plugins",
256 metavar
="A plugin whose tests will be enabled",
257 help="A plugin whose tests will be enabled. The only currently supported plugin is intel-pt.",
260 # Configuration options
261 group
= parser
.add_argument_group("Remote platform options")
264 dest
="lldb_platform_name",
265 metavar
="platform-name",
266 help="The name of a remote platform to use",
270 dest
="lldb_platform_url",
271 metavar
="platform-url",
272 help="A LLDB platform URL to use when connecting to a remote platform to run the test suite",
275 "--platform-working-dir",
276 dest
="lldb_platform_working_dir",
277 metavar
="platform-working-dir",
278 help="The directory to use on the remote platform.",
281 # Test-suite behaviour
282 group
= parser
.add_argument_group("Runtime behaviour options")
285 "Suspend the process after launch to wait indefinitely for a debugger to attach",
287 X("-t", "Turn on tracing of lldb command and other detailed test executions")
290 dest
="unset_env_varnames",
293 help="Specify an environment variable to unset before running the test cases. e.g., -u DYLD_INSERT_LIBRARIES -u MallocScribble",
300 help="Specify an environment variable to set to the given value before running the test cases e.g.: --env CXXFLAGS=-O3 --env DYLD_INSERT_LIBRARIES",
304 dest
="set_inferior_env_vars",
307 help="Specify an environment variable to set to the given value for the inferior.",
311 "Do verbose mode of unittest framework (print out each test case invocation)",
314 "--enable-crash-dialog",
315 dest
="disable_crash_dialog",
316 action
="store_false",
317 help="(Windows only) When LLDB crashes, display the Windows crash dialog.",
319 group
.set_defaults(disable_crash_dialog
=True)
321 # Remove the reference to our helper function
324 group
= parser
.add_argument_group("Test directories")
329 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.",