summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/utils/lit/lit/TestRunner.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index c791b4274f8..38224add85a 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -568,6 +568,24 @@ def getDefaultSubstitutions(test, tmpDir, tmpBase, normalize_slashes=False):
('%/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):
OpenPOWER on IntegriCloud