Allow user-defined TEST_PROTECT & TEST_ABORT macros#695
Merged
mvandervoord merged 1 commit intoThrowTheSwitch:masterfrom Sep 19, 2023
Merged
Conversation
Contributor
Author
|
Marking this as a draft because the patch is missing docs update. 🙂 Also, please let me know if this path is acceptable, then I'll update the relevant markdown files. |
Member
|
Hi. Thanks for the patch! I appreciate that you've matched the pattern of usage we have for other override-able options in the project. If you update the configuration docs with this, I'd say you have a great feature here. :) |
However rare, this update covers real-world use cases where: - Unity is used to provide the assertion macros only, and an external test harness/runner is used for test orchestration/reporting. - Calling longjmp on a given platform is possible, but has a platform-specific (or implementation-specific) set of prerequisites, e.g. privileged access level. Enable project-specific customisation of TEST_PROTECT and TEST_ABORT macros. - Use the user-defined UNITY_TEST_ABORT if available; fall back to default behaviour otherwise. - Use the user-defined UNITY_TEST_PROTECT if available; fall back to default behaviour otherwise. - These may be defined independently.
8acfb0a to
710bb58
Compare
Contributor
Author
|
I've updated the docs. I think the macro descriptions are OK, but my view is rather biased, so I'd appreciate any reviews. 😉 |
Contributor
Author
|
Hi there. It's been a while so I took another look at the docs, and I'd say both the macro descriptions and the code snippets still make sense. @mvandervoord, could you review the PR when you get a chance? |
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.
This update covers use cases where:
longjmpon a given platform is possible, but has a platform-specific (or implementation-specific) set of prerequisites, e.g. privileged access level. Which has been mentioned in Prevent unity from bailing on failed tests #616 (comment).Enable project-specific customisation of
TEST_PROTECTandTEST_ABORTmacros:UNITY_TEST_ABORTif available; fall back to default behaviour otherwise.UNITY_TEST_PROTECTif available; fall back to default behaviour otherwise.