Skip to content

Commit 7f3ed46

Browse files
committed
[lldb-dap] Automatically skip lldb-dap tests for remote platforms
The don't currently work (and they're also not particularly useful, since all of the remote stuff happens inside lldb). This saves us from annotating tests one by one.
1 parent 6552af1 commit 7f3ed46

30 files changed

+19
-90
lines changed

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

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -542,12 +542,6 @@ def setupSysPath():
542542
lldbDAPExec = os.path.join(lldbDir, "lldb-dap")
543543
if is_exe(lldbDAPExec):
544544
os.environ["LLDBDAP_EXEC"] = lldbDAPExec
545-
else:
546-
if not configuration.shouldSkipBecauseOfCategories(["lldb-dap"]):
547-
print(
548-
"The 'lldb-dap' executable cannot be located. The lldb-dap tests can not be run as a result."
549-
)
550-
configuration.skip_categories.append("lldb-dap")
551545

552546
lldbPythonDir = None # The directory that contains 'lldb/__init__.py'
553547

@@ -929,6 +923,24 @@ def checkPexpectSupport():
929923
configuration.skip_categories.append("pexpect")
930924

931925

926+
def checkDAPSupport():
927+
import lldb
928+
929+
if "LLDBDAP_EXEC" not in os.environ:
930+
msg = (
931+
"The 'lldb-dap' executable cannot be located and its tests will not be run."
932+
)
933+
elif lldb.remote_platform:
934+
msg = "lldb-dap tests are not compatible with remote platforms and will not be run."
935+
else:
936+
msg = None
937+
938+
if msg:
939+
if configuration.verbose:
940+
print(msg)
941+
configuration.skip_categories.append("lldb-dap")
942+
943+
932944
def run_suite():
933945
# On MacOS X, check to make sure that domain for com.apple.DebugSymbols defaults
934946
# does not exist before proceeding to running the test suite.
@@ -1029,6 +1041,7 @@ def run_suite():
10291041
checkObjcSupport()
10301042
checkForkVForkSupport()
10311043
checkPexpectSupport()
1044+
checkDAPSupport()
10321045

10331046
skipped_categories_list = ", ".join(configuration.skip_categories)
10341047
print(

lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def set_and_hit_breakpoint(self, continueToExit=True):
4141

4242
@skipIfWindows
4343
@skipIfNetBSD # Hangs on NetBSD as well
44-
@skipIfRemote
4544
def test_by_pid(self):
4645
"""
4746
Tests attaching to a process by process ID.
@@ -59,7 +58,6 @@ def test_by_pid(self):
5958

6059
@skipIfWindows
6160
@skipIfNetBSD # Hangs on NetBSD as well
62-
@skipIfRemote
6361
def test_by_name(self):
6462
"""
6563
Tests attaching to a process by process name.

lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_logpoints.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def setUp(self):
2020
self.main_path = os.path.realpath(self.getBuildArtifact(self.main_basename))
2121

2222
@skipIfWindows
23-
@skipIfRemote
2423
def test_logmessage_basic(self):
2524
"""Tests breakpoint logmessage basic functionality."""
2625
before_loop_line = line_number("main.cpp", "// before loop")
@@ -83,7 +82,6 @@ def test_logmessage_basic(self):
8382
self.assertRegex(logMessage_line, reg_str)
8483

8584
@skipIfWindows
86-
@skipIfRemote
8785
def test_logmessage_advanced(self):
8886
"""Tests breakpoint logmessage functionality for complex expression."""
8987
before_loop_line = line_number("main.cpp", "// before loop")
@@ -144,7 +142,6 @@ def test_logmessage_advanced(self):
144142
self.assertEqual(logMessage_line, logMessage_prefix + str(result))
145143

146144
@skipIfWindows
147-
@skipIfRemote
148145
def test_logmessage_format(self):
149146
"""
150147
Tests breakpoint logmessage functionality with format.
@@ -209,7 +206,6 @@ def test_logmessage_format(self):
209206
)
210207

211208
@skipIfWindows
212-
@skipIfRemote
213209
def test_logmessage_format_failure(self):
214210
"""
215211
Tests breakpoint logmessage format with parsing failure.

lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def setUp(self):
2020
self.main_path = os.path.realpath(self.getBuildArtifact(self.main_basename))
2121

2222
@skipIfWindows
23-
@skipIfRemote
2423
def test_source_map(self):
2524
"""
2625
This test simulates building two files in a folder, and then moving
@@ -99,7 +98,6 @@ def test_source_map(self):
9998
self.assertEqual(frames[1]["source"]["path"], new_main_path)
10099

101100
@skipIfWindows
102-
@skipIfRemote
103101
def test_set_and_clear(self):
104102
"""Tests setting and clearing source file and line breakpoints.
105103
This packet is a bit tricky on the debug adaptor side since there
@@ -261,7 +259,6 @@ def test_set_and_clear(self):
261259
)
262260

263261
@skipIfWindows
264-
@skipIfRemote
265262
def test_clear_breakpoints_unset_breakpoints(self):
266263
"""Test clearing breakpoints like test_set_and_clear, but clear
267264
breakpoints by omitting the breakpoints array instead of sending an
@@ -305,7 +302,6 @@ def test_clear_breakpoints_unset_breakpoints(self):
305302
self.assertEqual(len(breakpoints), 0, "expect no source breakpoints")
306303

307304
@skipIfWindows
308-
@skipIfRemote
309305
def test_functionality(self):
310306
"""Tests hitting breakpoints and the functionality of a single
311307
breakpoint, like 'conditions' and 'hitCondition' settings."""

lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setExceptionBreakpoints.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
class TestDAP_setExceptionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
1414
@skipIfWindows
15-
@skipIfRemote
1615
def test_functionality(self):
1716
"""Tests setting and clearing exception breakpoints.
1817
This packet is a bit tricky on the debug adaptor side since there

lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
class TestDAP_setFunctionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
1414
@skipIfWindows
15-
@skipIfRemote
1615
def test_set_and_clear(self):
1716
"""Tests setting and clearing function breakpoints.
1817
This packet is a bit tricky on the debug adaptor side since there
@@ -123,7 +122,6 @@ def test_set_and_clear(self):
123122
)
124123

125124
@skipIfWindows
126-
@skipIfRemote
127125
def test_functionality(self):
128126
"""Tests hitting breakpoints and the functionality of a single
129127
breakpoint, like 'conditions' and 'hitCondition' settings."""

lldb/test/API/tools/lldb-dap/commands/TestDAP_commands.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
class TestDAP_commands(lldbdap_testcase.DAPTestCaseBase):
10-
@skipIfRemote
1110
def test_command_directive_quiet_on_success(self):
1211
program = self.getBuildArtifact("a.out")
1312
command_quiet = (
@@ -61,7 +60,6 @@ def test_command_directive_abort_on_error_launch_commands(self):
6160
def test_command_directive_abort_on_error_pre_run_commands(self):
6261
self.do_test_abort_on_error(use_pre_run_commands=True)
6362

64-
@skipIfRemote
6563
def test_command_directive_abort_on_error_post_run_commands(self):
6664
self.do_test_abort_on_error(use_post_run_commands=True)
6765

lldb/test/API/tools/lldb-dap/completions/TestDAP_completions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def verify_completions(self, actual_list, expected_list, not_expected_list=[]):
1919
self.assertNotIn(not_expected_item, actual_list)
2020

2121
@skipIfWindows
22-
@skipIfRemote
2322
@skipIf(compiler="clang", compiler_version=["<", "17.0"])
2423
def test_completions(self):
2524
"""

lldb/test/API/tools/lldb-dap/console/TestDAP_console.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def check_lldb_command(
3838
)
3939

4040
@skipIfWindows
41-
@skipIfRemote
4241
def test_scopes_variables_setVariable_evaluate(self):
4342
"""
4443
Tests that the "scopes" request causes the currently selected
@@ -82,7 +81,6 @@ def test_scopes_variables_setVariable_evaluate(self):
8281
self.check_lldb_command("frame select", "frame #1", "frame 1 is selected")
8382

8483
@skipIfWindows
85-
@skipIfRemote
8684
def test_custom_escape_prefix(self):
8785
program = self.getBuildArtifact("a.out")
8886
self.build_and_launch(program, commandEscapePrefix="::")
@@ -99,7 +97,6 @@ def test_custom_escape_prefix(self):
9997
)
10098

10199
@skipIfWindows
102-
@skipIfRemote
103100
def test_empty_escape_prefix(self):
104101
program = self.getBuildArtifact("a.out")
105102
self.build_and_launch(program, commandEscapePrefix="")
@@ -116,7 +113,6 @@ def test_empty_escape_prefix(self):
116113
)
117114

118115
@skipIfWindows
119-
@skipIfRemote
120116
def test_exit_status_message_sigterm(self):
121117
source = "main.cpp"
122118
program = self.getBuildArtifact("a.out")
@@ -154,7 +150,6 @@ def test_exit_status_message_sigterm(self):
154150
)
155151

156152
@skipIfWindows
157-
@skipIfRemote
158153
def test_exit_status_message_ok(self):
159154
source = "main.cpp"
160155
program = self.getBuildArtifact("a.out")

lldb/test/API/tools/lldb-dap/console/TestDAP_redirection_to_console.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
class TestDAP_redirection_to_console(lldbdap_testcase.DAPTestCaseBase):
1010
@skipIfWindows
11-
@skipIfRemote
1211
def test(self):
1312
"""
1413
Without proper stderr and stdout redirection, the following code would throw an

lldb/test/API/tools/lldb-dap/coreFile/TestDAP_coreFile.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
class TestDAP_coreFile(lldbdap_testcase.DAPTestCaseBase):
1515
@skipIfWindows
16-
@skipIfRemote
1716
@skipIfLLVMTargetMissing("X86")
1817
def test_core_file(self):
1918
current_dir = os.path.dirname(__file__)
@@ -60,7 +59,6 @@ def test_core_file(self):
6059
self.assertEqual(self.get_stackFrames(), expected_frames)
6160

6261
@skipIfWindows
63-
@skipIfRemote
6462
@skipIfLLVMTargetMissing("X86")
6563
def test_core_file_source_mapping(self):
6664
"""Test that sourceMap property is correctly applied when loading a core"""

lldb/test/API/tools/lldb-dap/databreakpoint/TestDAP_setDataBreakpoints.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ def setUp(self):
1313
self.accessTypes = ["read", "write", "readWrite"]
1414

1515
@skipIfWindows
16-
@skipIfRemote
1716
def test_duplicate_start_addresses(self):
1817
"""Test setDataBreakpoints with multiple watchpoints starting at the same addresses."""
1918
program = self.getBuildArtifact("a.out")
@@ -58,7 +57,6 @@ def test_duplicate_start_addresses(self):
5857
self.assertEqual(i_val, "2")
5958

6059
@skipIfWindows
61-
@skipIfRemote
6260
def test_expression(self):
6361
"""Tests setting data breakpoints on expression."""
6462
program = self.getBuildArtifact("a.out")
@@ -99,7 +97,6 @@ def test_expression(self):
9997
self.assertEqual(i_val, "2")
10098

10199
@skipIfWindows
102-
@skipIfRemote
103100
def test_functionality(self):
104101
"""Tests setting data breakpoints on variable."""
105102
program = self.getBuildArtifact("a.out")

lldb/test/API/tools/lldb-dap/disassemble/TestDAP_disassemble.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
class TestDAP_disassemble(lldbdap_testcase.DAPTestCaseBase):
1515
@skipIfWindows
16-
@skipIfRemote
1716
def test_disassemble(self):
1817
"""
1918
Tests the 'disassemble' request.

lldb/test/API/tools/lldb-dap/disconnect/TestDAP_disconnect.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def disconnect_and_assert_no_output_printed(self):
2424
self.assertTrue(output is None or len(output) == 0)
2525

2626
@skipIfWindows
27-
@skipIfRemote
2827
def test_launch(self):
2928
"""
3029
This test launches a process that would creates a file, but we disconnect
@@ -46,7 +45,6 @@ def test_launch(self):
4645
self.assertFalse(os.path.exists(program + ".side_effect"))
4746

4847
@skipIfWindows
49-
@skipIfRemote
5048
@expectedFailureNetBSD
5149
def test_attach(self):
5250
"""

lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,31 +192,26 @@ def run_test_evaluate_expressions(
192192
self.assertEvaluate("my_bool_vec", "size=2")
193193

194194
@skipIfWindows
195-
@skipIfRemote
196195
def test_generic_evaluate_expressions(self):
197196
# Tests context-less expression evaluations
198197
self.run_test_evaluate_expressions(enableAutoVariableSummaries=False)
199198

200199
@skipIfWindows
201-
@skipIfRemote
202200
def test_repl_evaluate_expressions(self):
203201
# Tests expression evaluations that are triggered from the Debug Console
204202
self.run_test_evaluate_expressions("repl", enableAutoVariableSummaries=False)
205203

206204
@skipIfWindows
207-
@skipIfRemote
208205
def test_watch_evaluate_expressions(self):
209206
# Tests expression evaluations that are triggered from a watch expression
210207
self.run_test_evaluate_expressions("watch", enableAutoVariableSummaries=True)
211208

212209
@skipIfWindows
213-
@skipIfRemote
214210
def test_hover_evaluate_expressions(self):
215211
# Tests expression evaluations that are triggered when hovering on the editor
216212
self.run_test_evaluate_expressions("hover", enableAutoVariableSummaries=False)
217213

218214
@skipIfWindows
219-
@skipIfRemote
220215
def test_variable_evaluate_expressions(self):
221216
# Tests expression evaluations that are triggered in the variable explorer
222217
self.run_test_evaluate_expressions("variable", enableAutoVariableSummaries=True)

lldb/test/API/tools/lldb-dap/exception/TestDAP_exception.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010

1111
class TestDAP_exception(lldbdap_testcase.DAPTestCaseBase):
12-
@skipIfRemote
1312
@skipIfWindows
1413
def test_stopped_description(self):
1514
"""

0 commit comments

Comments
 (0)