-
-
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
Failure reporting should print out previous SECTIONs for data-driven testing #734
Comments
The Console reporter now "traces" the full section stack of its current test execution and prints it out instead of the section stack of the failing assertion itself. Likewise, the JUnit reporter now groups assertions together into the <testcase> of the test execution where they happened. This fixes catchorg#734 and allows post-condition tests after the deepest SECTION in a test execution.
+1. Many of my tests are either made of common code and So far, I have been working around the issue by packing most common code and I have managed to modify Catch to fix the issue with both reporters where this seems sensible (console and JUnit), see #736. |
The Console reporter now "traces" the full section stack of its current test execution and prints it out instead of the section stack of the failing assertion itself. Likewise, the JUnit reporter now groups assertions together into the <testcase> of the test execution where they happened. This fixes catchorg#734 and allows post-condition tests after the deepest SECTION in a test execution.
For the record I agree with this request and it's on my queue |
Any news on this? This would be quite useful to have. |
Since generators have been added to Catch, you should either use them for data driven testing, or you make your own reporter. |
If a testcase differs only in the amount of input data, it would be nice to use
SECTION
to pass these bits into the object under test, like the following example. However, because theREQUIRE
stanza is outside of the nestedSECTION
s, error messages do not contain references to the failing sections.This can be worked around by adding additional macros, but it quickly gets ugly when the test involves more than few statements.
I would like Catch to keep track of those
SECTION
s which have been already closed, and to add their names into the test output if expectations fail.The text was updated successfully, but these errors were encountered: