Closed doctormo closed 6 months ago
This already exists. Support for stack traces on failure is available if you build with Abseil support. Some day we may do this using C++23's stack traces as well.
Thanks. I'd love to see documentation about that.
Does the feature exist in the most recent commit?
As far as I can search on github, and search engines; this feature does not exist and has not been proposed before.
Why do we need this feature?
Value-Parameterized Tests are a great way of developing testing machinery which can simplify and codify the writing of tests for common structures and interfaces. The problem is that when these tests fail, the information provided to the developer does not include the correct line number, and in the case of using a utility library, the right file.
Describe the proposal.
The proposal is to use a macro and a base struct to provide the optional capability to test writers to furnish their tests with the extra information.
The code samples here are provided as proof of concepts only and I declare them public domain and CC0 on the basis they are for education and demonstration.
Code that would go into gtest
Example of a utility library using it
Example final test suite
Example output
Is the feature specific to an operating system, compiler, or build system version?
Not as far as I understand it.