Support enabling/disabling toggles in unittests

Refactors support for toggle control flags, --enable-toggles= &
--disable-toggles, from the end2end tests into a utility class to make
them available elsewhere. The unittests now uses this utility class to
parse toggle control flags.

For some toggles, like 'use_tint_generator', the unittests are known to
be broken with them turned on. They will be fixed in subsequent CLs.

BUG=dawn:756

Change-Id: Ic283e8a82bedcbf255258cca3e62f58c79d3857b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47740
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
Ryan Harrison
2021-04-14 14:55:07 +00:00
committed by Commit Bot service account
parent f7d01e07cd
commit acdc35dc39
13 changed files with 218 additions and 22 deletions

View File

@@ -393,6 +393,8 @@ TEST_F(RenderPipelineValidationTest, AlphaToCoverageAndSampleCount) {
// Tests that the texture component type in shader must match the bind group layout.
TEST_F(RenderPipelineValidationTest, TextureComponentTypeCompatibility) {
DAWN_SKIP_TEST_IF(HasToggleEnabled("use_tint_generator"));
constexpr uint32_t kNumTextureComponentType = 3u;
std::array<const char*, kNumTextureComponentType> kScalarTypes = {{"f32", "i32", "u32"}};
std::array<wgpu::TextureSampleType, kNumTextureComponentType> kTextureComponentTypes = {{
@@ -430,6 +432,8 @@ TEST_F(RenderPipelineValidationTest, TextureComponentTypeCompatibility) {
// Tests that the texture view dimension in shader must match the bind group layout.
TEST_F(RenderPipelineValidationTest, TextureViewDimensionCompatibility) {
DAWN_SKIP_TEST_IF(HasToggleEnabled("use_tint_generator"));
constexpr uint32_t kNumTextureViewDimensions = 6u;
std::array<const char*, kNumTextureViewDimensions> kTextureKeywords = {{
"texture_1d",