This commit adds tests to ensure that queue-specific breakpoints work as expected, as this feature wasn't being tested before.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Please include more context (https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface) in future patches.
Thanks for the tests regardless!
lldb/test/API/macosx/queues/TestQueues.py | ||
---|---|---|
133 | Could you replace that with the enum variable ? | |
388 | Do you really need a main_thread variable since lldbutil.run_to_name_breakpoint would return a tuple with (target, process, thread, bkpt) ? Is the thread returned here different from the main_thread you created above ? |
Use the enum name for the stop reason when asserting that the queues hit their breakpoints instead of just the raw number.
Also, get the main thread from run_to_name_breakpoint instead of getting it from get_threads_stopped_at_breakpoint
All variables needed from run_to_name_breakpoint are obtained in one line rather than getting them by index.
lldb/test/API/macosx/queues/TestQueues.py | ||
---|---|---|
206–208 | This is a much cleaner way to write it :) |
lldb/test/API/macosx/queues/TestQueues.py | ||
---|---|---|
133 | missed assertEqual here? |
lldb/test/API/macosx/queues/TestQueues.py | ||
---|---|---|
133 | Yes, adding this in |
lldb/test/API/macosx/queues/TestQueues.py | ||
---|---|---|
135 | This should use self.assertStopReason for a better error message. | |
203–208 | This seems like it should be its own test. Right now this is reassigning the target and process, which seems suspicious, and also changes the meaning of everything that comes after it. |
lldb/test/API/macosx/queues/TestQueues.py | ||
---|---|---|
203–208 | Good point, I'm placing the queue specific tests into their own test. |
lldb/test/API/macosx/queues/TestQueues.py | ||
---|---|---|
127 | Any reason this should be a separate function? Can this be inlined in queue_specific_breakpoints? |
lldb/test/API/macosx/queues/TestQueues.py | ||
---|---|---|
127 | It can be inlined, the reason I had it in a separate function is that it matched the rest of the test in having the assertions be in their own functions. |
LGTM
lldb/test/API/macosx/queues/TestQueues.py | ||
---|---|---|
127 | Fair enough, this test has a different structure than most. Let's keep it this way then for consistency. |
Any reason this should be a separate function? Can this be inlined in queue_specific_breakpoints?