Skip to content

Commit 11044de

Browse files
committed
Reapply "lit: Move RUN at line comment after the command."
This reverts commit 57e89c9. Updated lit tests.
1 parent 10fd5b9 commit 11044de

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

llvm/docs/CommandGuide/lit.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ OUTPUT OPTIONS
100100

101101
Each command is printed before it is executed. This can be valuable for
102102
debugging test failures, as the last printed command is the one that failed.
103-
Moreover, :program:`lit` inserts ``'RUN: at line N'`` before each
103+
Moreover, :program:`lit` inserts ``'RUN: at line N'`` after each
104104
command pipeline in the output to help you locate the source line of
105105
the failed command.
106106

llvm/utils/lit/lit/TestRunner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ def executeScript(test, litConfig, tmpBase, commands, cwd):
12311231
# the shell's execution trace for the 'set' commands by
12321232
# redirecting their stderr to /dev/null.
12331233
if command:
1234-
msg = f"'{dbg}': {shlex.quote(command.lstrip())}"
1234+
msg = f"{shlex.quote(command.lstrip())} \\# '{dbg}'"
12351235
else:
12361236
msg = f"'{dbg}' has no command after substitutions"
12371237
commands[i] = (

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
# CHECK-NEXT: --
3232
# CHECK-NEXT: Command Output (stderr):
3333
# CHECK-NEXT: --
34-
# CHECK-NEXT: RUN: at line 1: echo start
34+
# CHECK-NEXT: echo start # RUN: at line 1
3535
# CHECK-NEXT: echo start
36-
# CHECK-NEXT: RUN: at line 2: sleep [[#]] & PID=$!
36+
# CHECK-NEXT: sleep [[#]] & PID=$! # RUN: at line 2

llvm/utils/lit/tests/shtest-run-at-line.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
# CHECK: Command Output (stderr)
1919
# CHECK-NEXT: --
20-
# CHECK-NEXT: {{^}}RUN: at line 4: true{{$}}
20+
# CHECK-NEXT: {{^}}true # RUN: at line 4{{$}}
2121
# CHECK-NEXT: true
22-
# CHECK-NEXT: {{^}}RUN: at line 5: false{{$}}
22+
# CHECK-NEXT: {{^}}false # RUN: at line 5{{$}}
2323
# CHECK-NEXT: false
2424
# CHECK-EMPTY:
2525
# CHECK-NEXT: --
@@ -29,7 +29,7 @@
2929
# CHECK: Command Output (stderr)
3030
# CHECK-NEXT: --
3131
# CHECK-NEXT: {{^}}RUN: at line 2 has no command after substitutions{{$}}
32-
# CHECK-NEXT: {{^}}RUN: at line 3: false{{$}}
32+
# CHECK-NEXT: {{^}}false # RUN: at line 3{{$}}
3333
# CHECK-NEXT: false
3434
# CHECK-EMPTY:
3535
# CHECK-NEXT: --
@@ -42,19 +42,19 @@
4242

4343
# CHECK: Command Output (stderr)
4444
# CHECK-NEXT: --
45-
# CHECK-NEXT: {{^}}RUN: at line 4: echo 'foo bar' | FileCheck
45+
# CHECK-NEXT: {{^}}echo 'foo bar' | FileCheck {{.*}} # RUN: at line 4
4646
# CHECK-NOT: RUN
47-
# CHECK: {{^}}RUN: at line 6: echo 'foo baz' | FileCheck
47+
# CHECK: {{^}}echo 'foo baz' | FileCheck {{.*}} # RUN: at line 6
4848
# CHECK-NOT: RUN
4949
# CHECK: --
5050

5151
# CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/run-line-with-newline.txt
5252

5353
# CHECK: Command Output (stderr)
5454
# CHECK-NEXT: --
55-
# CHECK-NEXT: {{^}}RUN: at line 1: echo abc |
55+
# CHECK-NEXT: {{^}}echo abc |
5656
# CHECK-NEXT: FileCheck {{.*}} &&
57-
# CHECK-NEXT: false
57+
# CHECK-NEXT: false # RUN: at line 1
5858
# CHECK-NOT: RUN
5959

6060

0 commit comments

Comments
 (0)