TEST_P / INSTANTIATE_TEST_CASE_P macros do not expand parameters
Created by: GoogleCodeExporter
If the TEST_P and INSTANTIATE_TEST_CASE_P macros age given parameters that are
macros themselves, they do not expand those macros. Expanding the macros in
parameters would make possible to conditionally disable tests.
Example:
#if defined(GTEST_OS_WINDOWS)
#define MAYBE_SomeTest DISABLED_SomeTest
#else
#define MAYBE_SomeTest SomeTest
#endif
TEST(MyTestClass, MAYBE_SomeTest) {
} // -> will produce a disabled test on Windows (DISABLED_SomeTest)
TEST_P(MyTestClass, MAYBE_SomeTest) {
} // -> will produce test named MAYBE_SomeTest
More details at
https://groups.google.com/d/topic/googletestframework/N5wCBXetcVk/discussion.
Original issue reported on code.google.com by vladlosev on 8 Nov 2011 at 5:12
Imported comments:
By GoogleCodeExporter on 2015-07-22 08:00:22 UTC
See https://codereview.chromium.org/12209016/ for how a similar issue is fixed
in Chrome-land.
Original comment by bauerb@chromium.org on 5 Feb 2013 at 7:14