Enable SCOPED_TRACE in Rust googletest crate.#799
Merged
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
7dbfe3f to
10a9831
Compare
b61be76 to
aa102b1
Compare
This CL provides an equivalent to C++ gTest's SCOPED_TRACE in Rust tests by integrating it into the googletest crate. Rationale: - Failures in table-driven tests or tests with random inputs are hard to understand without context. SCOPED_TRACE allows adding this context. Details: - Added scoped_trace! macro that pushes traces to a thread-local stack. - Used RAII guard to pop traces when going out of scope. - Made the guard !Send and !Sync to prevent crossing .await points in async tests. - Integrated with TestAssertionFailure to include traces in failure messages. - Installed a panic hook to print traces on fatal panics. - Added golden test to validate printed output of SCOPED_TRACE. PUBLIC: Internal PiperOrigin-RevId: 913832932
aa102b1 to
e489b8c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable SCOPED_TRACE in Rust googletest crate.
This CL provides an equivalent to C++ gTest's SCOPED_TRACE in Rust tests by integrating it into the googletest crate.
Rationale:
Details:
PUBLIC: Internal