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
Feature Request: GIVEN/WHEN/THEN support #5
Comments
GIVEN/WHEN/THEN are just aliases for sections, which are supported. For brevity I don't support them as part of the stacktrace output. My philosophy there is that you would click the link in which case you are transported to the code where you can get the GIVEN/WHEN/THEN context. For the more detailed additional info you have to press the "output" link above the stacktrace. There you get the failures in context of the SECTIONs. You can use the I do agree however that the SECTION related additional info can be formatted better. This would also improve the display when you use GIVEN/WHEN/THEN. So I put this is on the roadmap for the next version. |
Is there something needed to activate the multiple section 'levels'? I'm referring to this image: https://github.com/JohnnyHendriks/TestAdapter_Catch2/blob/master/Docs/Images/Walkthrough-04.png I do not seem to see it in my tests. I will play around with this a bit more. Thank you! |
Ah, a picture tells a thousand word. This has nothing to do with sections. The image shows the Hierarchy view of the Test Explorer that was introduced to the Test Explorer in Visual Studio 20107 v15.6. The Hierarchy is based on information extracted from the test case name. See Capabilities - Notes on test case names for more information. Sadly, there is no mechanism in the Test Explorer to use information about Catch2 sections to build this hierarchy. Section info is only used in the additional info part of a message for a test case with failures and/or warnings. I kind of ran into a similar issue myself. As a result I have started to split my tests more into different test cases. Though I still make heavy use of sections as well, they typically just go one level less deep. An added advantage is that compilation times improve. I have noticed that the deeper nested section go the longer the compilation time is. I've had more than an order of magnitude improvement in compilation time when I completely flattened a test case into multiple test cases that didn't use sections at all. Though in the end I used only a partially flattened version of the test case, so compilation times were still acceptable while still maintaining the advantage of the use of sections. |
Formatting of SECTION related additional info was improved in the v1.4.0 release. |
I noticed in the walkthrough that nested sections are provided. I started using the GIVEN/WHEN/THEN capability in Catch2 and now find it hard to go back to sections!
If possible, it'd be awesome to support this alternate coding style in the test explorer.
The text was updated successfully, but these errors were encountered: