Skip to content

Commit a65aca6

Browse files
authored
[lldb][test] StepUntil disable test for unsupported linkers. (#157474)
`INSERT BEFORE` keyword is not supported in current versions gold and mold linkers. Since we cannot confirm accurately what linker and version is available on the system and when it will be supported. We test it with a sample program using the script keywords.
1 parent 2701a22 commit a65aca6

File tree

2 files changed

+40
-20
lines changed

2 files changed

+40
-20
lines changed

lldb/test/API/functionalities/thread/step_until/TestStepUntil.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
"""Test stepping over vrs. hitting breakpoints & subsequent stepping in various forms."""
22

3-
4-
import lldb
53
from lldbsuite.test.decorators import *
64
from lldbsuite.test.lldbtest import *
75
from lldbsuite.test import lldbutil
6+
from lldbsuite.test_event.build_exception import BuildError
87

98

109
class StepUntilTestCase(TestBase):
@@ -112,10 +111,15 @@ def test_bad_line(self):
112111
@no_debug_info_test
113112
@skipIf(oslist=lldbplatformutil.getDarwinOSTriples() + ["windows"])
114113
@skipIf(archs=no_match(["x86_64", "aarch64"]))
114+
@skipIf(compiler=no_match(["clang"]))
115115
def test_bad_line_discontinuous(self):
116116
"""Test that we get an error if attempting to step outside the current
117117
function -- and the function is discontinuous"""
118-
self.build(dictionary=self._build_dict_for_discontinuity())
118+
try:
119+
self.build(dictionary=self._build_dict_for_discontinuity())
120+
except BuildError as ex:
121+
self.skipTest(f"failed to build with linker script.")
122+
119123
_, _, thread, _ = lldbutil.run_to_source_breakpoint(
120124
self, "At the start", lldb.SBFileSpec(self.main_source)
121125
)

lldb/test/API/functionalities/thread/step_until/TestStepUntilAPI.py

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import lldb
21
from lldbsuite.test.decorators import *
32
from lldbsuite.test.lldbtest import *
43
from lldbsuite.test import lldbutil
4+
from lldbsuite.test_event.build_exception import BuildError
55

66

77
class TestStepUntilAPI(TestBase):
@@ -74,15 +74,20 @@ def test_hitting(self):
7474

7575
@skipIf(oslist=lldbplatformutil.getDarwinOSTriples() + ["windows"])
7676
@skipIf(archs=no_match(["x86_64", "aarch64"]))
77+
@skipIf(compiler=no_match(["clang"]))
7778
def test_hitting_discontinuous(self):
7879
"""Test SBThread.StepOverUntil - targeting a line and hitting it -- with
7980
discontinuous functions"""
80-
self._do_until(
81-
self._build_dict_for_discontinuity(),
82-
None,
83-
self.less_than_two,
84-
self.less_than_two,
85-
)
81+
try:
82+
self._do_until(
83+
self._build_dict_for_discontinuity(),
84+
None,
85+
self.less_than_two,
86+
self.less_than_two,
87+
)
88+
except BuildError as ex:
89+
self.skipTest(f"failed to build with linker script.")
90+
8691
self._assertDiscontinuity()
8792

8893
def test_missing(self):
@@ -93,15 +98,20 @@ def test_missing(self):
9398

9499
@skipIf(oslist=lldbplatformutil.getDarwinOSTriples() + ["windows"])
95100
@skipIf(archs=no_match(["x86_64", "aarch64"]))
101+
@skipIf(compiler=no_match(["clang"]))
96102
def test_missing_discontinuous(self):
97103
"""Test SBThread.StepOverUntil - targeting a line and missing it by
98104
stepping out to call site -- with discontinuous functions"""
99-
self._do_until(
100-
self._build_dict_for_discontinuity(),
101-
["foo", "bar", "baz"],
102-
self.less_than_two,
103-
self.back_out_in_main,
104-
)
105+
try:
106+
self._do_until(
107+
self._build_dict_for_discontinuity(),
108+
["foo", "bar", "baz"],
109+
self.less_than_two,
110+
self.back_out_in_main,
111+
)
112+
except BuildError as ex:
113+
self.skipTest(f"failed to build with linker script.")
114+
105115
self._assertDiscontinuity()
106116

107117
def test_bad_line(self):
@@ -120,13 +130,19 @@ def test_bad_line(self):
120130

121131
@skipIf(oslist=lldbplatformutil.getDarwinOSTriples() + ["windows"])
122132
@skipIf(archs=no_match(["x86_64", "aarch64"]))
133+
@skipIf(compiler=no_match(["clang"]))
123134
def test_bad_line_discontinuous(self):
124135
"""Test that we get an error if attempting to step outside the current
125136
function -- and the function is discontinuous"""
126-
self.build(dictionary=self._build_dict_for_discontinuity())
127-
_, _, thread, _ = lldbutil.run_to_source_breakpoint(
128-
self, "At the start", self.main_spec
129-
)
137+
138+
try:
139+
self.build(dictionary=self._build_dict_for_discontinuity())
140+
_, _, thread, _ = lldbutil.run_to_source_breakpoint(
141+
self, "At the start", self.main_spec
142+
)
143+
except BuildError as ex:
144+
self.skipTest(f"failed to build with linker script.")
145+
130146
self.assertIn(
131147
"step until target not in current function",
132148
thread.StepOverUntil(

0 commit comments

Comments
 (0)