Commit efde68c
committed
[lldb] Change test paths to resolve symlinks
This commit modifes the `getSourceDir()` and `getBuildDir()` functions
to use os.path.realpath to resolve symlinks in the Base test class used
for API tests.
A few tests were failing when the build and source directories were
located under a path that contained a symlink. These failures were
because of cases where the symlink would be resolve to its real path
in the source code, but the test code would try to match against
the path with the symbolic link.
Two failing tests were
TestProcessLaunch.test_target_launch_working_dir_prop
TestSourceManager.test_source_cache_dump_and_clear
The inferior used `TestProcessLaunch` 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 `TestSourceManager` test sets a breakpoint on a main-copy.c file
that is copied into the build output directory. The source manager
resolves this file to its real location. When testing the output from
the source cache we need to resolve the expected path to remove
symlinks.1 parent 2e39533 commit efde68c
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
725 | | - | |
| 725 | + | |
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
732 | | - | |
733 | | - | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
734 | 736 | | |
735 | 737 | | |
736 | 738 | | |
| |||
0 commit comments