[Lldb-commits] [PATCH] D58465: testsuite: Fix TestCompDirSymLink and TestSourceManager on Linux with symlinked build dir

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 21 01:05:05 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB354556: testsuite: Fix TestCompDirSymLink and TestSourceManager on Linux with symlinked… (authored by jankratochvil, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D58465?vs=187666&id=187733#toc

Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58465/new/

https://reviews.llvm.org/D58465

Files:
  packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
  packages/Python/lldbsuite/test/source-manager/TestSourceManager.py


Index: packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
===================================================================
--- packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
+++ packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
@@ -48,6 +48,8 @@
             "settings set %s %s" %
             (_COMP_DIR_SYM_LINK_PROP, pwd_symlink))
         src_path = self.getBuildArtifact(_SRC_FILE)
+        # /proc/self/cwd points to a realpath form of current directory.
+        src_path = os.path.realpath(src_path)
         lldbutil.run_break_set_by_file_and_line(self, src_path, self.line)
 
     @skipIf(hostoslist=["windows"])
Index: packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
===================================================================
--- packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
+++ packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
@@ -158,12 +158,15 @@
             error=True,
             substrs=['''error: the replacement path doesn't exist: "/q/r/s/t/u"'''])
 
+        # 'make -C' has resolved current directory to its realpath form.
+        builddir_real = os.path.realpath(self.getBuildDir())
+        hidden_real = os.path.realpath(hidden)
         # Set target.source-map settings.
         self.runCmd("settings set target.source-map %s %s" %
-                    (self.getBuildDir(), hidden))
+                    (builddir_real, hidden_real))
         # And verify that the settings work.
         self.expect("settings show target.source-map",
-                    substrs=[self.getBuildDir(), hidden])
+                    substrs=[builddir_real, hidden_real])
 
         # Display main() and verify that the source mapping has been kicked in.
         self.expect("source list -n main", SOURCE_DISPLAYED_CORRECTLY,
@@ -238,11 +241,14 @@
         self.build()
         hidden = self.getBuildArtifact("hidden")
         lldbutil.mkdir_p(hidden)
+        # 'make -C' has resolved current directory to its realpath form.
+        builddir_real = os.path.realpath(self.getBuildDir())
+        hidden_real = os.path.realpath(hidden)
         self.runCmd("settings set target.source-map %s %s" %
-                    (self.getBuildDir(), hidden))
+                    (builddir_real, hidden_real))
 
         exe = self.getBuildArtifact("a.out")
-        main = os.path.join(self.getBuildDir(), "hidden", "main-copy.c")
+        main = os.path.join(builddir_real, "hidden", "main-copy.c")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58465.187733.patch
Type: text/x-patch
Size: 2734 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190221/09e5e1e2/attachment-0001.bin>


More information about the lldb-commits mailing list