Skip to content

Commit 0f74ccc

Browse files
authored
lit: Move RUN at line comment after the command.
When a developer copy/pastes a failing command line into their shell to rerun it, they have to manually delete the "RUN: at line N:" prefix. To make life easier for such developers, let's make it possible to copy/paste a command without needing to modify it while still showing the line number in the output by moving the line number to a comment at the end of the command line. Reviewers: jroelofs, MaskRay Reviewed By: jroelofs, MaskRay Pull Request: llvm/llvm-project#132485
1 parent 2477e17 commit 0f74ccc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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] = (

0 commit comments

Comments
 (0)