Fixed parameterized tests with non trivial Param type #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is an issue with non trivial Parameters type in.
Here is an example:
enum class MyEnum { One, Two };struct TestCaseParam { const char* name; MyEnum enumVal; };class TestCase : public testing::TestWithParam<TestCaseParam>INSTANTIATE_TEST_CASE_P(Prefix, TestCase, testing::Values(TestCaseParam{ "Name", MyEnum::One }));TEST_P(TestCase, test){ ... }First issue:
Test Explorer cannot deal with
test\0 #GetParam() = <structure binary>in this case. So my fix just removes the#GetParam ...part.Second issue:
In this example testSuite will be
Prefix\TestCaseand testMethod will betest\0 #GetParam() = bla-bla-blaand adapter will be trying to find
Prefix\TestCase_test\0_Test::TestBody()method and of course cannot find it. So we need transform this path toTestCase_test_Test::TestBody()one.