Skip to content

Commit 49cffe3

Browse files
committed
[lldb] Fix TestDebuggerAPI on windows (broken by D120810)
1 parent 38101b4 commit 49cffe3

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lldb/test/API/python_api/debugger/TestDebuggerAPI.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ def test_CreateTarget_platform(self):
108108
False, error)
109109
self.assertSuccess(error)
110110
platform2 = target2.GetPlatform()
111-
self.assertEqual(platform2.GetWorkingDirectory(), "/foo/bar")
111+
# On windows, the path will come back as \foo\bar. That's most likely a
112+
# bug, but this is not related to what we're testing here.
113+
self.assertIn(platform2.GetWorkingDirectory(), ["/foo/bar", r"\foo\bar"])
112114

113115
# ... but create a new one if it doesn't.
114116
self.dbg.SetSelectedPlatform(lldb.SBPlatform("remote-windows"))
@@ -123,9 +125,11 @@ def test_CreateTarget_arch(self):
123125
if lldbplatformutil.getHostPlatform() == 'linux':
124126
self.yaml2obj("macho.yaml", exe)
125127
arch = "x86_64-apple-macosx"
128+
platform_name = "remote-macosx"
126129
else:
127130
self.yaml2obj("elf.yaml", exe)
128131
arch = "x86_64-pc-linux"
132+
platform_name = "remote-linux"
129133

130134
fbsd = lldb.SBPlatform("remote-freebsd")
131135
self.dbg.SetSelectedPlatform(fbsd)
@@ -134,13 +138,15 @@ def test_CreateTarget_arch(self):
134138
target1 = self.dbg.CreateTarget(exe, arch, None, False, error)
135139
self.assertSuccess(error)
136140
platform1 = target1.GetPlatform()
137-
self.assertEqual(platform1.GetName(), "remote-macosx")
141+
self.assertEqual(platform1.GetName(), platform_name)
138142
platform1.SetWorkingDirectory("/foo/bar")
139143

140144
# Reuse a platform even if it is not currently selected.
141145
self.dbg.SetSelectedPlatform(fbsd)
142146
target2 = self.dbg.CreateTarget(exe, arch, None, False, error)
143147
self.assertSuccess(error)
144148
platform2 = target2.GetPlatform()
145-
self.assertEqual(platform2.GetName(), "remote-macosx")
146-
self.assertEqual(platform2.GetWorkingDirectory(), "/foo/bar")
149+
self.assertEqual(platform2.GetName(), platform_name)
150+
# On windows, the path will come back as \foo\bar. That's most likely a
151+
# bug, but this is not related to what we're testing here.
152+
self.assertIn(platform2.GetWorkingDirectory(), ["/foo/bar", r"\foo\bar"])

0 commit comments

Comments
 (0)