1

I have several questions about googletest framework and its usage:

By fixture in the following questions I mean a class derived from ::testing::Test

  1. As far as I know, I can use fixture along with parameterization feature of gtests. Does this apply to both value-parameterization and type-parameterization?

  2. There are cases when the fixture is irrelevant. Can I use type-parameterization with value-parameterization without fixture? How (example would be nice)?

  3. Pure interest: Can I use fixture together with type- and value-parameterization? (I am quite sure this is a needless complexity)

andrgolubev
  • 825
  • 6
  • 21
  • So with _`fixture`_ you mean the derived `::testing::Test` class? Some links for the particular features would be helpful to give concise answers to your question. – πάντα ῥεῖ Feb 01 '17 at 18:48
  • @πάνταῥεῖ you're right, `fixture` == derived from `::testing::Test`this is what I mean. I guess, what I ask are already the features of the gtest. Not sure what you mean. – andrgolubev Feb 01 '17 at 18:56

1 Answers1

2

As far as I know, I can use fixture along with parameterization feature of gtests. Does this apply to both value-parameterization and type-parameterization?

Yes, both value-parameterized tests and typed tests or type-parameterized tests must be derived from a fixture class. The linked documentation provides examples.

Can I use type-parameterization with value-parameterization without fixture

I presume you mean "type-parameterization OR value-parameterization". Anyway, you cannot use either without a fixture class, as per the same documentation.

Can I use fixture together with type- and value-parameterization?

Googletest does not expressly support type-and-value-parameterized tests, but you can make a good approximation to it with type-parameterized tests, as I illustrated in a previous answer

Community
  • 1
  • 1
Mike Kinghan
  • 55,740
  • 12
  • 153
  • 182