[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
Wed Feb 20 13:37:44 PST 2019


jankratochvil updated this revision to Diff 187666.
jankratochvil retitled this revision from "testsuite: Fix TestCompDirSymLink on Linux with symlinked build dir" to "testsuite: Fix TestCompDirSymLink and TestSourceManager on Linux with symlinked build dir".
jankratochvil edited the summary of this revision.
Herald added a subscriber: abidh.

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D58465

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


Index: lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
+++ lldb/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"'''])
 
+        # Current directory points 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)
+        # Current directory points 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(
Index: lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
+++ lldb/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"])


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58465.187666.patch
Type: text/x-patch
Size: 2732 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190220/2de26ac9/attachment.bin>


More information about the lldb-commits mailing list