I have a test fixture class which is currently used by many tests.
#include <gtest/gtest.h>
class MyFixtureTest : public ::testing::Test {
void SetUp() { ... }
};
I would like to create a parameterized test which also uses all that MyFixtureTest has to offer, without needing to change all my existing tests.
How do I do that?
I have found similar discussions on the web, but have not fully understood their answers.
The problem is that for regular tests your fixture has to be derived from testing::Test and for parameterized tests, it has to be derived from testing::TestWithParam<>.
In order to accommodate that, you’ll have to modify your fixture class in order to work with your parameter type
This way you can keep all your existing tests intact while creating parameterized tests using