Add test to confirm validation rejects invalid WGSL
BUG=dawn:504 Change-Id: If09b12d4df9c7aedcb28b4640557cc3cae6e989d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45700 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Auto-Submit: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
60ca94ba10
commit
9138fe253b
|
@ -86,6 +86,15 @@ TEST_P(ShaderTests, ComputeLog2) {
|
||||||
EXPECT_BUFFER_U32_RANGE_EQ(expected.data(), buffer, 0, kSteps);
|
EXPECT_BUFFER_U32_RANGE_EQ(expected.data(), buffer, 0, kSteps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_P(ShaderTests, BadWGSL) {
|
||||||
|
DAWN_SKIP_TEST_IF(HasToggleEnabled("skip_validation"));
|
||||||
|
|
||||||
|
std::string shader = R"(
|
||||||
|
I am an invalid shader and should never pass validation!
|
||||||
|
})";
|
||||||
|
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, shader.c_str()));
|
||||||
|
}
|
||||||
|
|
||||||
DAWN_INSTANTIATE_TEST(ShaderTests,
|
DAWN_INSTANTIATE_TEST(ShaderTests,
|
||||||
D3D12Backend(),
|
D3D12Backend(),
|
||||||
MetalBackend(),
|
MetalBackend(),
|
||||||
|
|
Loading…
Reference in New Issue