[Lldb-commits] [lldb] ae7a3e1 - [test][lldb-vscode] Un-realpath coreFile test.

Jordan Rupprecht via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 21 08:32:56 PST 2022


Author: Jordan Rupprecht
Date: 2022-11-21T08:32:49-08:00
New Revision: ae7a3e1c1d3ed7125c2436b9fd50512f7548acd7

URL: https://github.com/llvm/llvm-project/commit/ae7a3e1c1d3ed7125c2436b9fd50512f7548acd7
DIFF: https://github.com/llvm/llvm-project/commit/ae7a3e1c1d3ed7125c2436b9fd50512f7548acd7.diff

LOG: [test][lldb-vscode] Un-realpath coreFile test.

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).

Differential Revision: https://reviews.llvm.org/D138345

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py b/lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
index b9018ab6db501..ee6993953221f 100644
--- a/lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
+++ b/lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
@@ -17,7 +17,7 @@ class TestVSCode_coreFile(lldbvscode_testcase.VSCodeTestCaseBase):
     @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 @@ def test_core_file(self):
     @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")
 


        


More information about the lldb-commits mailing list