[lldb] Fix tests to resolve symlinks when checking paths (#132053)

The inferior used in the process launch test prints out its working
directory using the `getcwd` function, which is not allowed to return
symbolic links in the path components. When testing against the output
from `getcwd` we should resolve the full path to match the expected
output.

The source manager test sets a breakpoint on a main-copy.c file that is
copied into the build output directory. The source manager resolves this
path to its real location. When testing the output from the source cache
we need to resolve the expected path in the test to remove symlinks.
This commit is contained in:
David Peixotto 2025-03-21 09:02:27 -07:00 committed by GitHub
parent 954a3de783
commit f8865aa876
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -220,7 +220,7 @@ class ProcessLaunchTestCase(TestBase):
mywd = "my_working_dir"
out_file_name = "my_working_dir_test.out"
my_working_dir_path = self.getBuildArtifact(mywd)
my_working_dir_path = Path(self.getBuildArtifact(mywd)).resolve()
lldbutil.mkdir_p(my_working_dir_path)
out_file_path = os.path.join(my_working_dir_path, out_file_name)
another_working_dir_path = Path(

View File

@ -35,7 +35,7 @@ class SourceManagerTestCase(TestBase):
# Call super's setUp().
TestBase.setUp(self)
# Find the line number to break inside main().
self.file = self.getBuildArtifact("main-copy.c")
self.file = os.path.realpath(self.getBuildArtifact("main-copy.c"))
self.line = line_number("main.c", "// Set break point at this line.")
def modify_content(self):