mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-19 00:56:41 +00:00
[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:
parent
954a3de783
commit
f8865aa876
@ -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(
|
||||
|
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user