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

Type parametrised test case: support for non-type template parameters #1531

Closed
tzakharko opened this issue Feb 5, 2019 · 1 comment · Fixed by #1609
Closed

Type parametrised test case: support for non-type template parameters #1531

tzakharko opened this issue Feb 5, 2019 · 1 comment · Fixed by #1609
Assignees

Comments

@tzakharko
Copy link

tzakharko commented Feb 5, 2019

Right now, TEMPLATE_TEST_CASE and friends only seem to support type template parameters. Would be nice if we can also do something like this:

template<std::size_t,typename> struct Type;

TEMPLATE_TEST_CASE("", "", 1, 2, 3, 4) {
   Type<TestType, float> test;
}

or even

TEMPLATE_TEST_CASE("", "", (1, int), (2, float), (3, int), (4, float)) {
   Type<TestType> test;
}

P.S. Right now I am circumventing it like this:

TEMPLATE_TEST_CASE("", "", (Type<1, float), (Type<2, float), (Type<3, float), (Type<4, float)) {
   TestType test;
}

which does work

@JoeyGrajciar
Copy link
Contributor

@tzakharko actually we thought about NTTP support for TEMPLATE_PRODUCT_TEST_CASE.
We decided that it would not be so trivial since the whole generation of the final TestType depends on the template signature for that type.
Either way I think that I will take a deeper look on this feature.

@JoeyGrajciar JoeyGrajciar self-assigned this Mar 18, 2019
JoeyGrajciar added a commit that referenced this issue Apr 24, 2019
JoeyGrajciar added a commit that referenced this issue Apr 24, 2019
JoeyGrajciar added a commit that referenced this issue May 9, 2019
JoeyGrajciar added a commit that referenced this issue May 20, 2019
JoeyGrajciar added a commit that referenced this issue May 23, 2019
JoeyGrajciar added a commit that referenced this issue May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants