]> granicus.if.org Git - llvm/commitdiff
[lit] Fix some issues with short paths in test discovery introduced in r312254
authorReid Kleckner <rnk@google.com>
Thu, 31 Aug 2017 21:56:14 +0000 (21:56 +0000)
committerReid Kleckner <rnk@google.com>
Thu, 31 Aug 2017 21:56:14 +0000 (21:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312288 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/lit/discovery.py
utils/lit/tests/discovery.py

index ea6143d816624dc5f97752f1555c3609b4f360ea..8876dcba8f255c20b47aa207c83f19f7cb0b6a93 100644 (file)
@@ -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 = []
index 3eea320ccfbbaea0e1145c3dea4f82cb49363094..7d71436b0fe7396e0ca63a3a4f905c07d6a3436a 100644 (file)
 # 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$}}