-
Notifications
You must be signed in to change notification settings - Fork 13.3k
lit: Move RUN at line comment after the command. #132485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lit: Move RUN at line comment after the command. #132485
Conversation
Created using spr 1.3.6-beta.1
@llvm/pr-subscribers-testing-tools Author: Peter Collingbourne (pcc) ChangesWhen a developer copy/pastes a failing command line into their Full diff: https://github.com/llvm/llvm-project/pull/132485.diff 2 Files Affected:
diff --git a/llvm/docs/CommandGuide/lit.rst b/llvm/docs/CommandGuide/lit.rst
index 8c0e275e1f8ca..812e1d819e9c8 100644
--- a/llvm/docs/CommandGuide/lit.rst
+++ b/llvm/docs/CommandGuide/lit.rst
@@ -100,7 +100,7 @@ OUTPUT OPTIONS
Each command is printed before it is executed. This can be valuable for
debugging test failures, as the last printed command is the one that failed.
- Moreover, :program:`lit` inserts ``'RUN: at line N'`` before each
+ Moreover, :program:`lit` inserts ``'RUN: at line N'`` after each
command pipeline in the output to help you locate the source line of
the failed command.
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index 00432b8d31778..dab83cbc20624 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -1231,7 +1231,7 @@ def executeScript(test, litConfig, tmpBase, commands, cwd):
# the shell's execution trace for the 'set' commands by
# redirecting their stderr to /dev/null.
if command:
- msg = f"'{dbg}': {shlex.quote(command.lstrip())}"
+ msg = f"{shlex.quote(command.lstrip())} \\# '{dbg}'"
else:
msg = f"'{dbg}' has no command after substitutions"
commands[i] = (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
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
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.