Skip to content

Commit 19d2338

Browse files
[lit] Remove support for %T
This patch removes support for %T from llvm-lit. For now we mark the test unresolved and add an error message noting the substitution is deprecated. This is exactly the same as the error handling for other substitution failures. We intend to remove support for the nice error message once 22 branches as users should have moved over by the they are upgrading to v23. Reviewers: petrhosek, jh7370, ilovepi, pogo59, cmtice Reviewed By: cmtice, jh7370, ilovepi Pull Request: llvm/llvm-project#160028
1 parent 237ef70 commit 19d2338

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

lit/TestRunner.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,8 +1541,10 @@ def regex_escape(s):
15411541
return s
15421542

15431543
path_substitutions = [
1544-
("s", sourcepath), ("S", sourcedir), ("p", sourcedir),
1545-
("t", tmpName), ("T", tmpDir)
1544+
("s", sourcepath),
1545+
("S", sourcedir),
1546+
("p", sourcedir),
1547+
("t", tmpName),
15461548
]
15471549
for path_substitution in path_substitutions:
15481550
letter = path_substitution[0]
@@ -1919,6 +1921,14 @@ def processLine(ln):
19191921
# seems reasonable.
19201922
ln = _caching_re_compile(a).sub(str(b), escapePercents(ln))
19211923

1924+
# TODO(boomanaiden154): Remove when we branch LLVM 22 so people on the
1925+
# release branch will have sufficient time to migrate.
1926+
if bool(_caching_re_compile("%T").search(ln)):
1927+
raise ValueError(
1928+
"%T is no longer supported. Please create directories with names "
1929+
"based on %t."
1930+
)
1931+
19221932
# Strip the trailing newline and any extra whitespace.
19231933
return ln.strip()
19241934

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Check that we return a decent error message when someone uses %T
2+
# RUN: echo %T > %t

tests/shtest-shell.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
# CHECK: -- Testing:
1414

15+
# CHECK: UNRESOLVED: shtest-shell :: capital-t-error-message.txt
16+
# CHECK: *** TEST 'shtest-shell :: capital-t-error-message.txt' FAILED ***
17+
# CHECK: ValueError: %T is no longer supported. Please create directories with names based on %t.
18+
1519
# CHECK: FAIL: shtest-shell :: colon-error.txt
1620
# CHECK: *** TEST 'shtest-shell :: colon-error.txt' FAILED ***
1721
# CHECK: :
@@ -633,5 +637,5 @@
633637
# CHECK: ***
634638

635639
# CHECK: PASS: shtest-shell :: valid-shell.txt
636-
# CHECK: Unresolved Tests (1)
640+
# CHECK: Unresolved Tests (2)
637641
# CHECK: Failed Tests (37)

0 commit comments

Comments
 (0)