-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
Add API for reporting failures #9
Comments
Just to let you know - There will be a better way of doing this in the future :) (I also saw this - cool!) |
Looking forward to it. |
…(like warn/check/require) and the appropriate ADD_<LEVEL>_AT macros for integration with mocking frameworks and other third party - fixes #9
This is implemented in the dev branch. doctest version 1.2 is expected to ship in the near month and then this issue will be closed. Use like this: ADD_FAIL_AT("asd.cpp", 45, "some string" << some_variable << "more stuff"); Alternatively there is |
Cool! Tried it, and am ready to update the documentation for Trompeloeil as soon as 1.2 is out. |
It would be marvellous if there was a supported way to report failures from 3rd party tools. As mentioned, you can throw exceptions, but that is not always a good idea (during stack rollback, for example.) There is also the option to just use REQUIRE_FALSE(message), but it does not give as nice messages and attributes file/line to the function that does the reporting.
In a proof of concept reporter for trompeloeil mocking framework I successfully used:
This works fine, but relying on undocumented internal functions is never a good idea.
The text was updated successfully, but these errors were encountered: