MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / compileShouldFailWith

Method compileShouldFailWith

gtests/UboUnsizedArray.cpp:31–46  ·  view source on GitHub ↗

Helper function to compile shader and check for specific error message.

Source from the content-addressed store, hash-verified

29protected:
30 // Helper function to compile shader and check for specific error message.
31 bool compileShouldFailWith(const std::string& code, const std::string& expectedError,
32 EShLanguage stage = EShLangVertex)
33 {
34 glslang::TShader shader(stage);
35 EShMessages controls = static_cast<EShMessages>(EShMsgDefault | EShMsgSpvRules | EShMsgVulkanRules);
36
37 bool success = compile(&shader, code, "", controls);
38
39 if (success) {
40 // Compilation should have failed.
41 return false;
42 }
43
44 std::string errorLog = shader.getInfoLog();
45 return errorLog.find(expectedError) != std::string::npos;
46 }
47};
48
49// Test that unsized arrays in uniform blocks work when extension is enabled.

Callers

nothing calls this directly

Calls 2

getInfoLogMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected