Skip to content

Commit d18ca27

Browse files
authored
Reapply "[llvm-lit] Add precommit test to verify current behavior of glob expansion in lit's internal shell" (#106763) (#107169)
This reverts commit 5af4ba2. The previous patch was missing the closing parenthesis `)` in the `CHECK` statement in the `llvm/utils/lit/tests/shtest-glob.py` file: `# CHECK: FAIL: shtest-glob :: glob-mkdir.txt ({{[^)]*}}` This issue broke some build bots. This patch corrects the `CHECK` statement by adding the closing parenthesis: `# CHECK: FAIL: shtest-glob :: glob-mkdir.txt ({{[^)]*}})`
1 parent 787fc81 commit d18ca27

File tree

6 files changed

+28
-0
lines changed

6 files changed

+28
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## This is the first example file used for testing glob pattern matching.
2+
This is the first example file.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## This is the second example file used for testing glob pattern matching.
2+
This is the second example file.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## Tests glob pattern expansion by listing matching files.
2+
# RUN: echo %S/example_file*.input
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## Tests glob pattern handling in the mkdir command.
2+
# RUN: not mkdir %S/example_file*.input
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import lit.formats
2+
3+
config.name = "shtest-glob"
4+
config.suffixes = [".txt"]
5+
config.test_format = lit.formats.ShTest()
6+
config.test_source_root = None
7+
config.test_exec_root = None
8+
config.substitutions.append(("%{python}", '"%s"' % (sys.executable)))

llvm/utils/lit/tests/shtest-glob.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Tests glob pattern handling in echo command.
2+
3+
# RUN: not %{lit} -a -v %{inputs}/shtest-glob \
4+
# RUN: | FileCheck -dump-input=fail -match-full-lines %s
5+
#
6+
# END.
7+
8+
# CHECK: UNRESOLVED: shtest-glob :: glob-echo.txt ({{[^)]*}})
9+
# CHECK: TypeError: string argument expected, got 'GlobItem'
10+
11+
# CHECK: FAIL: shtest-glob :: glob-mkdir.txt ({{[^)]*}})
12+
# CHECK: # error: command failed with exit status: 1

0 commit comments

Comments
 (0)