Skip to content

Commit 22bb1da

Browse files
[𝘀𝗽𝗿] initial version
Created using spr 1.3.6
2 parents c12f08f + 4ca3009 commit 22bb1da

File tree

7 files changed

+49
-37
lines changed

7 files changed

+49
-37
lines changed

libcxx/utils/libcxx/test/format.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def parseScript(test, preamble):
9292
# errors, which doesn't make sense for clang-verify tests because we may want to check
9393
# for specific warning diagnostics.
9494
_checkBaseSubstitutions(substitutions)
95+
substitutions.append(("%T", tmpDir))
9596
substitutions.append(
9697
("%{build}", "%{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe")
9798
)

llvm/docs/CommandGuide/lit.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -630,13 +630,11 @@ TestRunner.py:
630630
%{fs-sep} file system path separator
631631
%t temporary file name unique to the test
632632
%basename_t The last path component of %t but without the ``.tmp`` extension (deprecated, use ``%{t:stem}`` instead)
633-
%T parent directory of %t (not unique, deprecated, do not use)
634633
%% %
635634
%/s %s but ``\`` is replaced by ``/``
636635
%/S %S but ``\`` is replaced by ``/``
637636
%/p %p but ``\`` is replaced by ``/``
638637
%/t %t but ``\`` is replaced by ``/``
639-
%/T %T but ``\`` is replaced by ``/``
640638
%{s:basename} The last path component of %s
641639
%{t:stem} The last path component of %t but without the ``.tmp`` extension (alias for %basename_t)
642640
%{s:real} %s after expanding all symbolic links and substitute drives
@@ -648,12 +646,10 @@ TestRunner.py:
648646
%{/S:real} %/S after expanding all symbolic links and substitute drives
649647
%{/p:real} %/p after expanding all symbolic links and substitute drives
650648
%{/t:real} %/t after expanding all symbolic links and substitute drives
651-
%{/T:real} %/T after expanding all symbolic links and substitute drives
652649
%{/s:regex_replacement} %/s but escaped for use in the replacement of a ``s@@@`` command in sed
653650
%{/S:regex_replacement} %/S but escaped for use in the replacement of a ``s@@@`` command in sed
654651
%{/p:regex_replacement} %/p but escaped for use in the replacement of a ``s@@@`` command in sed
655652
%{/t:regex_replacement} %/t but escaped for use in the replacement of a ``s@@@`` command in sed
656-
%{/T:regex_replacement} %/T but escaped for use in the replacement of a ``s@@@`` command in sed
657653
%:s On Windows, %/s but a ``:`` is removed if its the second character.
658654
Otherwise, %s but with a single leading ``/`` removed.
659655
%:S On Windows, %/S but a ``:`` is removed if its the second character.
@@ -662,8 +658,6 @@ TestRunner.py:
662658
Otherwise, %p but with a single leading ``/`` removed.
663659
%:t On Windows, %/t but a ``:`` is removed if its the second character.
664660
Otherwise, %t but with a single leading ``/`` removed.
665-
%:T On Windows, %/T but a ``:`` is removed if its the second character.
666-
Otherwise, %T but with a single leading ``/`` removed.
667661
%{readfile:<filename>} Reads the file specified.
668662
======================= ==============
669663

llvm/docs/ReleaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ Changes to the LLVM tools
159159

160160
* `llvm-readelf` now dumps all hex format values in lower-case mode.
161161
* Some code paths for supporting Python 2.7 in `llvm-lit` have been removed.
162+
* Support for `%T` in lit has been removed.
162163

163164
Changes to LLDB
164165
---------------------------------

llvm/utils/lit/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

llvm/utils/lit/tests/Inputs/shtest-shell/valid-shell.txt

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,50 +18,50 @@
1818
# Check force remove commands success whether the directory does or doesn't exist.
1919
#
2020
# Check the mkdir command with -p option.
21-
# RUN: rm -f -r %T/test
22-
# RUN: %{python} %S/../check_path.py dir %T/test > %t.out
21+
# RUN: rm -f -r %t.test
22+
# RUN: %{python} %S/../check_path.py dir %t.test > %t.out
2323
# RUN: FileCheck --check-prefix=REMOVE-PARENT-DIR < %t.out %s
24-
# RUN: mkdir -p %T/test
25-
# RUN: %{python} %S/../check_path.py dir %T/test > %t.out
24+
# RUN: mkdir -p %t.test
25+
# RUN: %{python} %S/../check_path.py dir %t.test > %t.out
2626
# RUN: FileCheck --check-prefix=MAKE-PARENT-DIR < %t.out %s
27-
# RUN: rm -f %T/test || true
28-
# RUN: rm -f -r %T/test
29-
# RUN: %{python} %S/../check_path.py dir %T/test > %t.out
27+
# RUN: rm -f %t.test || true
28+
# RUN: rm -f -r %t.test
29+
# RUN: %{python} %S/../check_path.py dir %t.test > %t.out
3030
# RUN: FileCheck --check-prefix=REMOVE-PARENT-DIR < %t.out %s
3131
#
3232
# MAKE-PARENT-DIR: True
3333
# REMOVE-PARENT-DIR: False
3434
#
3535
# Check the mkdir command without -p option.
3636
#
37-
# RUN: rm -rf %T/test1
38-
# RUN: mkdir %T/test1
39-
# RUN: %{python} %S/../check_path.py dir %T/test1 > %t.out
37+
# RUN: rm -rf %t.test1
38+
# RUN: mkdir %t.test1
39+
# RUN: %{python} %S/../check_path.py dir %t.test1 > %t.out
4040
# RUN: FileCheck --check-prefix=MAKE-DIR < %t.out %s
41-
# RUN: cd %T/test1 && mkdir foo
42-
# RUN: %{python} %S/../check_path.py dir %T/test1 > %t.out
41+
# RUN: cd %t.test1 && mkdir foo
42+
# RUN: %{python} %S/../check_path.py dir %t.test1 > %t.out
4343
# RUN: FileCheck --check-prefix=MAKE-DIR < %t.out %s
44-
# RUN: cd %T && rm -rf %T/test1
45-
# RUN: %{python} %S/../check_path.py dir %T/test1 > %t.out
44+
# RUN: cd .. && rm -rf %t.test1
45+
# RUN: %{python} %S/../check_path.py dir %t.test1 > %t.out
4646
# RUN: FileCheck --check-prefix=REMOVE-DIR < %t.out %s
4747
#
4848
# MAKE-DIR: True
4949
# REMOVE-DIR: False
5050
#
5151
# Check creating and removing multiple folders and rm * operation.
5252
#
53-
# RUN: rm -rf %T/test
54-
# RUN: mkdir -p %T/test/test1 %T/test/test2
55-
# RUN: %{python} %S/../check_path.py dir %T/test %T/test/test1 %T/test/test2 > %t.out
53+
# RUN: rm -rf %t.test
54+
# RUN: mkdir -p %t.test/test1 %t.test/test2
55+
# RUN: %{python} %S/../check_path.py dir %t.test %t.test/test1 %t.test/test2 > %t.out
5656
# RUN: FileCheck --check-prefix=DIRS-EXIST < %t.out %s
57-
# RUN: mkdir %T/test || true
58-
# RUN: echo "create a temp file" > %T/test/temp.write
59-
# RUN: echo "create a temp1 file" > %T/test/test1/temp1.write
60-
# RUN: echo "create a temp2 file" > %T/test/test2/temp2.write
61-
# RUN: %{python} %S/../check_path.py file %T/test/temp.write %T/test/test1/temp1.write %T/test/test2/temp2.write> %t.out
57+
# RUN: mkdir %t.test || true
58+
# RUN: echo "create a temp file" > %t.test/temp.write
59+
# RUN: echo "create a temp1 file" > %t.test/test1/temp1.write
60+
# RUN: echo "create a temp2 file" > %t.test/test2/temp2.write
61+
# RUN: %{python} %S/../check_path.py file %t.test/temp.write %t.test/test1/temp1.write %t.test/test2/temp2.write> %t.out
6262
# RUN: FileCheck --check-prefix=FILES-EXIST < %t.out %s
63-
# RUN: rm -r -f %T/*
64-
# RUN: %{python} %S/../check_path.py dir %T/test > %t.out
63+
# RUN: rm -r -f %t*
64+
# RUN: %{python} %S/../check_path.py dir %t.test > %t.out
6565
# RUN: FileCheck --check-prefix=REMOVE-ALL < %t.out %s
6666
#
6767
# DIRS-EXIST: True
@@ -81,7 +81,7 @@
8181
# RUN: echo "hello-2" > %t1.stdout
8282
# RUN: diff %t.stdout %t1.stdout || true
8383
#
84-
# RUN: mkdir -p %T/dir1 %T/dir2
85-
# RUN: cd %T/dir1 && echo "hello" > temp1.txt
86-
# RUN: cd %T/dir2 && echo "hello" > temp2.txt
87-
# RUN: diff temp2.txt ../dir1/temp1.txt
84+
# RUN: mkdir -p %t.dir1 %t.dir2
85+
# RUN: cd %t.dir1 && echo "hello" > temp1.txt
86+
# RUN: cd %t.dir2 && echo "hello" > temp2.txt
87+
# RUN: diff temp2.txt ../%{t:stem}.tmp.dir1/temp1.txt

llvm/utils/lit/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)