#include "gmock/gmock.h"
#include "src/tint/lang/core/fluent_types.h"
#include "src/tint/lang/core/type/depth_texture.h"
#include "src/tint/lang/core/type/external_texture.h"
#include "src/tint/lang/core/type/multisampled_texture.h"
#include "src/tint/lang/core/type/sampled_texture.h"
#include "src/tint/lang/core/type/texture_dimension.h"
#include "src/tint/lang/wgsl/ast/call_statement.h"
#include "src/tint/lang/wgsl/ast/disable_validation_attribute.h"
#include "src/tint/lang/wgsl/ast/id_attribute.h"
#include "src/tint/lang/wgsl/ast/stage_attribute.h"
#include "src/tint/lang/wgsl/ast/workgroup_attribute.h"
#include "src/tint/lang/wgsl/inspector/entry_point.h"
#include "src/tint/lang/wgsl/inspector/inspector.h"
#include "src/tint/lang/wgsl/inspector/inspector_builder_test.h"
#include "src/tint/lang/wgsl/inspector/inspector_runner_test.h"
#include "src/tint/lang/wgsl/program/program_builder.h"
#include "src/tint/lang/wgsl/sem/variable.h"
usingnamespacetint::core::number_suffixes;
usingnamespacetint::core::fluent_types;
namespace tint::inspector {
namespace {
class InspectorGetEntryPointTest : public InspectorBuilder, public testing::Test { … };
InspectorGetEntryPointComponentAndCompositionTestParams;
class InspectorGetEntryPointComponentAndCompositionTest
: public InspectorBuilder,
public testing::TestWithParam<InspectorGetEntryPointComponentAndCompositionTestParams> { … };
struct InspectorGetEntryPointInterpolateTestParams { … };
class InspectorGetEntryPointInterpolateTest
: public InspectorBuilder,
public testing::TestWithParam<InspectorGetEntryPointInterpolateTestParams> { … };
class InspectorGetOverrideDefaultValuesTest : public InspectorBuilder, public testing::Test { … };
class InspectorGetConstantNameToIdMapTest : public InspectorBuilder, public testing::Test { … };
class InspectorGetResourceBindingsTest : public InspectorBuilder, public testing::Test { … };
class InspectorGetUniformBufferResourceBindingsTest : public InspectorBuilder,
public testing::Test { … };
class InspectorGetStorageBufferResourceBindingsTest : public InspectorBuilder,
public testing::Test { … };
class InspectorGetReadOnlyStorageBufferResourceBindingsTest : public InspectorBuilder,
public testing::Test { … };
class InspectorGetSamplerResourceBindingsTest : public InspectorBuilder, public testing::Test { … };
class InspectorGetComparisonSamplerResourceBindingsTest : public InspectorBuilder,
public testing::Test { … };
class InspectorGetSampledTextureResourceBindingsTest : public InspectorBuilder,
public testing::Test { … };
class InspectorGetSampledArrayTextureResourceBindingsTest : public InspectorBuilder,
public testing::Test { … };
struct GetSampledTextureTestParams { … };
class InspectorGetSampledTextureResourceBindingsTestWithParam
: public InspectorBuilder,
public testing::TestWithParam<GetSampledTextureTestParams> { … };
class InspectorGetSampledArrayTextureResourceBindingsTestWithParam
: public InspectorBuilder,
public testing::TestWithParam<GetSampledTextureTestParams> { … };
class InspectorGetMultisampledTextureResourceBindingsTest : public InspectorBuilder,
public testing::Test { … };
class InspectorGetMultisampledArrayTextureResourceBindingsTest : public InspectorBuilder,
public testing::Test { … };
GetMultisampledTextureTestParams;
class InspectorGetMultisampledArrayTextureResourceBindingsTestWithParam
: public InspectorBuilder,
public testing::TestWithParam<GetMultisampledTextureTestParams> { … };
class InspectorGetMultisampledTextureResourceBindingsTestWithParam
: public InspectorBuilder,
public testing::TestWithParam<GetMultisampledTextureTestParams> { … };
class InspectorGetStorageTextureResourceBindingsTest : public InspectorBuilder,
public testing::Test { … };
struct GetDepthTextureTestParams { … };
class InspectorGetDepthTextureResourceBindingsTestWithParam
: public InspectorBuilder,
public testing::TestWithParam<GetDepthTextureTestParams> { … };
class InspectorGetDepthMultisampledTextureResourceBindingsTest : public InspectorBuilder,
public testing::Test { … };
DimensionParams;
TexelFormatParams;
GetStorageTextureTestParams;
class InspectorGetStorageTextureResourceBindingsTestWithParam
: public InspectorBuilder,
public testing::TestWithParam<GetStorageTextureTestParams> { … };
class InspectorGetExternalTextureResourceBindingsTest : public InspectorBuilder,
public testing::Test { … };
class InspectorGetSamplerTextureUsesTest : public InspectorRunner, public testing::Test { … };
class InspectorGetUsedExtensionNamesTest : public InspectorRunner, public testing::Test { … };
class InspectorGetEnableDirectivesTest : public InspectorRunner, public testing::Test { … };
class InspectorGetBlendSrcTest : public InspectorBuilder, public testing::Test { … };
class InspectorRegressionTest : public InspectorRunner, public testing::Test { … };
TEST_F(InspectorGetEntryPointTest, NoFunctions) { … }
TEST_F(InspectorGetEntryPointTest, NoEntryPoints) { … }
TEST_F(InspectorGetEntryPointTest, OneEntryPoint) { … }
TEST_F(InspectorGetEntryPointTest, MultipleEntryPoints) { … }
TEST_F(InspectorGetEntryPointTest, MixFunctionsAndEntryPoints) { … }
TEST_F(InspectorGetEntryPointTest, DefaultWorkgroupSize) { … }
TEST_F(InspectorGetEntryPointTest, PushConstantSizeNone) { … }
TEST_F(InspectorGetEntryPointTest, PushConstantSizeOneWord) { … }
TEST_F(InspectorGetEntryPointTest, PushConstantSizeThreeWords) { … }
TEST_F(InspectorGetEntryPointTest, PushConstantSizeTwoConstants) { … }
TEST_F(InspectorGetEntryPointTest, NonDefaultWorkgroupSize) { … }
TEST_F(InspectorGetEntryPointTest, WorkgroupStorageSizeEmpty) { … }
TEST_F(InspectorGetEntryPointTest, WorkgroupStorageSizeSimple) { … }
TEST_F(InspectorGetEntryPointTest, WorkgroupStorageSizeCompoundTypes) { … }
TEST_F(InspectorGetEntryPointTest, WorkgroupStorageSizeAlignmentPadding) { … }
TEST_F(InspectorGetEntryPointTest, WorkgroupStorageSizeStructAlignment) { … }
TEST_F(InspectorGetEntryPointTest, NoInOutVariables) { … }
TEST_P(InspectorGetEntryPointComponentAndCompositionTest, Test) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(InspectorGetEntryPointTest, MultipleInOutVariables) { … }
TEST_F(InspectorGetEntryPointTest, MultipleEntryPointsInOutVariables) { … }
TEST_F(InspectorGetEntryPointTest, BuiltInsNotStageVariables) { … }
TEST_F(InspectorGetEntryPointTest, InOutStruct) { … }
TEST_F(InspectorGetEntryPointTest, MultipleEntryPointsInOutSharedStruct) { … }
TEST_F(InspectorGetEntryPointTest, MixInOutVariablesAndStruct) { … }
TEST_F(InspectorGetEntryPointTest, OverrideUnreferenced) { … }
TEST_F(InspectorGetEntryPointTest, OverrideReferencedByEntryPoint) { … }
TEST_F(InspectorGetEntryPointTest, OverrideReferencedByCallee) { … }
TEST_F(InspectorGetEntryPointTest, OverrideSomeReferenced) { … }
TEST_F(InspectorGetEntryPointTest, OverrideReferencedIndirectly) { … }
TEST_F(InspectorGetEntryPointTest, OverrideReferencedIndirectly_ViaPrivateInitializer) { … }
TEST_F(InspectorGetEntryPointTest, OverrideReferencedIndirectly_MultipleEntryPoints) { … }
TEST_F(InspectorGetEntryPointTest, OverrideReferencedByAttribute) { … }
TEST_F(InspectorGetEntryPointTest, OverrideReferencedByAttributeIndirectly) { … }
TEST_F(InspectorGetEntryPointTest, OverrideReferencedByArraySize) { … }
TEST_F(InspectorGetEntryPointTest, OverrideReferencedByArraySizeIndirectly) { … }
TEST_F(InspectorGetEntryPointTest, OverrideReferencedByArraySizeViaAlias) { … }
TEST_F(InspectorGetEntryPointTest, OverrideTypes) { … }
TEST_F(InspectorGetEntryPointTest, OverrideInitialized) { … }
TEST_F(InspectorGetEntryPointTest, OverrideUninitialized) { … }
TEST_F(InspectorGetEntryPointTest, OverrideNumericIDSpecified) { … }
TEST_F(InspectorGetEntryPointTest, NonOverrideSkipped) { … }
TEST_F(InspectorGetEntryPointTest, BuiltinNotReferenced) { … }
TEST_F(InspectorGetEntryPointTest, InputSampleMaskSimpleReferenced) { … }
TEST_F(InspectorGetEntryPointTest, InputSampleMaskStructReferenced) { … }
TEST_F(InspectorGetEntryPointTest, OutputSampleMaskSimpleReferenced) { … }
TEST_F(InspectorGetEntryPointTest, OutputSampleMaskStructReferenced) { … }
TEST_F(InspectorGetEntryPointTest, InputPositionSimpleReferenced) { … }
TEST_F(InspectorGetEntryPointTest, InputPositionStructReferenced) { … }
TEST_F(InspectorGetEntryPointTest, FrontFacingSimpleReferenced) { … }
TEST_F(InspectorGetEntryPointTest, FrontFacingStructReferenced) { … }
TEST_F(InspectorGetEntryPointTest, SampleIndexSimpleReferenced) { … }
TEST_F(InspectorGetEntryPointTest, SampleIndexStructReferenced) { … }
TEST_F(InspectorGetEntryPointTest, NumWorkgroupsSimpleReferenced) { … }
TEST_F(InspectorGetEntryPointTest, NumWorkgroupsStructReferenced) { … }
TEST_F(InspectorGetEntryPointTest, FragDepthSimpleReferenced) { … }
TEST_F(InspectorGetEntryPointTest, FragDepthStructReferenced) { … }
TEST_F(InspectorGetEntryPointTest, ImplicitInterpolate) { … }
TEST_F(InspectorGetEntryPointTest, PixelLocalMemberDefault) { … }
TEST_F(InspectorGetEntryPointTest, PixelLocalMemberTypes) { … }
TEST_P(InspectorGetEntryPointInterpolateTest, Test) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(InspectorGetOverrideDefaultValuesTest, Bool) { … }
TEST_F(InspectorGetOverrideDefaultValuesTest, U32) { … }
TEST_F(InspectorGetOverrideDefaultValuesTest, I32) { … }
TEST_F(InspectorGetOverrideDefaultValuesTest, F32) { … }
TEST_F(InspectorGetOverrideDefaultValuesTest, F16) { … }
TEST_F(InspectorGetConstantNameToIdMapTest, WithAndWithoutIds) { … }
TEST_F(InspectorGetResourceBindingsTest, Empty) { … }
TEST_F(InspectorGetResourceBindingsTest, Simple) { … }
TEST_F(InspectorGetResourceBindingsTest, InputAttachment) { … }
TEST_F(InspectorGetUniformBufferResourceBindingsTest, MissingEntryPoint) { … }
TEST_F(InspectorGetUniformBufferResourceBindingsTest, NonEntryPointFunc) { … }
TEST_F(InspectorGetUniformBufferResourceBindingsTest, Simple_NonStruct) { … }
TEST_F(InspectorGetUniformBufferResourceBindingsTest, Simple_Struct) { … }
TEST_F(InspectorGetUniformBufferResourceBindingsTest, MultipleMembers) { … }
TEST_F(InspectorGetUniformBufferResourceBindingsTest, ContainingPadding) { … }
TEST_F(InspectorGetUniformBufferResourceBindingsTest, NonStructVec3) { … }
TEST_F(InspectorGetUniformBufferResourceBindingsTest, MultipleUniformBuffers) { … }
TEST_F(InspectorGetUniformBufferResourceBindingsTest, ContainingArray) { … }
TEST_F(InspectorGetStorageBufferResourceBindingsTest, Simple_NonStruct) { … }
TEST_F(InspectorGetStorageBufferResourceBindingsTest, Simple_Struct) { … }
TEST_F(InspectorGetStorageBufferResourceBindingsTest, MultipleMembers) { … }
TEST_F(InspectorGetStorageBufferResourceBindingsTest, MultipleStorageBuffers) { … }
TEST_F(InspectorGetStorageBufferResourceBindingsTest, ContainingArray) { … }
TEST_F(InspectorGetStorageBufferResourceBindingsTest, ContainingRuntimeArray) { … }
TEST_F(InspectorGetStorageBufferResourceBindingsTest, ContainingPadding) { … }
TEST_F(InspectorGetStorageBufferResourceBindingsTest, NonStructVec3) { … }
TEST_F(InspectorGetStorageBufferResourceBindingsTest, SkipReadOnly) { … }
TEST_F(InspectorGetReadOnlyStorageBufferResourceBindingsTest, Simple) { … }
TEST_F(InspectorGetReadOnlyStorageBufferResourceBindingsTest, MultipleStorageBuffers) { … }
TEST_F(InspectorGetReadOnlyStorageBufferResourceBindingsTest, ContainingArray) { … }
TEST_F(InspectorGetReadOnlyStorageBufferResourceBindingsTest, ContainingRuntimeArray) { … }
TEST_F(InspectorGetReadOnlyStorageBufferResourceBindingsTest, SkipNonReadOnly) { … }
TEST_F(InspectorGetSamplerResourceBindingsTest, Simple) { … }
TEST_F(InspectorGetSamplerResourceBindingsTest, NoSampler) { … }
TEST_F(InspectorGetSamplerResourceBindingsTest, InFunction) { … }
TEST_F(InspectorGetSamplerResourceBindingsTest, UnknownEntryPoint) { … }
TEST_F(InspectorGetSamplerResourceBindingsTest, SkipsComparisonSamplers) { … }
TEST_F(InspectorGetComparisonSamplerResourceBindingsTest, Simple) { … }
TEST_F(InspectorGetComparisonSamplerResourceBindingsTest, NoSampler) { … }
TEST_F(InspectorGetComparisonSamplerResourceBindingsTest, InFunction) { … }
TEST_F(InspectorGetComparisonSamplerResourceBindingsTest, UnknownEntryPoint) { … }
TEST_F(InspectorGetComparisonSamplerResourceBindingsTest, SkipsSamplers) { … }
TEST_F(InspectorGetSampledTextureResourceBindingsTest, Empty) { … }
TEST_P(InspectorGetSampledTextureResourceBindingsTestWithParam, textureSample) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(InspectorGetSampledArrayTextureResourceBindingsTestWithParam, textureSample) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(InspectorGetMultisampledTextureResourceBindingsTestWithParam, textureLoad) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(InspectorGetMultisampledArrayTextureResourceBindingsTest, Empty) { … }
TEST_F(InspectorGetStorageTextureResourceBindingsTest, Empty) { … }
TEST_P(InspectorGetStorageTextureResourceBindingsTestWithParam, Simple) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(InspectorGetDepthTextureResourceBindingsTestWithParam, textureDimensions) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(InspectorGetDepthMultisampledTextureResourceBindingsTest, textureDimensions) { … }
TEST_F(InspectorGetExternalTextureResourceBindingsTest, Simple) { … }
TEST_F(InspectorGetSamplerTextureUsesTest, None) { … }
TEST_F(InspectorGetSamplerTextureUsesTest, Simple) { … }
TEST_F(InspectorGetSamplerTextureUsesTest, UnknownEntryPoint) { … }
TEST_F(InspectorGetSamplerTextureUsesTest, MultipleCalls) { … }
TEST_F(InspectorGetSamplerTextureUsesTest, BothIndirect) { … }
TEST_F(InspectorGetSamplerTextureUsesTest, SamplerIndirect) { … }
TEST_F(InspectorGetSamplerTextureUsesTest, TextureIndirect) { … }
TEST_F(InspectorGetSamplerTextureUsesTest, NeitherIndirect) { … }
TEST_F(InspectorGetSamplerTextureUsesTest, Complex) { … }
TEST_F(InspectorGetUsedExtensionNamesTest, Empty) { … }
TEST_F(InspectorGetUsedExtensionNamesTest, None) { … }
TEST_F(InspectorGetUsedExtensionNamesTest, Simple) { … }
TEST_F(InspectorGetUsedExtensionNamesTest, Duplicated) { … }
TEST_F(InspectorGetEnableDirectivesTest, Empty) { … }
TEST_F(InspectorGetEnableDirectivesTest, None) { … }
TEST_F(InspectorGetEnableDirectivesTest, Simple) { … }
TEST_F(InspectorGetEnableDirectivesTest, Duplicated) { … }
TEST_F(InspectorRegressionTest, tint967) { … }
class InspectorTextureTest : public InspectorRunner, public testing::Test { … };
TEST_F(InspectorTextureTest, TextureLevelInEP) { … }
TEST_F(InspectorTextureTest, TextureLevelInEPNoDups) { … }
TEST_F(InspectorTextureTest, TextureLevelInEPMultiple) { … }
TEST_F(InspectorTextureTest, TextureSamplesInEP) { … }
TEST_F(InspectorTextureTest, TextureSamplesInEPNoDups) { … }
TEST_F(InspectorTextureTest, TextureSamplesInEPMultiple) { … }
TEST_F(InspectorTextureTest, TextureLoadInEP) { … }
TEST_F(InspectorTextureTest, TextureLoadMultisampledInEP) { … }
TEST_F(InspectorTextureTest, TextureLoadMultipleInEP) { … }
TEST_F(InspectorTextureTest, TextureInSubfunction) { … }
TEST_F(InspectorTextureTest, TextureMultipleEPs) { … }
TEST_F(InspectorGetBlendSrcTest, Basic) { … }
}
static std::ostream& operator<<(std::ostream& out, const Inspector::TextureQueryType& ty) { … }
}