Skip to content

[lldb-dap] Automatically skip lldb-dap tests for remote platforms #93169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions lldb/packages/Python/lldbsuite/test/dotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,6 @@ def setupSysPath():
lldbDAPExec = os.path.join(lldbDir, "lldb-dap")
if is_exe(lldbDAPExec):
os.environ["LLDBDAP_EXEC"] = lldbDAPExec
else:
if not configuration.shouldSkipBecauseOfCategories(["lldb-dap"]):
print(
"The 'lldb-dap' executable cannot be located. The lldb-dap tests can not be run as a result."
)
configuration.skip_categories.append("lldb-dap")

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

Expand Down Expand Up @@ -929,6 +923,24 @@ def checkPexpectSupport():
configuration.skip_categories.append("pexpect")


def checkDAPSupport():
import lldb

if "LLDBDAP_EXEC" not in os.environ:
msg = (
"The 'lldb-dap' executable cannot be located and its tests will not be run."
)
elif lldb.remote_platform:
msg = "lldb-dap tests are not compatible with remote platforms and will not be run."
else:
msg = None

if msg:
if configuration.verbose:
print(msg)
configuration.skip_categories.append("lldb-dap")


def run_suite():
# On MacOS X, check to make sure that domain for com.apple.DebugSymbols defaults
# does not exist before proceeding to running the test suite.
Expand Down Expand Up @@ -1029,6 +1041,7 @@ def run_suite():
checkObjcSupport()
checkForkVForkSupport()
checkPexpectSupport()
checkDAPSupport()

skipped_categories_list = ", ".join(configuration.skip_categories)
print(
Expand Down
2 changes: 0 additions & 2 deletions lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def set_and_hit_breakpoint(self, continueToExit=True):

@skipIfWindows
@skipIfNetBSD # Hangs on NetBSD as well
@skipIfRemote
def test_by_pid(self):
"""
Tests attaching to a process by process ID.
Expand All @@ -59,7 +58,6 @@ def test_by_pid(self):

@skipIfWindows
@skipIfNetBSD # Hangs on NetBSD as well
@skipIfRemote
def test_by_name(self):
"""
Tests attaching to a process by process name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def setUp(self):
self.main_path = os.path.realpath(self.getBuildArtifact(self.main_basename))

@skipIfWindows
@skipIfRemote
def test_logmessage_basic(self):
"""Tests breakpoint logmessage basic functionality."""
before_loop_line = line_number("main.cpp", "// before loop")
Expand Down Expand Up @@ -83,7 +82,6 @@ def test_logmessage_basic(self):
self.assertRegex(logMessage_line, reg_str)

@skipIfWindows
@skipIfRemote
def test_logmessage_advanced(self):
"""Tests breakpoint logmessage functionality for complex expression."""
before_loop_line = line_number("main.cpp", "// before loop")
Expand Down Expand Up @@ -144,7 +142,6 @@ def test_logmessage_advanced(self):
self.assertEqual(logMessage_line, logMessage_prefix + str(result))

@skipIfWindows
@skipIfRemote
def test_logmessage_format(self):
"""
Tests breakpoint logmessage functionality with format.
Expand Down Expand Up @@ -209,7 +206,6 @@ def test_logmessage_format(self):
)

@skipIfWindows
@skipIfRemote
def test_logmessage_format_failure(self):
"""
Tests breakpoint logmessage format with parsing failure.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def setUp(self):
self.main_path = os.path.realpath(self.getBuildArtifact(self.main_basename))

@skipIfWindows
@skipIfRemote
def test_source_map(self):
"""
This test simulates building two files in a folder, and then moving
Expand Down Expand Up @@ -99,7 +98,6 @@ def test_source_map(self):
self.assertEqual(frames[1]["source"]["path"], new_main_path)

@skipIfWindows
@skipIfRemote
def test_set_and_clear(self):
"""Tests setting and clearing source file and line breakpoints.
This packet is a bit tricky on the debug adaptor side since there
Expand Down Expand Up @@ -261,7 +259,6 @@ def test_set_and_clear(self):
)

@skipIfWindows
@skipIfRemote
def test_clear_breakpoints_unset_breakpoints(self):
"""Test clearing breakpoints like test_set_and_clear, but clear
breakpoints by omitting the breakpoints array instead of sending an
Expand Down Expand Up @@ -305,7 +302,6 @@ def test_clear_breakpoints_unset_breakpoints(self):
self.assertEqual(len(breakpoints), 0, "expect no source breakpoints")

@skipIfWindows
@skipIfRemote
def test_functionality(self):
"""Tests hitting breakpoints and the functionality of a single
breakpoint, like 'conditions' and 'hitCondition' settings."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

class TestDAP_setExceptionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
@skipIfWindows
@skipIfRemote
def test_functionality(self):
"""Tests setting and clearing exception breakpoints.
This packet is a bit tricky on the debug adaptor side since there
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

class TestDAP_setFunctionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
@skipIfWindows
@skipIfRemote
def test_set_and_clear(self):
"""Tests setting and clearing function breakpoints.
This packet is a bit tricky on the debug adaptor side since there
Expand Down Expand Up @@ -123,7 +122,6 @@ def test_set_and_clear(self):
)

@skipIfWindows
@skipIfRemote
def test_functionality(self):
"""Tests hitting breakpoints and the functionality of a single
breakpoint, like 'conditions' and 'hitCondition' settings."""
Expand Down
2 changes: 0 additions & 2 deletions lldb/test/API/tools/lldb-dap/commands/TestDAP_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class TestDAP_commands(lldbdap_testcase.DAPTestCaseBase):
@skipIfRemote
def test_command_directive_quiet_on_success(self):
program = self.getBuildArtifact("a.out")
command_quiet = (
Expand Down Expand Up @@ -61,7 +60,6 @@ def test_command_directive_abort_on_error_launch_commands(self):
def test_command_directive_abort_on_error_pre_run_commands(self):
self.do_test_abort_on_error(use_pre_run_commands=True)

@skipIfRemote
def test_command_directive_abort_on_error_post_run_commands(self):
self.do_test_abort_on_error(use_post_run_commands=True)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def verify_completions(self, actual_list, expected_list, not_expected_list=[]):
self.assertNotIn(not_expected_item, actual_list)

@skipIfWindows
@skipIfRemote
@skipIf(compiler="clang", compiler_version=["<", "17.0"])
def test_completions(self):
"""
Expand Down
5 changes: 0 additions & 5 deletions lldb/test/API/tools/lldb-dap/console/TestDAP_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def check_lldb_command(
)

@skipIfWindows
@skipIfRemote
def test_scopes_variables_setVariable_evaluate(self):
"""
Tests that the "scopes" request causes the currently selected
Expand Down Expand Up @@ -82,7 +81,6 @@ def test_scopes_variables_setVariable_evaluate(self):
self.check_lldb_command("frame select", "frame #1", "frame 1 is selected")

@skipIfWindows
@skipIfRemote
def test_custom_escape_prefix(self):
program = self.getBuildArtifact("a.out")
self.build_and_launch(program, commandEscapePrefix="::")
Expand All @@ -99,7 +97,6 @@ def test_custom_escape_prefix(self):
)

@skipIfWindows
@skipIfRemote
def test_empty_escape_prefix(self):
program = self.getBuildArtifact("a.out")
self.build_and_launch(program, commandEscapePrefix="")
Expand All @@ -116,7 +113,6 @@ def test_empty_escape_prefix(self):
)

@skipIfWindows
@skipIfRemote
def test_exit_status_message_sigterm(self):
source = "main.cpp"
program = self.getBuildArtifact("a.out")
Expand Down Expand Up @@ -154,7 +150,6 @@ def test_exit_status_message_sigterm(self):
)

@skipIfWindows
@skipIfRemote
def test_exit_status_message_ok(self):
source = "main.cpp"
program = self.getBuildArtifact("a.out")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class TestDAP_redirection_to_console(lldbdap_testcase.DAPTestCaseBase):
@skipIfWindows
@skipIfRemote
def test(self):
"""
Without proper stderr and stdout redirection, the following code would throw an
Expand Down
2 changes: 0 additions & 2 deletions lldb/test/API/tools/lldb-dap/coreFile/TestDAP_coreFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

class TestDAP_coreFile(lldbdap_testcase.DAPTestCaseBase):
@skipIfWindows
@skipIfRemote
@skipIfLLVMTargetMissing("X86")
def test_core_file(self):
current_dir = os.path.dirname(__file__)
Expand Down Expand Up @@ -60,7 +59,6 @@ def test_core_file(self):
self.assertEqual(self.get_stackFrames(), expected_frames)

@skipIfWindows
@skipIfRemote
@skipIfLLVMTargetMissing("X86")
def test_core_file_source_mapping(self):
"""Test that sourceMap property is correctly applied when loading a core"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def setUp(self):
self.accessTypes = ["read", "write", "readWrite"]

@skipIfWindows
@skipIfRemote
def test_duplicate_start_addresses(self):
"""Test setDataBreakpoints with multiple watchpoints starting at the same addresses."""
program = self.getBuildArtifact("a.out")
Expand Down Expand Up @@ -58,7 +57,6 @@ def test_duplicate_start_addresses(self):
self.assertEqual(i_val, "2")

@skipIfWindows
@skipIfRemote
def test_expression(self):
"""Tests setting data breakpoints on expression."""
program = self.getBuildArtifact("a.out")
Expand Down Expand Up @@ -99,7 +97,6 @@ def test_expression(self):
self.assertEqual(i_val, "2")

@skipIfWindows
@skipIfRemote
def test_functionality(self):
"""Tests setting data breakpoints on variable."""
program = self.getBuildArtifact("a.out")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

class TestDAP_disassemble(lldbdap_testcase.DAPTestCaseBase):
@skipIfWindows
@skipIfRemote
def test_disassemble(self):
"""
Tests the 'disassemble' request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def disconnect_and_assert_no_output_printed(self):
self.assertTrue(output is None or len(output) == 0)

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

@skipIfWindows
@skipIfRemote
@expectedFailureNetBSD
def test_attach(self):
"""
Expand Down
5 changes: 0 additions & 5 deletions lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,31 +192,26 @@ def run_test_evaluate_expressions(
self.assertEvaluate("my_bool_vec", "size=2")

@skipIfWindows
@skipIfRemote
def test_generic_evaluate_expressions(self):
# Tests context-less expression evaluations
self.run_test_evaluate_expressions(enableAutoVariableSummaries=False)

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

@skipIfWindows
@skipIfRemote
def test_watch_evaluate_expressions(self):
# Tests expression evaluations that are triggered from a watch expression
self.run_test_evaluate_expressions("watch", enableAutoVariableSummaries=True)

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

@skipIfWindows
@skipIfRemote
def test_variable_evaluate_expressions(self):
# Tests expression evaluations that are triggered in the variable explorer
self.run_test_evaluate_expressions("variable", enableAutoVariableSummaries=True)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class TestDAP_exception(lldbdap_testcase.DAPTestCaseBase):
@skipIfRemote
@skipIfWindows
def test_stopped_description(self):
"""
Expand Down
Loading
Loading