-
-
Notifications
You must be signed in to change notification settings - Fork 649
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 an exception translation mechanism + the ability for users to extend it with custom exception types #12
Comments
this is planned - also the user will be able to extend the reporting by teaching the framework about custom exception types. |
Great, loving the framework so far! |
Related: I would like to prevent Doctest from catching the exception alltogether, so the program crashes and the backtrace is shown directly in the debugger. |
@arximboldi I might add a configuration identifier for this |
Makes sense, thanks! |
…ows - relates #12 - exception translators can be registered with REGISTER_EXCEPTION_TRANSLATOR
…sers to extend it with custom exception types" - fixes #12
This should be done in the dev branch - docs also in the dev branch! Also the request of @arximboldi has been added to the roadmap but no ETA on it. |
- added builds with -fno-exceptions to travis CI
@arximboldi do you think that using DOCTEST_CONFIG_NO_EXCEPTIONS will be sufficient for your needs? it's already in the library and I don't want to complicate matters any further with more configuration options... |
Aha! no, but |
@arximboldi but using only |
Oh I missed that. I will try the other one then. I wonder if that will also make tests that check that an exception is thrown fail? But I guess those are just disabled, which is fine most of the time. This may not cover the case where you have a test checking an exception, an except different type is thrown, and you want to get the backtrace of where that comes from. Also, it would be nice to not have to recompile to do this... But all this is icing on the cake, I think this is good all for now. |
@arximboldi When using I'm not sure that introducing a new identifier to circumvent catching exceptions in the test runner is actually even possible without disabling other functionality - If you test this in a simple program and get the full backtrace even after rethrowing from a lower frame in the callstack then I might add a separate identifier - otherwise I'd advice using Also note that in version 1.2 there will be crash handling support - using signals under UNIX - and if a signal is caught doctest will report the current test case and subcases (and I might even add in the future the ability to print which was the last assert that passed successfully for additional context) |
…ows - relates #12 - exception translators can be registered with REGISTER_EXCEPTION_TRANSLATOR
- added builds with -fno-exceptions to travis CI
In some cases a test will fail because an exception is thrown. Right now it just says
"TEST CASE FAILED! (threw exception)"
It would be very helpful if it says what exception is thrown and the message.
The text was updated successfully, but these errors were encountered: