[Lldb-commits] [PATCH] D138345: [test][lldb-vscode] Un-realpath coreFile test.

Jordan Rupprecht via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 18 18:23:07 PST 2022


rupprecht created this revision.
rupprecht added a reviewer: wallace.
Herald added a project: All.
rupprecht requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

TestVSCode_coreFile looks for an exe/core file in the same directory as the test. It first calls `realpath`, but I don't think it's necessary. Using `realpath` prevents this test from working when run as part of a build system that uses content-addressed-storage, i.e. all the files might all be symlinks in the same directory pointing to files in different directories elsewhere. If some amount of normalization is needed, maybe `os.path.normpath()` would be useful, although I wouldn't see why that's needed either.

(This is a fairly trivial patch, but I'm mailing it to see if there is a reason we need to keep `realpath`, and if so, if there's some other workaround we can do).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138345

Files:
  lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py


Index: lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
===================================================================
--- lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
+++ lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
@@ -17,7 +17,7 @@
     @skipIfRemote
     @skipIfLLVMTargetMissing("X86")
     def test_core_file(self):
-        current_dir = os.path.dirname(os.path.realpath(__file__))
+        current_dir = os.path.dirname(__file__)
         exe_file = os.path.join(current_dir, "linux-x86_64.out")
         core_file = os.path.join(current_dir, "linux-x86_64.core")
 
@@ -44,7 +44,7 @@
     @skipIfLLVMTargetMissing("X86")
     def test_core_file_source_mapping(self):
         ''' Test that sourceMap property is correctly applied when loading a core '''
-        current_dir = os.path.dirname(os.path.realpath(__file__))
+        current_dir = os.path.dirname(__file__)
         exe_file = os.path.join(current_dir, "linux-x86_64.out")
         core_file = os.path.join(current_dir, "linux-x86_64.core")
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138345.476644.patch
Type: text/x-patch
Size: 1072 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221119/16fbb3be/attachment.bin>


More information about the lldb-commits mailing list