[PATCH] D19757: [lit] Add %:[STpst] to represent paths without Windows drive letters.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 30 14:38:11 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL268168: [lit] Add %:[STpst] to represent paths without colons on Windows. (authored by ruiu).

Changed prior to commit:
  http://reviews.llvm.org/D19757?vs=55697&id=55723#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19757

Files:
  llvm/trunk/utils/lit/lit/TestRunner.py

Index: llvm/trunk/utils/lit/lit/TestRunner.py
===================================================================
--- llvm/trunk/utils/lit/lit/TestRunner.py
+++ llvm/trunk/utils/lit/lit/TestRunner.py
@@ -568,6 +568,24 @@
             ('%/t', tmpBase.replace('\\', '/') + '.tmp'),
             ('%/T', tmpDir.replace('\\', '/')),
             ])
+
+    # "%:[STpst]" are paths without colons.
+    if kIsWindows:
+        substitutions.extend([
+                ('%:s', re.sub(r'^(.):', r'\1', sourcepath)),
+                ('%:S', re.sub(r'^(.):', r'\1', sourcedir)),
+                ('%:p', re.sub(r'^(.):', r'\1', sourcedir)),
+                ('%:t', re.sub(r'^(.):', r'\1', tmpBase) + '.tmp'),
+                ('%:T', re.sub(r'^(.):', r'\1', tmpDir)),
+                ])
+    else:
+        substitutions.extend([
+                ('%:s', sourcepath),
+                ('%:S', sourcedir),
+                ('%:p', sourcedir),
+                ('%:t', tmpBase + '.tmp'),
+                ('%:T', tmpDir),
+                ])
     return substitutions
 
 def applySubstitutions(script, substitutions):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19757.55723.patch
Type: text/x-patch
Size: 1108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160430/9a02a29a/attachment.bin>


More information about the llvm-commits mailing list