From 9da05740d34ef6cb0cb695d9df0b0a36d7f7951e Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 31 Aug 2017 21:56:14 +0000 Subject: [lit] Fix some issues with short paths in test discovery introduced in r312254 llvm-svn: 312288 --- llvm/utils/lit/lit/discovery.py | 2 +- llvm/utils/lit/tests/discovery.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/llvm/utils/lit/lit/discovery.py b/llvm/utils/lit/lit/discovery.py index ea6143d8166..8876dcba8f2 100644 --- a/llvm/utils/lit/lit/discovery.py +++ b/llvm/utils/lit/lit/discovery.py @@ -59,7 +59,7 @@ def getTestSuite(item, litConfig, cache): return res # Canonicalize the path. - item = os.path.normpath(item) + item = os.path.normpath(os.path.join(os.getcwd(), item)) # Skip files and virtual components. components = [] diff --git a/llvm/utils/lit/tests/discovery.py b/llvm/utils/lit/tests/discovery.py index 3eea320ccfb..7d71436b0fe 100644 --- a/llvm/utils/lit/tests/discovery.py +++ b/llvm/utils/lit/tests/discovery.py @@ -90,6 +90,13 @@ # RUN: -j 1 --show-tests --show-suites -v > %t.out # RUN: FileCheck --check-prefix=CHECK-ASEXEC-INTREE < %t.out %s # +# Try it again after cd'ing into the test suite using a short relative path. +# +# RUN: cd %{inputs}/exec-discovery-in-tree/obj/ +# RUN: %{lit} . \ +# RUN: -j 1 --show-tests --show-suites -v > %t.out +# RUN: FileCheck --check-prefix=CHECK-ASEXEC-INTREE < %t.out %s +# # CHECK-ASEXEC-INTREE: exec-discovery-in-tree-suite - 1 tests # CHECK-ASEXEC-INTREE-NEXT: Source Root: {{.*[/\\]exec-discovery-in-tree$}} # CHECK-ASEXEC-INTREE-NEXT: Exec Root : {{.*[/\\]exec-discovery-in-tree[/\\]obj$}} -- cgit v1.2.3