-
-
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
Type parametrised test cases v2 #1437
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1437 +/- ##
==========================================
- Coverage 80.31% 80.28% -0.03%
==========================================
Files 120 120
Lines 3403 3403
==========================================
- Hits 2733 2732 -1
- Misses 670 671 +1 |
Is there any progress with that PR? |
@myrgy after some minor improvements it is now waiting on review :) please be patient :) feel free to pull locally these changes and do some tests with it and share your opinions about it :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is first set of notes, I still have to dive into the macro hell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found only two, small, nitpicks in the implementation itself. Not sure if it means that I don't understand the preprocessor enough, or that there were only these two. 😃
I'll check the modified documentation tomorrow.
This adds support for templated tests and test methods via `TEMPLATE_TEST_CASE` and `TEMPLATE_TEST_CASE_METHOD` macros. These work mostly just like their regular counterparts*, but take an unlimited** number of types as their last arguments. * Unlike the plain `TEST_CASE*` macros, the `TEMPLATE*` variants require a tag string. ** In practice there is limit of about 300 types.
Description
This PR adds the support, docs and some unit tests for type parametrised test cases. This implementation supports arbitrary count of types.
Introduces
TEMPLATE_TEST_CASE
andTEMPLATE_TEST_CASE_METHOD
macros. Usage of these macros is very similar toTEST_CASE
andTEST_CASE_METHOD
. Difference is that name and description (even empty string) is required as types for test are specified at the end.Example:
Difference to #1425 is that now there will test invoker registered for each type specified. Former PR added one test invoker with multiple sections for each type, calling the templated test function with type.
Implementation of these test cases was heavily inspired by Doctest.
GitHub Issues
#46 #357 #850 ...