Skip to content

Commit bf93f4b

Browse files
committed
[lldb] Fix and rename skipIfHostIncompatibleWithRemote
Fix and rename the broken and confusingly named decorator skipIfHostIncompatibleWithRemote. The decorator is meant to skip test which uses the inferior test build system (i.e. to build test inferiors) to build host binaries (e.g. lldb drivers). The decorator was broken on macOS, where the host and target platform report macosx, but the decorator overwrote it with Darwin, resulting in tests incorrectly being skipped. The decorator was also missing on a handful of tests that use the buildDriver helper, which this commit fixes as well.
1 parent 3363d23 commit bf93f4b

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -746,18 +746,14 @@ def skipUnlessTargetAndroid(func):
746746
)(func)
747747

748748

749-
def skipIfHostIncompatibleWithRemote(func):
750-
"""Decorate the item to skip tests if binaries built on this host are incompatible."""
749+
def skipIfHostIncompatibleWithTarget(func):
750+
"""Decorate the item to skip tests when the host and target are incompatible."""
751751

752752
def is_host_incompatible_with_remote():
753753
host_arch = lldbplatformutil.getLLDBArchitecture()
754754
host_platform = lldbplatformutil.getHostPlatform()
755755
target_arch = lldbplatformutil.getArchitecture()
756-
target_platform = (
757-
"darwin"
758-
if lldbplatformutil.platformIsDarwin()
759-
else lldbplatformutil.getPlatform()
760-
)
756+
target_platform = lldbplatformutil.getPlatform()
761757
if (
762758
not (target_arch == "x86_64" and host_arch == "i386")
763759
and host_arch != target_arch

lldb/test/API/api/command-return-object/TestSBCommandReturnObject.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class TestSBCommandReturnObject(TestBase):
1212
@expectedFailureAll(
1313
oslist=["windows"], archs=["i[3-6]86", "x86_64"], bugnumber="llvm.org/pr43570"
1414
)
15+
@skipIfHostIncompatibleWithTarget
1516
def test_sb_command_return_object(self):
1617
env = {self.dylibPath: self.getLLDBLibraryEnvVal()}
1718

lldb/test/API/api/multiple-debuggers/TestMultipleDebuggers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class TestMultipleSimultaneousDebuggers(TestBase):
1313

1414
@skipIfNoSBHeaders
1515
@skipIfWindows
16+
@skipIfHostIncompatibleWithTarget
1617
def test_multiple_debuggers(self):
1718
env = {self.dylibPath: self.getLLDBLibraryEnvVal()}
1819

lldb/test/API/api/multiple-targets/TestMultipleTargets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ class TestMultipleTargets(TestBase):
1313

1414
@skipIf(oslist=["linux"], archs=["arm", "aarch64"])
1515
@skipIfNoSBHeaders
16-
@skipIfHostIncompatibleWithRemote
1716
@expectedFailureAll(
1817
oslist=["windows"], archs=["i[3-6]86", "x86_64"], bugnumber="llvm.org/pr20282"
1918
)
2019
@expectedFlakeyNetBSD
20+
@skipIfHostIncompatibleWithTarget
2121
def test_multiple_targets(self):
2222
env = {self.dylibPath: self.getLLDBLibraryEnvVal()}
2323

lldb/test/API/api/multithreaded/TestMultithreaded.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ def setUp(self):
2727
@skipIfRemote
2828
# clang-cl does not support throw or catch (llvm.org/pr24538)
2929
@skipIfWindows
30+
@skipIfHostIncompatibleWithTarget
3031
def test_python_stop_hook(self):
3132
"""Test that you can run a python command in a stop-hook when stdin is File based."""
3233
self.build_and_test("driver.cpp test_stop-hook.cpp", "test_python_stop_hook")
3334

3435
@skipIfRemote
3536
# clang-cl does not support throw or catch (llvm.org/pr24538)
3637
@skipIfWindows
38+
@skipIfHostIncompatibleWithTarget
3739
def test_breakpoint_callback(self):
3840
"""Test the that SBBreakpoint callback is invoked when a breakpoint is hit."""
3941
self.build_and_test(
@@ -43,6 +45,7 @@ def test_breakpoint_callback(self):
4345
@skipIfRemote
4446
# clang-cl does not support throw or catch (llvm.org/pr24538)
4547
@skipIfWindows
48+
@skipIfHostIncompatibleWithTarget
4649
def test_breakpoint_location_callback(self):
4750
"""Test the that SBBreakpointLocation callback is invoked when a breakpoint is hit."""
4851
self.build_and_test(
@@ -54,6 +57,7 @@ def test_breakpoint_location_callback(self):
5457
# clang-cl does not support throw or catch (llvm.org/pr24538)
5558
@skipIfWindows
5659
@expectedFlakeyFreeBSD
60+
@skipIfHostIncompatibleWithTarget
5761
def test_sb_api_listener_event_description(self):
5862
"""Test the description of an SBListener breakpoint event is valid."""
5963
self.build_and_test(
@@ -65,6 +69,7 @@ def test_sb_api_listener_event_description(self):
6569
# clang-cl does not support throw or catch (llvm.org/pr24538)
6670
@skipIfWindows
6771
@expectedFlakeyFreeBSD
72+
@skipIfHostIncompatibleWithTarget
6873
def test_sb_api_listener_event_process_state(self):
6974
"""Test that a registered SBListener receives events when a process
7075
changes state.
@@ -79,6 +84,7 @@ def test_sb_api_listener_event_process_state(self):
7984
@skipIfWindows
8085
@expectedFlakeyFreeBSD
8186
@skipIf(oslist=["linux"]) # flakey
87+
@skipIfHostIncompatibleWithTarget
8288
def test_sb_api_listener_resume(self):
8389
"""Test that a process can be resumed from a non-main thread."""
8490
self.build_and_test(

lldb/test/API/functionalities/plugins/command_plugin/TestPluginCommands.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ def setUp(self):
1313
TestBase.setUp(self)
1414

1515
@skipIfNoSBHeaders
16-
# Requires a compatible arch and platform to link against the host's built
17-
# lldb lib.
18-
@skipIfHostIncompatibleWithRemote
16+
@skipIfHostIncompatibleWithTarget
1917
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
2018
@no_debug_info_test
2119
def test_load_plugin(self):

0 commit comments

Comments
 (0)