Skip to content
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

Template product test case #1468

Merged
merged 2 commits into from
Dec 10, 2018
Merged

Template product test case #1468

merged 2 commits into from
Dec 10, 2018

Conversation

JoeyGrajciar
Copy link
Contributor

Description

support for generating test cases based on multiple template template
types combined with template arguments for each of the template template
types specified

e.g.

TEMPLATE_PRODUCT_TEST_CASE("template product","[template]",
			   (std::tuple, std::pair, std::map),
			   ((int,float),(char,double),(int,char)))

will effectively create 9 test cases with types:
std::tuple<int,float>
std::tuple<char,double>
std::tuple<int,char>
std::pair<int,float>
std::pair<char, double>
std::pair<int,char>
std::map<int,float>
std::map<char,double>
std::map<int,char>

Tested type is accessible in test case body as TestType
Unique name is created by appending - <index> to test name
since preprocessor has some limitations in recursions

Closes #1454

GitHub Issues

@horenmar horenmar self-assigned this Dec 6, 2018
@codecov
Copy link

codecov bot commented Dec 7, 2018

Codecov Report

Merging #1468 into master will decrease coverage by 0.32%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1468      +/-   ##
==========================================
- Coverage   80.38%   80.06%   -0.32%     
==========================================
  Files         121      121              
  Lines        3425     3420       -5     
==========================================
- Hits         2753     2738      -15     
- Misses        672      682      +10

@codecov
Copy link

codecov bot commented Dec 7, 2018

Codecov Report

Merging #1468 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1468   +/-   ##
=======================================
  Coverage   80.38%   80.38%           
=======================================
  Files         121      121           
  Lines        3425     3425           
=======================================
  Hits         2753     2753           
  Misses        672      672

support for generating test cases based on multiple template template
types combined with template arguments for each of the template template
types specified

e.g.
```
TEMPLATE_PRODUCT_TEST_CASE("template product","[template]",
			   (std::tuple, std::pair, std::map),
			   ((int,float),(char,double),(int,char)))
```
will effectively create 9 test cases with types:
std::tuple<int,float>
std::tuple<char,double>
std::tuple<int,char>
std::pair<int,float>
std::pair<char, double>
std::pair<int,char>
std::map<int,float>
std::map<char,double>
std::map<int,char>

Tested type is accessible in test case body as TestType
Unique name is created by appending ` - <index>` to test name
since preprocessor has some limitations in recursions

Closes #1454
@horenmar horenmar merged commit 461843b into catchorg:master Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TEMPLATE_TEST_CASE does not support template templates
2 participants