[Lldb-commits] [lldb] [lldb][Windows] Fixed unresolved test lldb-api python_api/debugger/TestDebuggerAPI.py (PR #90580)

Dmitry Vasilyev via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 30 02:45:00 PDT 2024


https://github.com/slydiman created https://github.com/llvm/llvm-project/pull/90580

It is necessary to select the expected platform at the beginning. In case of `Windows` host platform1.GetName() returned `host`. platform2.GetName() returned `remote-linux`, but platform2.GetWorkingDirectory() was None and finally
```
  File "llvm-project\lldb\test\API\python_api\debugger\TestDebuggerAPI.py", line 108, in test_CreateTarget_platform
    platform2.GetWorkingDirectory().endswith("bar"),
AttributeError: 'NoneType' object has no attribute 'endswith'
```

>From 0d6ff964ed83e06ed3947d709884ed6dd43e90b5 Mon Sep 17 00:00:00 2001
From: Dmitry Vasilyev <dvassiliev at accesssoftek.com>
Date: Tue, 30 Apr 2024 13:42:45 +0400
Subject: [PATCH] [lldb][Windows] Fixed unresolved test lldb-api
 python_api/debugger/TestDebuggerAPI.py

It is necessary to select the expected platform at the beginning.
In case of `Windows` host platform1.GetName() returned `host`. platform2.GetName() returned `remote-linux`, but platform2.GetWorkingDirectory() was None and finally
```
  File "llvm-project\lldb\test\API\python_api\debugger\TestDebuggerAPI.py", line 108, in test_CreateTarget_platform
    platform2.GetWorkingDirectory().endswith("bar"),
AttributeError: 'NoneType' object has no attribute 'endswith'
```
---
 lldb/test/API/python_api/debugger/TestDebuggerAPI.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lldb/test/API/python_api/debugger/TestDebuggerAPI.py b/lldb/test/API/python_api/debugger/TestDebuggerAPI.py
index 522de2466012ed..3d6484e5c9fbc4 100644
--- a/lldb/test/API/python_api/debugger/TestDebuggerAPI.py
+++ b/lldb/test/API/python_api/debugger/TestDebuggerAPI.py
@@ -95,6 +95,7 @@ def test_CreateTarget_platform(self):
         exe = self.getBuildArtifact("a.out")
         self.yaml2obj("elf.yaml", exe)
         error = lldb.SBError()
+        self.dbg.SetSelectedPlatform(lldb.SBPlatform("remote-linux"))
         target1 = self.dbg.CreateTarget(exe, None, "remote-linux", False, error)
         self.assertSuccess(error)
         platform1 = target1.GetPlatform()



More information about the lldb-commits mailing list