Skip to content

Commit 7dc7c15

Browse files
authored
[lldb] Adding a new decorator for CMAKE_BUILD_TYPE. (#141159)
In lldb-dap, we have existing tests that are known to be unstable when lldb and lldb-dap are built in the Debug configuration. This decorator lets us skip those tests in CI jobs that are to slow with those configurations. This was split out from #140777 to make the patches smaller.
1 parent 3f15b66 commit 7dc7c15

File tree

6 files changed

+26
-0
lines changed

6 files changed

+26
-0
lines changed

lldb/packages/Python/lldbsuite/test/configuration.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@
137137
# A plugin whose tests will be enabled, like intel-pt.
138138
enabled_plugins = []
139139

140+
# the build type of lldb
141+
# Typical values include Debug, Release, RelWithDebInfo and MinSizeRel
142+
cmake_build_type = None
140143

141144
def shouldSkipBecauseOfCategories(test_categories):
142145
if use_categories:

lldb/packages/Python/lldbsuite/test/decorators.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,3 +1102,15 @@ def is_feature_enabled():
11021102
return "%s is not supported on this system." % feature
11031103

11041104
return skipTestIfFn(is_feature_enabled)
1105+
1106+
1107+
def skipIfBuildType(types: list[str]):
1108+
"""Skip tests if built in a specific CMAKE_BUILD_TYPE.
1109+
1110+
Supported types include 'Release', 'RelWithDebInfo', 'Debug', 'MinSizeRel'.
1111+
"""
1112+
types = [name.lower() for name in types]
1113+
return unittest.skipIf(
1114+
configuration.cmake_build_type.lower() in types,
1115+
"skip on {} build type(s)".format(", ".join(types)),
1116+
)

lldb/packages/Python/lldbsuite/test/dotest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ def parseOptionsAndInitTestdirs():
297297
configuration.libcxx_include_dir = args.libcxx_include_dir
298298
configuration.libcxx_include_target_dir = args.libcxx_include_target_dir
299299
configuration.libcxx_library_dir = args.libcxx_library_dir
300+
configuration.cmake_build_type = args.cmake_build_type.lower()
300301

301302
if args.channels:
302303
lldbtest_config.channels = args.channels

lldb/packages/Python/lldbsuite/test/dotest_args.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,12 @@ def create_parser():
300300
metavar="platform-available-ports",
301301
help="Ports available for connection to a lldb server on the remote platform",
302302
)
303+
group.add_argument(
304+
"--cmake-build-type",
305+
dest="cmake_build_type",
306+
metavar="cmake-build-type",
307+
help="Specifies the build type on single-configuration",
308+
)
303309

304310
# Test-suite behaviour
305311
group = parser.add_argument_group("Runtime behaviour options")

lldb/test/API/lit.cfg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ def delete_module_cache(path):
271271
if is_configured("lldb_framework_dir"):
272272
dotest_cmd += ["--framework", config.lldb_framework_dir]
273273

274+
if is_configured("cmake_build_type"):
275+
dotest_cmd += ["--cmake-build-type", config.cmake_build_type]
276+
274277
if "lldb-simulator-ios" in config.available_features:
275278
dotest_cmd += ["--apple-sdk", "iphonesimulator", "--platform-name", "ios-simulator"]
276279
elif "lldb-simulator-watchos" in config.available_features:

lldb/test/API/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ config.dotest_common_args_str = lit_config.substitute("@LLDB_TEST_COMMON_ARGS@")
2727
config.dotest_user_args_str = lit_config.substitute("@LLDB_TEST_USER_ARGS@")
2828
config.lldb_platform_url = lit_config.substitute("@LLDB_TEST_PLATFORM_URL@")
2929
config.lldb_platform_working_dir = lit_config.substitute("@LLDB_TEST_PLATFORM_WORKING_DIR@")
30+
config.cmake_build_type = "@CMAKE_BUILD_TYPE@"
3031
config.cmake_sysroot = lit_config.substitute("@LLDB_TEST_SYSROOT@" or "@DEFAULT_SYSROOT@")
3132
config.lldb_enable_python = @LLDB_ENABLE_PYTHON@
3233
config.dotest_lit_args_str = None

0 commit comments

Comments
 (0)