From 527f1c7ed93e430a19d7cb9220bb53c7f89cc5f4 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Tue, 19 Mar 2024 08:47:28 -0700 Subject: [PATCH] [Impeller] add test that demonstrates that VVL failures are fatal. --- impeller/entity/entity_unittests.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/impeller/entity/entity_unittests.cc b/impeller/entity/entity_unittests.cc index 1592bcb1198f1..7dcebc01f8117 100644 --- a/impeller/entity/entity_unittests.cc +++ b/impeller/entity/entity_unittests.cc @@ -2798,6 +2798,20 @@ TEST_P(EntityTest, FillPathGeometryGetPositionBufferReturnsExpectedMode) { } } +TEST_P(EntityTest, FailOnValidationError) { + if (GetParam() != PlaygroundBackend::kVulkan) { + GTEST_SKIP() << "Validation is only fatal on Vulkan backend."; + } + EXPECT_DEATH( + // The easiest way to trigger a validation error is to try to compile + // a shader with an unsupported pixel format. + GetContentContext()->GetBlendColorBurnPipeline({ + .color_attachment_pixel_format = PixelFormat::kUnknown, + .has_depth_stencil_attachments = false, + }), + ""); +} + } // namespace testing } // namespace impeller