Skip to content

Commit 6a0796d

Browse files
committed
[llvm-lit][test] Precommit tests for curly braces in lit internal shell
This patch creates tests to check lit's failure to execute curly braces {}.
1 parent 9f6b440 commit 6a0796d

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Test curly braces used in grouping commands.
2+
3+
## Test one command inside curly brace.
4+
# RUN: { echo bar; } | FileCheck --check-prefix=ONE-CMD
5+
6+
# ONE-CMD: bar
7+
8+
## Test two commands inside curly brace.
9+
# RUN: { echo foo; echo bar; } | FileCheck --check-prefix=TWO-CMDS
10+
11+
# TWO-CMDS: foo
12+
# TWO-CMDS: bar

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444

4545
# CHECK: PASS: shtest-shell :: continuations.txt
4646

47+
# CHECK: FAIL: shtest-shell :: curly-brace.txt
48+
# CHECK: # executed command: '{' echo bar
49+
# CHECK-NEXT: # .---command stderr------------
50+
# CHECK-NEXT: # | '{': command not found
51+
# CHECK: error: command failed with exit status: 127
52+
4753
# CHECK: PASS: shtest-shell :: dev-null.txt
4854

4955
# CHECK: FAIL: shtest-shell :: diff-b.txt
@@ -651,4 +657,4 @@
651657

652658
# CHECK: PASS: shtest-shell :: valid-shell.txt
653659
# CHECK: Unresolved Tests (1)
654-
# CHECK: Failed Tests (38)
660+
# CHECK: Failed Tests (39)

0 commit comments

Comments
 (0)