[lldb] [test/lldb-vscode] Use realpath to match vscode behavior
authorMichal Gorny <mgorny@gentoo.org>
Tue, 30 Jul 2019 07:47:22 +0000 (07:47 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Tue, 30 Jul 2019 07:47:22 +0000 (07:47 +0000)
Compare the directory paths returned by lldb-vscode against realpaths
rather than apparent paths.  This matches lldb-vscode behavior
and therefore fixes test failures when one of the parent directories
of the source tree is a symlink.

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

llvm-svn: 367291

lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py

index 16d8557..77c67c8 100644 (file)
@@ -68,7 +68,8 @@ class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase):
             directory.
         '''
         program = self.getBuildArtifact("a.out")
-        program_parent_dir = os.path.dirname(os.path.dirname(program))
+        program_parent_dir = os.path.realpath(
+            os.path.dirname(os.path.dirname(program)))
         self.build_and_launch(program,
                               cwd=program_parent_dir)
         self.continue_to_exit()
@@ -96,7 +97,8 @@ class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase):
             the lldb-vscode debug adaptor.
         '''
         program = self.getBuildArtifact("a.out")
-        program_parent_dir = os.path.dirname(os.path.dirname(program))
+        program_parent_dir = os.path.realpath(
+            os.path.dirname(os.path.dirname(program)))
         commands = ['platform shell echo cwd = $PWD']
         self.build_and_launch(program,
                               debuggerRoot=program_parent_dir,