Skip to content

Commit 1b1f24b

Browse files
committed
[lldb-dap] add test case
1 parent d31dae6 commit 1b1f24b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ def test_core_file(self):
6161
self.dap_server.request_next(threadId=32259)
6262
self.assertEqual(self.get_stackFrames(), expected_frames)
6363

64+
def test_wrong_core_file(self):
65+
exe_file = self.getSourcePath("linux-x86_64.out")
66+
wrong_core_file = self.getSourcePath("main.c")
67+
68+
self.create_debug_adapter()
69+
resp = self.attach(
70+
program=exe_file, coreFile=wrong_core_file, expectFailure=True
71+
)
72+
self.assertIsNotNone(resp)
73+
self.assertFalse(resp["success"], "Expected failure in response {resp!r}")
74+
error_msg = resp["body"]["error"]["format"]
75+
76+
# attach my fail for mutilple reasons.
77+
self.assertEqual(error_msg, "Failed to create the process")
78+
6479
@skipIfLLVMTargetMissing("X86")
6580
def test_core_file_source_mapping_array(self):
6681
"""Test that sourceMap property is correctly applied when loading a core"""

0 commit comments

Comments
 (0)