diff options
author | Pavel Labath <pavel@labath.sk> | 2022-03-14 16:32:51 +0100 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2022-03-30 17:16:37 +0200 |
commit | 21c5bb0a636c23ec75b13681c0a6fdb03ecd9c0d (patch) | |
tree | e36c3e5282768e9e21ebc8154c7ac9f2ba2a19eb /lldb/packages/Python/lldbsuite/test/dotest.py | |
parent | c531171d995728f55e5775d354a21dceed03edce (diff) | |
download | llvm-21c5bb0a636c23ec75b13681c0a6fdb03ecd9c0d.zip llvm-21c5bb0a636c23ec75b13681c0a6fdb03ecd9c0d.tar.gz llvm-21c5bb0a636c23ec75b13681c0a6fdb03ecd9c0d.tar.bz2 |
Recommit [lldb/test] Make category-skipping logic "platform"-independent
This recommits dddf4ce03, which was reverted because of a couple of test
failures on macos. The reason behind the failures was that the patch
inadvertenly changed the value returned by the host platform from
"macosx" to "darwin". The new version fixes that.
Original commit message was:
The decision which categories are relevant for a particular test run
happen very early in the test setup process. They use the SBPlatform
object to determine which categories should be skipped. The platform
object created for this purpose transcends individual test runs.
This setup is not compatible with the direction discussed in
<https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594>
-- when platform objects are tied to a specific (SB)Debugger, they need
to be created alongside it, which currently happens in the test setUp
method.
This patch is the first step in that direction -- it rewrites the
category skipping logic to avoid depending on a global SBPlatform
object. Fortunately, the skipping logic is fairly simple (and I believe
it outght to stay that way) and mainly consists of comparing the
platform name against some hardcoded lists. This patch bases this
comparison on the platform name instead of the os part of the triple (as
reported by the platform).
Differential Revision: https://reviews.llvm.org/D121605
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/dotest.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/dotest.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py index ce01146..5cf7539 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -822,9 +822,9 @@ def checkObjcSupport(): configuration.skip_categories.append("objc") def checkDebugInfoSupport(): - import lldb + from lldbsuite.test import lldbplatformutil - platform = lldb.selected_platform.GetTriple().split('-')[2] + platform = lldbplatformutil.getPlatform() compiler = configuration.compiler for cat in test_categories.debug_info_categories: if cat in configuration.categories_list: @@ -840,14 +840,14 @@ def checkDebugServerSupport(): skip_msg = "Skipping %s tests, as they are not compatible with remote testing on this platform" if lldbplatformutil.platformIsDarwin(): configuration.skip_categories.append("llgs") - if lldb.remote_platform: + if configuration.lldb_platform_name: # <rdar://problem/34539270> configuration.skip_categories.append("debugserver") if configuration.verbose: print(skip_msg%"debugserver"); else: configuration.skip_categories.append("debugserver") - if lldb.remote_platform and lldbplatformutil.getPlatform() == "windows": + if configuration.lldb_platform_name and lldbplatformutil.getPlatform() == "windows": configuration.skip_categories.append("llgs") if configuration.verbose: print(skip_msg%"lldb-server"); @@ -881,7 +881,16 @@ def run_suite(): import lldb lldb.SBDebugger.Initialize() + checkLibcxxSupport() + checkLibstdcxxSupport() + checkWatchpointSupport() + checkDebugInfoSupport() + checkDebugServerSupport() + checkObjcSupport() + checkForkVForkSupport() + # Use host platform by default. + lldb.remote_platform = None lldb.selected_platform = lldb.SBPlatform.GetHostPlatform() # Now we can also import lldbutil @@ -938,14 +947,6 @@ def run_suite(): # Note that it's not dotest's job to clean this directory. lldbutil.mkdir_p(configuration.test_build_dir) - checkLibcxxSupport() - checkLibstdcxxSupport() - checkWatchpointSupport() - checkDebugInfoSupport() - checkDebugServerSupport() - checkObjcSupport() - checkForkVForkSupport() - print("Skipping the following test categories: {}".format(configuration.skip_categories)) for testdir in configuration.testdirs: |