diff options
| author | Reid Kleckner <rnk@google.com> | 2017-08-31 17:07:35 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2017-08-31 17:07:35 +0000 |
| commit | 866df0d1ae3a7abe26d6a55e5e184193720fdc32 (patch) | |
| tree | 5b20d4c88c7ddcc65ed7b726056e9a2d663c377c /llvm/utils | |
| parent | 7081f029f3d05232a6f5691aba93c4c2e8486b35 (diff) | |
| download | bcm5719-llvm-866df0d1ae3a7abe26d6a55e5e184193720fdc32.tar.gz bcm5719-llvm-866df0d1ae3a7abe26d6a55e5e184193720fdc32.zip | |
[lit] Make symlinks in test paths work a different way
Use os.path.normpath instead of realpath to collapse '..' and '.' path
components. Use realpath when caching search results about a path for
good measure.
I considered rigging up a test involving symlinks for this, but I doubt
I can check a symlink into SVN. The test would have to conditionally
create a symlink at runtime if the host OS supports it. This sounds too
fragile and complicated to me to be worth it.
llvm-svn: 312254
Diffstat (limited to 'llvm/utils')
| -rw-r--r-- | llvm/utils/lit/lit/discovery.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/utils/lit/lit/discovery.py b/llvm/utils/lit/lit/discovery.py index 4befe582d45..ea6143d8166 100644 --- a/llvm/utils/lit/lit/discovery.py +++ b/llvm/utils/lit/lit/discovery.py @@ -52,13 +52,14 @@ def getTestSuite(item, litConfig, cache): def search(path): # Check for an already instantiated test suite. - res = cache.get(path) + real_path = os.path.realpath(path) + res = cache.get(real_path) if res is None: - cache[path] = res = search1(path) + cache[real_path] = res = search1(path) return res # Canonicalize the path. - item = os.path.realpath(item) + item = os.path.normpath(item) # Skip files and virtual components. components = [] |

