Skip to content

[lldb] Adding a new decorator for CMAKE_BUILD_TYPE. #141159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lldb/packages/Python/lldbsuite/test/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@
# A plugin whose tests will be enabled, like intel-pt.
enabled_plugins = []

# the build type of lldb
# Typical values include Debug, Release, RelWithDebInfo and MinSizeRel
cmake_build_type = None

def shouldSkipBecauseOfCategories(test_categories):
if use_categories:
Expand Down
12 changes: 12 additions & 0 deletions lldb/packages/Python/lldbsuite/test/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1102,3 +1102,15 @@ def is_feature_enabled():
return "%s is not supported on this system." % feature

return skipTestIfFn(is_feature_enabled)


def skipIfBuildType(types: list[str]):
"""Skip tests if built in a specific CMAKE_BUILD_TYPE.

Supported types include 'Release', 'RelWithDebInfo', 'Debug', 'MinSizeRel'.
"""
types = [name.lower() for name in types]
return unittest.skipIf(
configuration.cmake_build_type.lower() in types,
"skip on {} build type(s)".format(", ".join(types)),
)
1 change: 1 addition & 0 deletions lldb/packages/Python/lldbsuite/test/dotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ def parseOptionsAndInitTestdirs():
configuration.libcxx_include_dir = args.libcxx_include_dir
configuration.libcxx_include_target_dir = args.libcxx_include_target_dir
configuration.libcxx_library_dir = args.libcxx_library_dir
configuration.cmake_build_type = args.cmake_build_type.lower()

if args.channels:
lldbtest_config.channels = args.channels
Expand Down
6 changes: 6 additions & 0 deletions lldb/packages/Python/lldbsuite/test/dotest_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@ def create_parser():
metavar="platform-available-ports",
help="Ports available for connection to a lldb server on the remote platform",
)
group.add_argument(
"--cmake-build-type",
dest="cmake_build_type",
metavar="cmake-build-type",
help="Specifies the build type on single-configuration",
)

# Test-suite behaviour
group = parser.add_argument_group("Runtime behaviour options")
Expand Down
3 changes: 3 additions & 0 deletions lldb/test/API/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ def delete_module_cache(path):
if is_configured("lldb_framework_dir"):
dotest_cmd += ["--framework", config.lldb_framework_dir]

if is_configured("cmake_build_type"):
dotest_cmd += ["--cmake-build-type", config.cmake_build_type]

if "lldb-simulator-ios" in config.available_features:
dotest_cmd += ["--apple-sdk", "iphonesimulator", "--platform-name", "ios-simulator"]
elif "lldb-simulator-watchos" in config.available_features:
Expand Down
1 change: 1 addition & 0 deletions lldb/test/API/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ config.dotest_common_args_str = lit_config.substitute("@LLDB_TEST_COMMON_ARGS@")
config.dotest_user_args_str = lit_config.substitute("@LLDB_TEST_USER_ARGS@")
config.lldb_platform_url = lit_config.substitute("@LLDB_TEST_PLATFORM_URL@")
config.lldb_platform_working_dir = lit_config.substitute("@LLDB_TEST_PLATFORM_WORKING_DIR@")
config.cmake_build_type = "@CMAKE_BUILD_TYPE@"
config.cmake_sysroot = lit_config.substitute("@LLDB_TEST_SYSROOT@" or "@DEFAULT_SYSROOT@")
config.lldb_enable_python = @LLDB_ENABLE_PYTHON@
config.dotest_lit_args_str = None
Expand Down
Loading