Skip to content

Commit 8b0a81e

Browse files
committed
[lldb][lldb-dap] Rename gotoTarget to gotoTargets and improve validation.
Renamed test files, directories, and references from `gotoTarget` to `gotoTargets` for consistency. Added validation to confirm stopped events include a "goto" reason after goto requests in the test suite. Signed-off-by: Ebuka Ezike <[email protected]>
1 parent 97751c0 commit 8b0a81e

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

lldb/test/API/tools/lldb-dap/gotoTarget/TestDAP_gotoTarget.py renamed to lldb/test/API/tools/lldb-dap/gotoTargets/TestDAP_gotoTargets.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import os
1111

1212

13-
class TestDAP_gotoTarget(lldbdap_testcase.DAPTestCaseBase):
13+
class TestDAP_gotoTargets(lldbdap_testcase.DAPTestCaseBase):
1414
def verify_variable(
1515
self, actual_dict: Dict[str, Any], expected_dict: Dict[str, Any]
1616
):
@@ -61,9 +61,13 @@ def test_default(self):
6161
self.assertIsNotNone(thread_id, "threadId should not be none")
6262

6363
response = self.dap_server.request_goto(thread_id, target_id)
64-
6564
self.assertEqual(response["success"], True, "expects success to go to targetId")
6665

66+
stopped_events = self.dap_server.wait_for_stopped()
67+
is_goto = lambda event: event["body"]["reason"] == "goto"
68+
has_goto_event = any(map(is_goto, stopped_events))
69+
self.assertEqual(has_goto_event, True, "expects stopped event with reason goto")
70+
6771
self.dap_server.request_next(thread_id)
6872
self.continue_to_next_stop()
6973

@@ -118,6 +122,12 @@ def test_execute_again(self):
118122

119123
response = self.dap_server.request_goto(thread_id, target_id)
120124
self.assertEqual(response["success"], True, "expects success to go to targetId")
125+
126+
stopped_events = self.dap_server.wait_for_stopped()
127+
is_goto = lambda event: event["body"]["reason"] == "goto"
128+
has_goto_event = any(map(is_goto, stopped_events))
129+
self.assertEqual(has_goto_event, True, "expects stopped event with reason goto")
130+
121131
self.dap_server.request_next(thread_id)
122132
self.continue_to_next_stop()
123133

0 commit comments

Comments
 (0)