-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
SECTION nesting broken? #519
Comments
This is not "working as intended". It's a bug. One I've not seen or had reported before, yet - after looking at the code - I can see it's been there for a long time! So thanks for bringing this up! I'll try and get it fixed in the near future. It's bad timing in a way because I'm having to redo the section tracking yet again (to be able to handle Generators) but that work is in progress and I don't know when it will be ready to roll in (and will possibly be a v2.0 thing anyway). So I'll have to fix this independently. |
The new section tracking code is in (on Develop) and fixes this bug. if you get a chance I'd appreciate if you could verify it and report back. |
Sorry for the delay. I've verified that it works on the branch 'develop' using "single_include/catch.hpp". |
Thanks for letting me know, @MoronsRuS. |
Looking at this page https://github.com/philsquared/Catch/blob/master/docs/tutorial.md, I read this: "Sections can be nested to an arbitrary depth (limited only by your stack size). Each leaf section (i.e. a section that contains no nested sections) will be executed exactly once, on a separate path of execution from any other leaf section (so no leaf section can interfere with another). A failure in a parent section will prevent nested sections from running - but then that's the idea.".
That led me to believe that the following code would generate 3 errors:
There are 4 leaf SECTIONs, so I expect each of them to run once, and 3 will generate an error.
However, only leaf section C, D and E are run. Section F is not run. I thinks it's because the failure in section E counts as a failure in section B, which prevents anymore child sections of B from running.
Is this working as intended? When section E is fixed, section F will be run, so there's no harm done. But if this is working as intended, then the paragraph that I cited above should be updated to note that if a child SECTION fails, then any remaining sibling sections will not be run.
The text was updated successfully, but these errors were encountered: