[Impeller] Remove duplicate entity test suite instantiations. (#48654)
And make it illegal to do so in the future. Now, making such a mistake will lead to a linker error complaining about duplicate definitions of `kYouInstantiatedEntityTestMultipleTimes`.
Fixes https://github.com/flutter/flutter/issues/139090
diff --git a/impeller/entity/contents/checkerboard_contents_unittests.cc b/impeller/entity/contents/checkerboard_contents_unittests.cc
index b69ab65..4632862 100644
--- a/impeller/entity/contents/checkerboard_contents_unittests.cc
+++ b/impeller/entity/contents/checkerboard_contents_unittests.cc
@@ -17,7 +17,6 @@
namespace testing {
using EntityTest = EntityPlayground;
-INSTANTIATE_PLAYGROUND_SUITE(EntityTest);
#ifdef IMPELLER_DEBUG
TEST(EntityTest, HasNulloptCoverage) {
diff --git a/impeller/entity/contents/tiled_texture_contents_unittests.cc b/impeller/entity/contents/tiled_texture_contents_unittests.cc
index 9d12c22..2ec54a8 100644
--- a/impeller/entity/contents/tiled_texture_contents_unittests.cc
+++ b/impeller/entity/contents/tiled_texture_contents_unittests.cc
@@ -15,7 +15,6 @@
namespace testing {
using EntityTest = EntityPlayground;
-INSTANTIATE_PLAYGROUND_SUITE(EntityTest);
TEST_P(EntityTest, TiledTextureContentsRendersWithCorrectPipeline) {
TextureDescriptor texture_desc;
diff --git a/impeller/entity/contents/vertices_contents_unittests.cc b/impeller/entity/contents/vertices_contents_unittests.cc
index 9ad4368..5d928e1 100644
--- a/impeller/entity/contents/vertices_contents_unittests.cc
+++ b/impeller/entity/contents/vertices_contents_unittests.cc
@@ -21,7 +21,6 @@
namespace testing {
using EntityTest = EntityPlayground;
-INSTANTIATE_PLAYGROUND_SUITE(EntityTest);
std::shared_ptr<VerticesGeometry> CreateColorVertices(
const std::vector<Point>& vertices,
diff --git a/impeller/playground/playground_test.h b/impeller/playground/playground_test.h
index df62dee..7aba4ee 100644
--- a/impeller/playground/playground_test.h
+++ b/impeller/playground/playground_test.h
@@ -55,14 +55,16 @@
PlaygroundTest& operator=(const PlaygroundTest&) = delete;
};
-#define INSTANTIATE_PLAYGROUND_SUITE(playground) \
- INSTANTIATE_TEST_SUITE_P( \
- Play, playground, \
- ::testing::Values(PlaygroundBackend::kMetal, \
- PlaygroundBackend::kOpenGLES, \
- PlaygroundBackend::kVulkan), \
- [](const ::testing::TestParamInfo<PlaygroundTest::ParamType>& info) { \
- return PlaygroundBackendToString(info.param); \
+#define INSTANTIATE_PLAYGROUND_SUITE(playground) \
+ [[maybe_unused]] const char* kYouInstantiated##playground##MultipleTimes = \
+ ""; \
+ INSTANTIATE_TEST_SUITE_P( \
+ Play, playground, \
+ ::testing::Values(PlaygroundBackend::kMetal, \
+ PlaygroundBackend::kOpenGLES, \
+ PlaygroundBackend::kVulkan), \
+ [](const ::testing::TestParamInfo<PlaygroundTest::ParamType>& info) { \
+ return PlaygroundBackendToString(info.param); \
});
} // namespace impeller