Skip to content

Commit c80249b

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 2b959bd commit c80249b

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 %s
5+
6+
# ONE-CMD: bar
7+
8+
## Test two commands inside curly brace.
9+
# RUN: { echo foo; echo bar; } | FileCheck --check-prefix=TWO-CMDS %s
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
@@ -28,6 +28,12 @@
2828

2929
# CHECK: PASS: shtest-shell :: continuations.txt
3030

31+
# CHECK: FAIL: shtest-shell :: curly-brace.txt
32+
# CHECK: # executed command: '{' echo bar
33+
# CHECK-NEXT: # .---command stderr------------
34+
# CHECK-NEXT: # | '{': command not found
35+
# CHECK: error: command failed with exit status: 127
36+
3137
# CHECK: PASS: shtest-shell :: dev-null.txt
3238

3339
# CHECK: FAIL: shtest-shell :: diff-b.txt
@@ -635,4 +641,4 @@
635641

636642
# CHECK: PASS: shtest-shell :: valid-shell.txt
637643
# CHECK: Unresolved Tests (1)
638-
# CHECK: Failed Tests (36)
644+
# CHECK: Failed Tests (37)

0 commit comments

Comments
 (0)