summaryrefslogtreecommitdiff
path: root/lldb/test/API/python_api/debugger/TestDebuggerAPI.py
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2022-03-09 16:52:51 +0100
committerPavel Labath <pavel@labath.sk>2022-03-09 16:54:24 +0100
commit49cffe3c7fab74252d4b6a073303c803dc1659f0 (patch)
treea6857c4fdc619b7fa56a89d4002a7d23673965f5 /lldb/test/API/python_api/debugger/TestDebuggerAPI.py
parent38101b4e95aa4983b7acf1e6351309db9ce5761b (diff)
[lldb] Fix TestDebuggerAPI on windows (broken by D120810)
Diffstat (limited to 'lldb/test/API/python_api/debugger/TestDebuggerAPI.py')
-rw-r--r--lldb/test/API/python_api/debugger/TestDebuggerAPI.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/lldb/test/API/python_api/debugger/TestDebuggerAPI.py b/lldb/test/API/python_api/debugger/TestDebuggerAPI.py
index f0ba1d1e20aa..79619c8fa1d7 100644
--- a/lldb/test/API/python_api/debugger/TestDebuggerAPI.py
+++ b/lldb/test/API/python_api/debugger/TestDebuggerAPI.py
@@ -108,7 +108,9 @@ class DebuggerAPITestCase(TestBase):
False, error)
self.assertSuccess(error)
platform2 = target2.GetPlatform()
- self.assertEqual(platform2.GetWorkingDirectory(), "/foo/bar")
+ # On windows, the path will come back as \foo\bar. That's most likely a
+ # bug, but this is not related to what we're testing here.
+ self.assertIn(platform2.GetWorkingDirectory(), ["/foo/bar", r"\foo\bar"])
# ... but create a new one if it doesn't.
self.dbg.SetSelectedPlatform(lldb.SBPlatform("remote-windows"))
@@ -123,9 +125,11 @@ class DebuggerAPITestCase(TestBase):
if lldbplatformutil.getHostPlatform() == 'linux':
self.yaml2obj("macho.yaml", exe)
arch = "x86_64-apple-macosx"
+ platform_name = "remote-macosx"
else:
self.yaml2obj("elf.yaml", exe)
arch = "x86_64-pc-linux"
+ platform_name = "remote-linux"
fbsd = lldb.SBPlatform("remote-freebsd")
self.dbg.SetSelectedPlatform(fbsd)
@@ -134,7 +138,7 @@ class DebuggerAPITestCase(TestBase):
target1 = self.dbg.CreateTarget(exe, arch, None, False, error)
self.assertSuccess(error)
platform1 = target1.GetPlatform()
- self.assertEqual(platform1.GetName(), "remote-macosx")
+ self.assertEqual(platform1.GetName(), platform_name)
platform1.SetWorkingDirectory("/foo/bar")
# Reuse a platform even if it is not currently selected.
@@ -142,5 +146,7 @@ class DebuggerAPITestCase(TestBase):
target2 = self.dbg.CreateTarget(exe, arch, None, False, error)
self.assertSuccess(error)
platform2 = target2.GetPlatform()
- self.assertEqual(platform2.GetName(), "remote-macosx")
- self.assertEqual(platform2.GetWorkingDirectory(), "/foo/bar")
+ self.assertEqual(platform2.GetName(), platform_name)
+ # On windows, the path will come back as \foo\bar. That's most likely a
+ # bug, but this is not related to what we're testing here.
+ self.assertIn(platform2.GetWorkingDirectory(), ["/foo/bar", r"\foo\bar"])