-
Notifications
You must be signed in to change notification settings - Fork 10
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
CLI filtering/matching test case sections #99
Comments
Hi! There is currently no way to do this. Filtering a test case to only run certain sections would be possible, without too much cost, but figuring out the filtering syntax and how it meshes with the existing test case filtering will require some thinking. As for listing sections, that would also be possible but with a big caveat: it would require actually executing all the test code. Indeed, sections aren't known when entering a test case, they are discovered as the test code executes and encounters I know it's tempting to have one big test case with lots of sections in it :) But my advice here is, if you start to feel the need to execute only one section, then it's probably a sign that you should create a different test case. You can factor out the common code the old fashioned way, with functions and classes. |
For the filtering syntax, I was thinking that something simple would be to use a Agreed that providing test section listing support might be too much trouble than what it's worth. |
For reference, Catch2 does this with a separate CLI option |
First of all, thanks a lot for this library!
I was curious if there was a mechanism to list/match sections contained within test cases. Sections are a very convenient way to handle test setup/teardown, but the unfortunate drawback is that sections can't be run in isolation as far as I can tell.
The text was updated successfully, but these errors were encountered: