-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lldb] Remove process restart prompt from TestSourceManager #85861
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
Conversation
In TestSourceManager, test_artificial_source_location will give the process restart prompt if you run the test individually. The reason is that we run the process twice: first using a convenience function to run to a specific breakpoint and then again to check for a specific message emitted when you hit the breakpoint. Instead of running twice and making the test difficult to run individually, we can just check for the specific messages using other commands instead.
@llvm/pr-subscribers-lldb Author: Alex Langford (bulbazord) ChangesIn TestSourceManager, test_artificial_source_location will give the process restart prompt if you run the test individually. The reason is that we run the process twice: first using a convenience function to run to a specific breakpoint and then again to check for a specific message emitted when you hit the breakpoint. Instead of running twice and making the test difficult to run individually, we can just check for the specific messages using other commands. Full diff: https://github.com/llvm/llvm-project/pull/85861.diff 1 Files Affected:
diff --git a/lldb/test/API/source-manager/TestSourceManager.py b/lldb/test/API/source-manager/TestSourceManager.py
index eab8924d108146..896fec24791cd2 100644
--- a/lldb/test/API/source-manager/TestSourceManager.py
+++ b/lldb/test/API/source-manager/TestSourceManager.py
@@ -323,13 +323,13 @@ def test_artificial_source_location(self):
)
self.expect(
- "run",
- RUN_SUCCEEDED,
+ "thread info", substrs=[f"{src_file}:0", "stop reason = breakpoint"]
+ )
+ self.expect(
+ "frame select 0",
substrs=[
- "stop reason = breakpoint",
- "%s:%d" % (src_file, 0),
- "Note: this address is compiler-generated code in " "function",
- "that has no source code associated " "with it.",
+ "Note: this address is compiler-generated code in function",
+ "that has no source code associated with it.",
],
)
|
self.expect( | ||
"run", | ||
RUN_SUCCEEDED, | ||
"thread info", substrs=[f"{src_file}:0", "stop reason = breakpoint"] | ||
) | ||
self.expect( | ||
"frame select 0", | ||
substrs=[ | ||
"stop reason = breakpoint", | ||
"%s:%d" % (src_file, 0), | ||
"Note: this address is compiler-generated code in " "function", | ||
"that has no source code associated " "with it.", | ||
"Note: this address is compiler-generated code in function", | ||
"that has no source code associated with it.", |
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.
Can't this be a single process status
command instead of both thread info
& frame select 0
?
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.
Just tried it out, it totally can be. Thanks for the tip!
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!
In TestSourceManager, test_artificial_source_location will give the process restart prompt if you run the test individually. The reason is that we run the process twice: first using a convenience function to run to a specific breakpoint and then again to check for a specific message emitted when you hit the breakpoint. Instead of running twice and making the test difficult to run individually, we can just check for the specific messages using other commands.
In TestSourceManager, test_artificial_source_location will give the process restart prompt if you run the test individually. The reason is that we run the process twice: first using a convenience function to run to a specific breakpoint and then again to check for a specific message emitted when you hit the breakpoint. Instead of running twice and making the test difficult to run individually, we can just check for the specific messages using other commands.