iveney / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Value-parameterized tests must warn about interspersing test definitions and test case instantiations for the same test case. #65

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Some users are confused when about the effect of test case instantiations
in value-parameterized test cases. For example, in this code:
TEST_P(FooTest, TestSomething) { .. }
INSTANTIATE_TEST_CASE_P(InstantiationA, FooTest, ...);

TEST_P(FooTest, TestSomethingElse) { ... }
INSTANTIATE_TEST_CASE_P(InstantiationB, FooTest, ...);

some people expect InstantiationA NOT to instantiate
FooTest.TestSomethingElse. We need to issue a warning when TEST_P follows
INSTANTIATE_TEST_CASE_P for the same test case.

Original issue reported on code.google.com by vladlosev on 12 Nov 2008 at 7:23

GoogleCodeExporter commented 9 years ago

Original comment by w...@google.com on 27 Sep 2010 at 7:09

GoogleCodeExporter commented 9 years ago
More generally the instantiation macro for the Value-parameterized tests should 
offer a mechanism to instantiate only a subset of defined TEST_P. 
It could be for instante an optional parameter "pattern matching" the wanted 
TEST_P, or an enumeration of TEST_P.

Currently I don't see any other solution than to derivate the 
Value-parameterized fixture. 

Original comment by fabien.s...@gmail.com on 11 Aug 2014 at 8:01